Ok another bot script...Here is how it works...users can post quotes and then u can review quotes...easy...if you load it the system will echo the commands in the active window
Enjoy :)
; / \ | |
; ||| | |
; \\ | |
; ||| | |__
; \ / |____|
;server : irc.4everlost.co.za
;room : #slc
;webpage : http://slchat.50megs.com/Home.htm
;Date codded : 18/07/2004
on 1:load: {
echo -a 7,0 The following options is available
echo -a 10,0!addquote 3and the quote 6(This will add a quote to the bot)
echo -a 10,0!delquote 3and the quote number 6(This will delete quote number that u enter)
echo -a 10,0!quote 6(This will Random between allquotes and tell u what quote nr. it is)
echo -a 10,0!quote 3and the number 6(This will look up the quote of which number u have chosen)
echo -a 10,0!qlines 6(This will give u the amount of quotes which have been added)
echo -a 10,0!qhelp 6(This will bring you to this menu)
}
on 1:text:*:#: {
if ($1 == !addquote) {
if ($2 == $null) { Notice $nick Sorry you need to set a quote and u left it empty }
if ($2 != $null) {
write quote.txt $2-
set %sl.ql $lines(quote.txt)
msg $chan 5,0Added quote at position %sl.ql
unset %sl.ql
}
}
if ($1 == !delquote) {
if ($2 == $null) { msg $chan 4,0Sorry $nick u need to add a number between 1 and $lines(quote.txt) }
if ($2 != $null) {
write -dl $+ $2 quote.txt
msg $chan 3,0Quote 6# $+ $2 3Have been removed
}
}
if ($1 == !quote) {
if ($2 == $null) {
set %sl.qr $rand(1,$lines(quote.txt))
set %sl.qra $read(quote.txt, %sl.qr)
if (%sl.qra != $null) { msg $chan 10,0Random quote 6# $+ %sl.qr 10 $+ %sl.qra }
if (%sl.qra == $null) { msg $chan 4,0Sorry there does not appear to be anny quotes available }
unset %sl.qr
unset %sl.qra
}
if ($2 != $null) {
set %sl.qo $read(quote.txt, $2)
set %sl.qol $lines(quote.txt)
if (%sl.qo == $null) { msg $chan 4,0Quote 6# $+ $2 4Does not exist 3U can select 1 to %sl.qol }
if (%sl.qo != $null) { msg $chan 7,0Quote 6# $+ $2 7- %sl.qo }
unset %sl.qo
unset %sl.qol
}
}
if ($1 == !qlines) {
set %sl.qt $lines(quote.txt)
if (%sl.qt != $null) { msg $chan 12,0There is this amount of quotes2 %sl.qt }
if (%sl.qt == $null) { msg $chan 4,0There does not appear to be anny quotes added yet $nick }
unset %sl.qt
}
if ($1 == !qhelp) {
msg $chan 7,0 The following options is available
msg $chan 10,0!addquote 3and the quote 6(This will add a quote to the bot)
msg $chan 10,0!delquote 3and the quote number 6(This will delete quote number that u enter)
msg $chan 10,0!quote 6(This will Random between allquotes and tell u what quote nr. it is)
msg $chan 10,0!quote 3and the number 6(This will look up the quote of which number u have chosen)
msg $chan 10,0!qlines 6(This will give u the amount of quotes which have been added)
msg $chan 10,0!qhelp 6(This will bring you to this menu)
}
else { halt }
}
a few things could be shortend
if (%sl.qra == $null) { msg $chan 10,0Random quote 6# $+ %sl.qr 10 $+ %sl.qra }
Could be
if (!$sl.qra) msg $chan 10,0Random quote 6# $+ %sl.qr 10 $+ %sl.qra
set %sl.qr $rand(1,$lines(quote.txt))
set %sl.qra $read(quote.txt, %sl.qr)
This could be set to the var command so you dont have to unset them after, and when unsetting variables that start the same, unset sl.* works.
And finally
else { halt }
}
no need for the else, just end it off.