Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if $nick == [nickname] then BUG ! :-(

Status
Not open for further replies.

DrunKeN

Technical User
Apr 8, 2004
4
MC
Hello guys, i got a problem with my eggdrop when an IRC user special character like [name].
In my scripts, when someone got this type of name, script will try to execute the nickname like a command [], and then it will just freeze my script cause he can't find any commands with this name ..

I thought when special characters were in a $variable, tcl would not try to exec them.. but im definitly wrong.. or maybe it happen sometimes ?
For me it happen in this part of code :

[lsearch -regexp $scores .:$nick:.]

if $nick got special character [] then i'll get an error msg :/

What can i do to prevent this bug ?

thanks for any help :)
 
All is OK for me when I do that:
Code:
  set pattern {.*[2-4]}
  puts [lsearch -regexp {name1 nick2} $pattern]
->1

Is your code evaled? In this case, Tcl replace the variable by its value before executing it.

Do you really need -regexp (not obviously related to your problem)?

HTH

ulis
 
Maybe the problem isn't affected by the regexp part.

im not able to identify it right now, im checking.. but im sure its about double evaluation of variable yeah, cause if i use a nickname like [die], it can kill my bot sometimes lol..

Maybe in utimers ? i can't prevent double evaluation of a variable in utimers i tried {$nick} and its isn't working :(

i don't know what can i do for the moment.

:), maybe a regsub or a trim in last resort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top