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.

[SOLVED] Need help with string matching from getchanhost

Help for those learning Tcl or writing their own scripts.
Post Reply
L
LoKii
Voice
Posts: 34
Joined: Wed Oct 21, 2009 3:59 am

[SOLVED] Need help with string matching from getchanhost

Post by LoKii »

Hello everyone.

I would like to understand how to get only a part of the getchanhost pattern to be matched against a variable.

With getchanhost I get ident@hostmask. I need to filter out ONLY the hostmask. And ideas what I am looking for to help me accomplish this?

Cheers.


Nevermind, I found the easiest solution. Guess its not good to script at 9am without coffee.

The solution I used is to put the hostmask in the bind propery for join.

Cheers.
d
dirty
Halfop
Posts: 40
Joined: Fri Feb 08, 2013 2:33 pm
Location: Romania
Contact:

Post by dirty »

or you could split the host and get ident and host/ip and then you can use a string match against the host and what your trying to match.

[split ident@host.name @] would get you ident host.name
[string match -nocase *!*@host.name *!*@other.host.name] would get you 1 or 0 if it matched or not

this could be useful if your trying to match multiple hosts and you won`t need to make more then 1 bind join
come to the dark side.. I have cookies!
WwW.BotZone.TK
L
LoKii
Voice
Posts: 34
Joined: Wed Oct 21, 2009 3:59 am

Post by LoKii »

thank you dirty, you just made my day, as this is very usefull for other parts of my script. Basicly you helped me to finally understand how to use split correctly. I didnt fully understand it from the help/tut sites, but the way you put it got to me ;)

Cheers
d
dirty
Halfop
Posts: 40
Joined: Fri Feb 08, 2013 2:33 pm
Location: Romania
Contact:

Post by dirty »

glad i could help. :) enjoy!
come to the dark side.. I have cookies!
WwW.BotZone.TK
Post Reply