.view

By MewLaue on Feb 21, 2006

type in channel / query to bot:

.view file

to view a text file

alias view {
  %file = $1
  if ($isfile(%file) == $true) {
    %i = 0
    %viewtimer = 1
    %lines = $lines(%file)
    :nextzeile
    inc %i
    inc %viewtimer 2
    if ($read(%file,%i) != $null) { timer 1 %viewtimer msg $nick * $read(%file,%i) }
    if ($read(%file,%i) == $null) { timer 1 %viewtimer msg $nick * }
    if %i = %lines { goto end }
    if %i < %lines { goto nextzeile }
    :end
  }
  else { msg $nick " $+ %file $+ " is no file }
}

on *:text:.view*:*:{ view $2 }

Comments

Sign in to comment.
KuTsuM   -  Feb 23, 2006

While loops are rather helpfull ;p

Also,
%viewtimer = 1
%lines = $lines(%file)
Are those globally pre-set variables? I suppose your using them just for this exact purpose, which makes them rather useless, and a waste of space. Look into the /var command: /help /var

 Respond  
anthalus   -  Feb 22, 2006

This is quite a dangerous script without protections built in. A level system could be overcome fairly easily. I would add a check system that only allows certain areas of a specific folder for increased safety.

 Respond  
MewLaue   -  Feb 22, 2006

excuse me please

after you load this script by your bot type in chan (where the bot is) or query the bot
.view FILE

than the bot query you and send you every line of the FILE, that you want to view

 Respond  
F*U*R*B*Y*   -  Feb 22, 2006

u didn\'t answer my question anyways

 Respond  
MewLaue   -  Feb 22, 2006

(i\'ve test the script and it works)

 Respond  
MewLaue   -  Feb 22, 2006

I know its dangerus, but you can easy change the userlevel:

before:
on :text:.view:*:{ view $2 }

after:
on 20:text:.view::{ view $2 }

and.. there is an floodprotection in the script

I\'ve used a timer that add +2 seconds per line
see this:
...
%viewtimer = 1
:nextzeile
inc %viewtimer 2
...
if %i < %lines { goto nextzeile }
...

thats the same :)

@bearruler you can use an $nick identifier in an alias
test it ;)

 Respond  
F*U*R*B*Y*   -  Feb 21, 2006

wat does it actaully do?

 Respond  
therannmann2000   -  Feb 21, 2006

On major servers (or any with flood protection), using play you might want to add a delay. (ex: /play $2 3) A 3 second delay is usually fine. Just a heads up :D

 Respond  
bearruler   -  Feb 21, 2006

Sorry,
Its play $nick $2

Bear

 Respond  
bearruler   -  Feb 21, 2006

Please test snippets before posting them
Aliases do not have a $nick identifier

You could have used /play too

on :text:.view :*: play $2 $nick

I believe that does it too

This snippet is very dangerous though
If you have auto-identify preform commands, people could just view your mirc.ini file and get your password

Bear

 Respond  
xDaeMoN   -  Feb 21, 2006

Use /play ;)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.