[MRC]Simple Random Quote IRC Bot V2
It will output a random line of text from the file "quotes.txt"
the last one i made didn't respond random enough so i
made a improved version of it the responses of this
one should look more random then the other one
didn't had enough testing yet to see how random
it responds.
if this doesn't respond random enough either i probably will make a
new one again..
Note : It only responds on a text message.
Quote:
If you don't know what mrc is and want to learn about it
you should google for mirc scripting it isn't that hard to learn
Commands :
!flushrandvars <channel> - Flushes the variables for <channel> (sets them to 0)
!viewrandvars <channel> - Shows the variables for the <channel> the bot uses
!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
Code:
; Commands
on *:TEXT:!flushrandvars*:#: {
if (%access_ [ $+ [ $nick ] ] == 255) {
if ($2 == $chan) {
SET %randtalk_ [ $+ [ $2 ] ] 0
SET %treqrand_ [ $+ [ $2 ] ] 0
SET %talkreq_ [ $+ [ $2 ] ] 0
NOTICE $nick The variables for the channel $chan have been flushed.
}
else {
NOTICE $nick Invalid Channel Parameter.
}
}
else {
NOTICE $nick You dont have access to this command.
}
}
on *:TEXT:!viewrandvars*:#: {
if (%access_ [ $+ [ $nick ] ] == 255) {
if ($2 == $chan) {
MSG $chan randtalk_ $+ $chan %randtalk_ [ $+ [ $2 ] ]
MSG $chan treqrand_ $+ $chan %treqrand_ [ $+ [ $2 ] ]
MSG $chan talkreq_ $+ $chan %talkreq_ [ $+ [ $2 ] ]
}
else {
NOTICE $nick Invalid Channel Parameter.
}
}
else {
NOTICE $nick You dont have access to 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.
}
}
; Random Quote
on *:TEXT:*:#: {
if (%talkreq_ [ $+ [ $chan ] ] <= %randtalk_ [ $+ [ $chan ] ] ) {
SET %talkreq_ [ $+ [ $chan ] ] $rand(50,%treqrand_ [ $+ [ $chan ] ])
SET %randtalk_ [ $+ [ $chan ] ] 0
SET %treqrand_ [ $+ [ $chan ] ] 0
MSG $chan $read(quote.txt)
}
else {
var %timeframe $rand(1,20)
INC %randtalk_ [ $+ [ $chan ] ] $rand(1,20)
.timer 1 %timeframe INC %treqrand_ [ $+ [ $chan ] ] $rand(10,60)
}
}
}
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,10)
}
}
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,40)
}
}
on *:ME:#: {
while ($rand(1,5) != 2) {
inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
}
}
Re: [MRC]Simple Random Quote IRC Bot V2
Nice dude i may have to use this :D
Btw there is an example of this on #ragezone