This is a quote system script.
commands are:
!quote - tells a random quote
!quote # - tells quote #
!addquote - adds a quote
!delquote # - deletes quote # limited for ops
!lastquote - tells the last quote
I've took the command IDEA'S from another bot (haven't seen the script) so this is not stolen...
#######################################
#Quote system #
#by Rick/Freckle/Bigmomma #
#xr.no-ip.biz (soon irc.rageirc.net) # #RageIRC #
#######################################
on *:TEXT:!quote:#: { set %quote $read(quotes.txt) } { .msg $chan $chr(91) $+ $chr(35) $+ $readn $+ $chr(92) $+ $lines(C:\mIRC-Bot\Quotes.txt) $+ $chr(93) 4 $+ %quote }
on *:TEXT:!quote *:#: { if ($2 isalnum) && ($2 <= $lines(C:\mIRC-Bot\Quotes.txt)) { .msg $chan Quote $chr(91) $+ $chr(35) $+ $2 $+ $chr(92) $+ $lines(C:\mIRC-Bot\Quotes.txt) $+ $chr(93) 4 $+ $read(quotes.txt, $2) } }
on *:TEXT:!addquote *:#: { .write quotes.txt 12Quote added by $nick on $date $+ : 4 $+ $2- } { .msg $chan Your quote has been added, thank you! }
on *:TEXT:!delquote *:#: { if ($nick isop $chan) { .write -dl$2 quotes.txt }
{ .msg $chan Quote $chr(35) $+ $2 has been deleted. } }
on *:TEXT:!quotes:#: { .msg $chan Total number of quotes: $lines(C:\mIRC-Bot\Quotes.txt) }
on *:TEXT:!lastquote:#: { .msg $chan 12Last quote: $read(Quotes.txt, $lines(C:\mIRC-Bot\Quotes.txt)) }
Why not use this:
alias quote {
if ($1 isnum && $read(quotes.txt,$1)) {
msg $iif($active != status window,$active,$chan) Quote number $+($chr(40),$1,$chr(41),:) $v2
}
else {
msg $iif($active != status window,$active,$chan) Total quotes: $lines(quotes.txt)
}
}
alias addquote {
if ($1- && $exists(quotes.txt)) {
write quotes.txt $1-
echo $colour(info) -a Quote added.
msg $iif($active != status window,$target,$chan) Quote $1- added.
}
}
alias delquote {
if ($1 isnum && $read(quotes.txt,$1)) {
write -dl quotes.txt $1
echo $colour(info) -a Quote deleted.
msg $iif($active != status window,$target,$chan) Quote number: $1 deleted.
}
}
And just make a file named quotes.txt in your mircdir. Commands: /delquote (num), /addquote (quote), /quote (num)
never thought of that... ima test before sending this quote so i dont double post something that wasnt nesseciary..
TESTING...
ok only the first alias is giving me trouble so here it is
alias quote {
if ($1 isnum) && ($2 <= $lines(c:\program files\mirc\Quotes.txt)) /msg $chan Quote $chr(91) $+ $chr(35) $+ $2 $+ $chr(92) $+ $lines(c:\program files\mirc\Quotes.txt) $+ $chr(93) 4 $+ $read(quotes.txt, $2)
else { set %quote $read(quotes.txt) } { /msg $chan $chr(91) $+ $chr(35) $+ $readn $+ $chr(92) $+ $lines(c:\program files\mirc\Quotes.txt) $+ $chr(93) 4 $+ %quote }
}
let me know if you have a solution
this is what i put but it didnt work.
;on :input:#: { if ($1 == !quote) && ($2 == $null) { set %quote $read(quotes.txt) } { .msg $chan $chr(91) $+ $chr(35) $+ $readn $+ $chr(92) $+ $lines(c:\program files\mirc\Quotes.txt) $+ $chr(93) 4 $+ %quote }
;on :input:#: { if ($1 == !quote) && ($2 isalnum) && ($2 <= $lines(c:\program files\mirc\Quotes.txt)) { .msg $chan Quote $chr(91) $+ $chr(35) $+ $2 $+ $chr(92) $+ $lines(c:\program files\mirc\Quotes.txt) $+ $chr(93) 4 $+ $read(quotes.txt, $2) } }
;on :input:#: { if ($1 == !addquote) .write quotes.txt 12Quote added by $nick on $date $+ : 4 $+ $2- } { .msg $chan Your quote has been added, thank you! }
;on :input:#: { if ($1 == !delquote) && ($nick isop $chan) { .write -dl$2 quotes.txt }
;{ .msg $chan Quote $chr(35) $+ $2 has been deleted. } }
;on :input:#: { if ($1 == !quotes) .msg $chan Total number of quotes: $lines(c:\program files\mirc\Quotes.txt) }
;on :input:#: { if ($1 == !lastquote) .msg $chan 12Last quote: $read(Quotes.txt, $lines(c:\program files\mirc\Quotes.txt)) }
(i had commented it because i wanted to keep this for refrence)