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.

lol i need serious help

Old posts that have not been replied to for several years.
Locked
S
SnOoPDoGg187
Voice
Posts: 17
Joined: Fri Apr 04, 2003 7:43 am

lol i need serious help

Post by SnOoPDoGg187 »

proc kick {nick uhost hand chan rest} {
set chan [string tolower $chan]
set knick [lindex $rest 0]
set reason [lrange $rest 1 end]
if {[onchan $knick $chan] == 0} {
puthelp "NOTICE $nick :I don't see $knick in this channel"
return 0
}
if {((onchan $knick $chan) && (isop $knick $chan) || (matchattr $hand nb|- $chan))} {
puthelp "PRIVMSG $chan :$nick, Hey You F****** Retard Don't Be Kicking Ops!"
return 0
}
putkick $chan $knick "$reason"
}

k i can't figure out what's wrong with it i've tried and tried but can't get it to work right i know what's wrong with it it's this line here

if {((onchan $knick $chan) && (isop $knick $chan) || (matchattr $hand nb|- $chan))} {

heres the erro it gives me also Tcl error [kick]: syntax error in expression "((onchan $knick $chan) && (isop $knick $chan) || (matchattr "

all i want it to do is not kick someone if there currently opped in the room or if they have global +nb flags

is there a better way to do it also like not let the ops kick each other at all or something? i don't know lol not enought sleep i guess

could someone help me out plx thanks : )
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

In tcl, you use [ ] to surround commands instead of ( ). I think that's pretty much your only problem, except that your logic is ambiguous (you use && and || with no grouping).
S
SnOoPDoGg187
Voice
Posts: 17
Joined: Fri Apr 04, 2003 7:43 am

don't understand whatcha mean

Post by SnOoPDoGg187 »

i allways get mixed up with the brackets but i think i tried that but it didn't work lol and do i need the { } ??

is this correct?

if {[onchan $knick $chan] && [isop $knick $chan] || [matchattr $hand nb|- $chan]} {

right or no?

thanks
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

This means: if $knick is in $chan channel and he has op there or he has the nb flags to continue, yes, it's correct.
Once the game is over, the king and the pawn go back in the same box.
Locked