small quote bot
___________________________________________________________
Quote Bot v1.0
Author: Foamy
Server: irc.animelab.com:6667
Channel: #Revenge
Nick: Tokiyumaru`Crusiphox
Email: foamy_gohans_pet@hotmail.com
_____________________________________________________________
on *:text:url*:?: { write fun.txt $$2 <<Xtra info: $$3- $+ >> <<Added by: $nick $+ >> On <<Date: $date $+ . Time: $time $+ .>> | /timer 1 2 /msg $nick Thank you, url added! | /timer 1 5 /close -m $nick }
on *:TEXT:!quote*:#:/quote $1-
on *:TEXT:!addquote*:#:/addquote $1-
on *:TEXT:!totalquotes*:#:/totalquotes $1-
on *:TEXT:!delquote*:#:/delquote $1-
on *:TEXT:!find*:#:/search $1-
on *:TEXT:!qhelp*:#:/qhelp
menu channel {
Quotes ( $+ %quote $+ )
.On: { set %quote on | /msg # Quote system enabled! (Use !qhelp for help about the quotes) }
.Off: { set %quote off | /msg # Quote system disabled! }
}
###########################################################
# A
# l
# i
# a
# s
#############################################################
/F1 {
//echo $chan Quote help:
//echo $chan ----------------------------------
//echo $chan F2 = Random Quote
//echo $chan F3 = Quote help.
}
/F2 { /quote }
/F3 { /qhelp }
/F4 { /search . $?"What to look for?" }
/quote {
if (%quote == on) {
if ($2 == $null ) {
/msg $chan QUOTE: (Total quotes:3 %t.q Shown at random!) $read(quote.txt)
}
else {
/msg $chan QUOTE: ( $+ $2 $+ / $+ %t.q $+ ) $read(quote.txt, $2)
}
}
}
/search {
if (%quote == on) {
set %found $read(quote.txt, w, * $+ $2- $+ *)
if (%found == $null) {
/msg $chan Error Occured! Nothing found to search for, please make sure u didnt typed it wrong. Error Occured!
}
else { /msg $chan Found: %found
}
set %found
}
}
/qhelp {
if (%quote == on) {
/msg $chan To add your quote type: !addquote <quote> - And !totalquotes for the quotes i have. - !find <word> to search a quote. - !qhelp for help. !delquote <number> to delete a quote.
}
}
/addquote {
if (%quote == on) {
/write quote.txt $2-
/msg $chan QUOTE: 9 $2- Added!
inc %t.q 1
inc %e.q 1
}
}
/totalquotes {
if (%quote == on) {
/msg $chan The total of quotes i have:3 %t.q
}
}
/delquote {
if (%quote == on) {
if ($2 >= %e.q) || ($2 == $null) {
/msg $chan Error occured! Invalid parameter found to delete quote! Please use: !delquote number
/halt
}
else {
/msg $chan QUOTE: $read(quote.txt, $2) is gone!
/write -dl $+ $2 quote.txt
dec %t.q 1
dec %e.q 1
}
}
}
____________________________________________________________
End of Quote Bot Alias file
_____________________________________________________________
Very insecure.. somebody can type in
\"url $cr quit\"
and it will make the bot quit IRC because it parses $cr as a new command line. To fix this use the n switch in the $read function. Sure this willt ake away bold and colors but it makes it that much secure from identifier attacks. You could always just replace the bold tags with [b] and reparse it when it\'s called via the alias.
For parsing as text (eliminates calling of identifiers): $read(quote.txt,n)
Also Comment out the top part describing the addon.
You also don\'t need the \'/\' before each command.