| View previous topic :: View next topic |
| Author |
Message |
LoKii Voice
Joined: 21 Oct 2009 Posts: 34
|
Posted: Thu Mar 07, 2013 4:55 am Post subject: [SOLVED] Need help with string matching from getchanhost |
|
|
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. |
|
| Back to top |
|
 |
dirty Halfop
Joined: 08 Feb 2013 Posts: 40 Location: Romania
|
Posted: Thu Mar 07, 2013 5:44 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
LoKii Voice
Joined: 21 Oct 2009 Posts: 34
|
Posted: Thu Mar 07, 2013 8:56 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
dirty Halfop
Joined: 08 Feb 2013 Posts: 40 Location: Romania
|
Posted: Thu Mar 07, 2013 12:39 pm Post subject: |
|
|
glad i could help. enjoy! _________________ come to the dark side.. I have cookies!
WwW.BotZone.TK |
|
| Back to top |
|
 |
|