Ultimate Bot Random Quoter

By NickLeStrange on Jan 10, 2013

So, my friend "dev" came up with this idea, where our bot quotes random stuff that we said from a log at random times. It seems a simple idea when you think about it, but once you start scripting it's sort of hard to imagine how it will do it. Well this is how it was for me. Until bam - it hit me.

Instead of reading from the regular channel log that mIRC creates, it will read from a log that the script creates, because the standard mIRC log comes with timestamps and nicknames, and stripping them will take way too much effort in scripting, though, I am quite positive that someone with tons more skill than my basic skills can do so.

Now this script assumes that you have the text file already in the mIRC directory.
It will generate two random numbers and compare them, if both numbers match, it does a random say. This is to ensure that it doesn't do it very often, which can get annoying.

Feel free to adjust the values. Higher values will reduce the amount of times a number will match. Reducing of course means a higher matching rate.

Simple right?

** Use as is if you want. Just give credit to myself and devSaturnine
*** Modify it if you want, just give us credit, and let me know.

Written for mIRC 6.35.

on 1:TEXT:*:#channel_name: {
; Logs whatever is said in the channel to the RandomSay.txt file
  write -i RandomSay.txt $1-

; Generates a random number
  var %r = $rand(1,166)

; Generates another random number
  var %r2 = $rand(1,180)

; Sets the variables with the two random numbers
  set %randomtalk %r
  set %randommatch %r2

; If both random numbers corresponds, then it does the say with a random line from
; the text file.
  if (%randomtalk == %randommatch) .msg #channel_name $read(RandomSay.txt)
  .echo ** The current variable is %randomtalk and we are looking for %randommatch 
}

Comments

Sign in to comment.
dma   -  Dec 18, 2015

is this good for 7.43 version of mirc???

 Respond  
Chemich   -  Sep 07, 2013

Would there be a way to have this work across many different channels? I've tried just copying and pasting it on different lines and changing the channel, but that doesn't seem to work. Also tried $chan, but that will just go to one channel every time.

I used this for my twitch bot that I let my friends have access too, any help would be greatly appreciated! ^^

NickLeStrange  -  Sep 07, 2013

on 1:text:*:#: {

That should do the trick.

NickLeStrange  -  Sep 07, 2013

Oh, you meant the say part. Hmm, that's quite an interesting proposition. I'll have to think about that. Technically it should do it for the chan in which it was triggered. Unless mIRC only sends to the chan that is in focus.

Edit: You could try adding a var %ch = $chan (just below the write).
Then in the random match area, change #channel_name to %ch (that should do the trick).

Chemich  -  Nov 10, 2013

Found another means just by doing something like :#chan1,#chan2,#chan3: thanks for the help anyways man. :>

Sign in to comment

alabama   -  Apr 21, 2013

like the comments

NickLeStrange  -  Apr 23, 2013

So many of them, yeah. :)

Sign in to comment

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.