| View previous topic :: View next topic |
| Author |
Message |
Kraka Voice
Joined: 21 Apr 2005 Posts: 19
|
Posted: Sun Sep 14, 2008 11:04 pm Post subject: bot check for owner before remove |
|
|
What i am trying to do is before the bots removes the chan fro list is to make sure the person trying to remove it is the channel owner of the chan. I have been able to set it up so far to block certain chans and have tried to get it to match flags and have got it to delete the chan but when i try to use the else command to where if they dont meet the flags to send an error message i get an error of
invalid command name "else" while executing "else { puthelp "NOTICE $nick :cant do that " ; return 0 }" (procedure "pub_lol_remove" line 16) invoked from within "pub_lol_remove $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
| Code: |
proc pub_lol_remove {nick host hand chan arg} {
set arg [charfilter $arg]
set noremove "#chan1 #chan2"
global lol botnick
if {![check $hand $nick $host]} {
if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
set ch [lindex $arg 0]
if {$ch != ""} {set ch [chanaddapt $ch]}
if {$ch == ""} {set ch $chan}
if {![validchan $ch]} { puthelp "NOTICE $nick :I'm not on $ch " ; return 0 }
if {[lsearch -exact $noremove [string tolower $ch]] != -1} { puthelp "NOTICE $nick :Can't do that " ; return 0 }
channel remove $ch
puthelp "NOTICE $nick :$ch has been removed."
}
|
im pretty sure that i have the line right of
if {[matchattr $hand |X $ch]}
{channel remove $ch return 0}
but not sure of how to get it to send the msg if they dont meet the correct flags |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Sep 15, 2008 2:52 pm Post subject: |
|
|
There's no else-statement in the code you pasted. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|