In the meantime I have managed many things with eggdrop <-> textfiles. But with deleting a line out of a textfile I have a problem. You can see my script here:
Code: Select all
bind pub - !delop delop
proc delop {nick uhost hand chan arg} {
global adminfile
if {$arg != ""} {
set op [lindex [split $arg] 0]
set fd [open $::adminfile r+]
while {![eof $fd]} {
lappend list [gets $fd]
}
if {[set le [lsearch -exact $list $op]] != -1} {
#The following line should do the delete stuff, but doesn't
set list [lreplace $list $le $le]
puts -nonewline $fd [join $list \n]
close $fd
} else {
putquick "PRIVMSG $chan :Your moderator does not exist."
}
}
}
Can anybody tell me where the mistake is?