Just a question, why do you try to execute the return-code form adduser and deluser?
And this $head-variable you have in that putlog; it's not defined anywhere in this code, and it's not imported from globalspace
Also, would you mind including the binds you've used?
edit: Had a closer look at that adduser code..
To be honest, I'm not sure what you try to accomplish with all those nested commands
A simple example on how to do it would be something like this:
Code: Select all
proc battle:adddj {nick host hand chan text} {
set txt [split $text]; set handle [lindex $txt 0]; hostmask [lindex $txt 1]
if {[adduser $handle $hostmask]} {
chattr $handle fD
putlog "$nick added new dj: $handle with hostmask: $hostmask"
}
}
proc battle:removedj {nick host hand chan text} {
if {[deluser $text]} {
putlog "$nick removed dj: $text"
}
}
bind pub n @adduser battle:adddj
bind pub n @deluser battle:removedj
Of course you don't need to set txt, handle or hostmask; tho I find it makes the code somewhat more easy to read