on *:TEXT:!quotes*:#: {
if ( $$2 == edit) {
if ( $nick == dude22072 || $nick == Boothin || $nick == isopod_chan || $nick == swordspree || $nick == neo_obsidian || $nick == zackattack9909 || $nick == lordprevious ) {
var %length $readini(quotes.ini, $$3, length)
if ( $$4 <= $calc(%length + 0) ) {
.writeini quotes.ini $$3 $$4 $5-
msg # Quote $$4 for user $$3 has been edited to $5-
query Edits.SayingsBot " Quote $$4 for user $$3 has been edited to $5- "
}
else {
msg # Quote $$4 does not exist for $$3
}
}
}
if ( $$2 == addusertorandom) {
if ( $nick == dude22072 || $nick == Boothin || $nick == isopod_chan || $nick == swordspree || $nick == neo_obsidian || $nick == zackattack9909 || $nick == lordprevious ) {
var %length $readini(quotes.ini, users, length)
var %newlength = $calc(%length + 1)
.writeini quotes.ini users length %newlength
.writeini quotes.ini users %newlength $$3
msg # Added $$3 to overall random list. They are user %newlength
}
}
if ( $$2 == info ) { msg $chan To use !quotes simply type !quotes say [USERNAME] [NUMBER] to view a quote. The "Number" can be "r" for a random quote from the user. The user can be "random" for a random quote from anyone. Dates/Times are CST. }
if ( $$2 == list ) { msg $chan A list of all quotes are at http://moddedbydude.net76.net/wiki/index.php/SayingsBot_Commands#Quotes }
if ( $$2 == add ) {
var %length $readini(quotes.ini, $$3, length)
var %newlength = $calc(%length + 1)
.writeini quotes.ini $$3 length %newlength
.writeini quotes.ini $$3 %newlength $4-
msg # Quote %newlength for $$3 added as\: $4-
query Edits.SayingsBot " Quote %newlength for user $$3 has been added as $4- "
}
if ( $$2 == say ) {
if ( $$3 == random ) {
var %userslength $readini(quotes.ini, users, length)
var %userrand = $rand(1,%userslength)
var %user $readini(quotes.ini, users, %userrand)
var %length $readini(quotes.ini, %user, length)
var %rand = $rand(1,%length)
var %quote $readini(quotes.ini, %user, %rand)
if ( %quote == $null ) { msg $chan ERROR\. RANDOM HAS PICKED A NON\-EXSISTANT QUOTE\. THIS SHOULD NOT HAPPEN\! | return }
msg # %user ( %rand ): %quote
}
else {
if ( $$4 == r) {
var %length $readini(quotes.ini, $$3, length)
var %rand = $rand(1,%length)
var %quote $readini(quotes.ini, $$3, %rand)
if ( %quote == $null ) { msg $chan ERROR\. That user has no quotes\, or random has some issues to explain\! | return }
msg # ( %rand ) %quote
}
else {
var %quote $readini(quotes.ini, $$3, $$4)
if ( %quote == $null) { msg $chan Their is no $$4 quote for $$3 | return }
msg # %quote
}
}
}
}