This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bot check for owner before remove

Help for those learning Tcl or writing their own scripts.
Post Reply
K
Kraka
Voice
Posts: 19
Joined: Thu Apr 21, 2005 9:25 pm

bot check for owner before remove

Post by Kraka »

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: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

There's no else-statement in the code you pasted.
Post Reply