I have dumbasses.tcl but it can only add ant list dumbasses.
Can anyone make that tcl could delete nick from the file. If nick isn't in the dumbasses file bot sents msg that he is not dumbass.
Code: Select all
set quoteitpubprefix "!"
set quoteitfile "quoteit.data"
# 0 = Channel
# 1 = Notice
set quoteitvianotice "1"
if { ![info exists toolbox_loaded] } { source scripts/alltools.tcl }
bind pub - [string trim $quoteitpubprefix]dumbasses quoteit:pub:dumbasses
bind pub G|G [string trim $quoteitpubprefix]dumbass quoteit:pub:dumbass
proc quoteit:pub:dumbass {nick uhost hand chan arg} {
global quoteitfile quoteitvianotice
set quotes ""
if { [file exists $quoteitfile] } { set file [open $quoteitfile r]
} else {
if { $quoteitvianotice == 0 } { putmsg $chan "$quoteitfile does not exist. You'll need to add quotes to the database first by typing \002!dumbass <nick>\002" }
if { $quoteitvianotice == 1 } { putnotc $nick "$quoteitfile does not exist. You'll need to add quotes to the database first by typing \002!dumbass <nick>\002" }
return 0
}
while { ![eof $file] } {
set quote [gets $file]
if { $quote != "" } {
set quotes [linsert $quotes end $quote]
}
}
close $file
set row [rand [llength $quotes]]
set quote [list $quotes]
if { $quote != "" } {
if { $quoteitvianotice == 0 } {
putmsg $chan "Dumbasses: $quote"
}
if { $quoteitvianotice == 1 } {
putnotc $nick "Dumbasses: $quote"
}
return 1
}
}
proc quoteit:pub:dumbasses {nick uhost hand chan arg} {
global quoteitfile
if { $arg == "" } {
putnotc $nick "Usage: !dumbass <nick>"
return 0
}
set file [open $quoteitfile a]
puts $file "$arg"
close $file
putmsg $chan "{$arg dumbassed}"
return 1
}
putlog "*** dumbasses.tcl loaded"