[MRC]Simple Random Quote IRC Bot
Each time the bot receives something it will count points
till the amount of points is equal or more then the amount
of points in the variable %talkreq once it reached that amount
it will output a random quote from a text file called quotes.txt
Note : It only responds on a text message.
Commands :
!nick - Changes the nick of the bot
!viewrand - Shows the amount of points the bot has
!setvar %<variablename> <value> - Sets a value
How to use :
1 - Put it in your mirc remotes
2 - Add a variable called %access_<your nick> and set it to 255
3 - Add a variable called %ralkreq and set it to 100
Code:
on *:TEXT:!nick*:#: {
if (%access_ [ $+ [ $nick ] ] == 255) {
nick $2
}
else {
/notice $nick you dont have access to use this command.
}
}
on *:TEXT:!viewrand*:#: {
if (%access_ [ $+ [ $nick ] ] == 255) {
msg $chan %randtalk_ [ $+ [ $chan ] ]
}
else {
/notice $nick you dont have access to use this command.
}
}
on *:TEXT:!setvar*:#: {
if (%access_ [ $+ [ $nick ] ] == 255) {
set $2 $3
/notice $nick The variable $2 has been set to $3
}
else {
/notice $nick you dont have access to use this command.
}
}
on *:TEXT:*:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,10)
}
if (%talkreq <= %randtalk_ [ $+ [ $chan ] ]) {
msg $chan $read(quote.txt)
set %randtalk_ [ $+ [ $chan ] ] 0
}
}
on *:JOIN:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,20)
}
}
on *:PART:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
on *:PING:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
on *:QUIT:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
on *:VOICE:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
on *:OP:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
on *:KICK:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
on *:ME:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
Re: [MRC]Simple Random Quote IRC Bot
You've got some interesting thoughts!
Anything related to bots I'm interested on!
Re: [MRC]Simple Random Quote IRC Bot
Quote:
Originally Posted by
IQstim
You've got some interesting thoughts!
Anything related to bots I'm interested on!
Been trying to make one in perl that works
but got some problems gona try to figure it out once
i learn some more perl:)
This one needs a running mIRC client to work