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.

Tcl I made Doesn't work, can somebody detect my mistake ?

Old posts that have not been replied to for several years.
Locked
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Tcl I made Doesn't work, can somebody detect my mistake ?

Post by Sir_Fz »

Code: Select all

bind mode "-" "* -o" mode:automode
proc mode:automode {nick uhost handle chan mode victim} {
if {([matchattr $nick o])} { return 0 }
if {([matchattr $nick m])} { return 0 }
if {([matchattr $nick n])} { return 0 }
if {![isop $nick $chan]} { return 0 }
if {[isop $victim $chan]} { return 0 }
if {[string match "$victim" "$botnick"] && [botisop $chan]} { 
putserv "PRIVMSG chanserv@services.dal.net :deop $chan $nick" }
 }
 }
this script is supposed to make the bot deop the person who deops it (using Chanserv), but it doesn't work; I think the problem is here : if {[string match "$victim" "$botnick"] && [botisop $chan]} {
I tried hundred ways to fix it, but I'm still very new. Would somebody helpme plz :)

Also can u answer my other threads in this forum "bot self ban protection" & "ban mask problem" :P ... Thank You :)
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

try using $::botnick or adding "global botnick" inside your proc.
photon?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

can u be more specific plz, i got the ::botnick thing... but the global botnick thing... not so much

can u explain or give me example
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

try this:

Code: Select all

bind mode - "* -o" mode:automode 
proc mode:automode {nick uhost handle chan mode victim} {
global botnick
if {$victim == $botnick} { 
if {[matchattr $handle o]} { return 0 }
putserv "PRIVMSG chanserv@services.dal.net :deop $chan $nick"
} 
}
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The other alternative spock was talking about is by replacing this two lines:

Code: Select all

global botnick 
if {$victim == $botnick} { 
with this single line:

Code: Select all

if {$victim == $::botnick} { 
The result will be the same.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Thanx :) I was close :P hehhee
Locked