Add Random Comments For Your Bot

By CaRe_Taker on Feb 21, 2006

just add this file to The Remotes Section of ure bot mirc
Then go into the main file an Create a txt file names Random.txt save it then
any user in the chat can add Random comments by usin !add
shows the Random comments By typing !say
Display the list using While loops !list will display the entire txt file

This is the first attempt at while loops :)

  on *:TEXT:*:#: { 
    if ($strip($1) == !add) { /write random.txt $2- | /msg $chan 1,13 $nick Just Added $2- To The Random Comments List }
    if ($strip($1) == !say) { /msg $chan 4,1 $+ $read(random.txt) }
    if ($strip($1) == !list) { var %line.index = 1 | while (%line.index <= $lines(random.txt)) { /msg $nick $read(random.txt,%line.index) | inc %line.index } }
  }

Comments

Sign in to comment.
Jamiie   -  Jul 21, 2008

Get rid of the /\'s in the commands. Makes the snippet look messy.

 Respond  
Fuzion   -  Jul 21, 2008

nice

 Respond  
CaRe_Taker   -  Feb 24, 2006

Ty noMen ^_^

 Respond  
CaRe_Taker   -  Feb 24, 2006

Ty noMen ^_^

 Respond  
noMen   -  Feb 24, 2006

I\'m sorry but I don\'t see the use of tokenize. Also $$1 is not necessary: if ($strip($1) == !add) works fine.

 Respond  
CaRe_Taker   -  Feb 24, 2006

ive neva used tokenize :|
didnt Know how to apply it to a script
i shall try :)

 Respond  
KuTsuM   -  Feb 23, 2006

I\'m sorry, on my last comment, this is how it should be:
tokenize 32 $+($strip($1),$chr(32),$2-)

 Respond  
KuTsuM   -  Feb 23, 2006

Try this:
tokenize 32 $+($strip($1),$2-)
if ($1 = !add) { }
It\'s a bit easier.

 Respond  
CaRe_Taker   -  Feb 22, 2006

bro my bot is admin ^_^
but i can change that :)
take that command out
ty for the comment is shall play around with it :)

 Respond  
noMen   -  Feb 22, 2006

If you let users store and recall phrases in/from your bot you should use \"n\" in the read statement, like $read(random.txt, n). Otherwise they can take control of your bot. Another thing: if you have many phrases in random.txt, probably !list will let your bot flood. Instead of while loop and notice you could also play the file privately to the user.

 Respond  
CaRe_Taker   -  Feb 21, 2006

yeah bro
it works :)

 Respond  
RoninWarrior   -  Feb 21, 2006

if ($strip($$1) == !add) ? Can this be used this way? i have never seen it done this way before.

 Respond  
CaRe_Taker   -  Feb 21, 2006

any comments would be apreciated :)

 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.