| View previous topic :: View next topic |
| Author |
Message |
Thib Voice
Joined: 11 Jan 2010 Posts: 9
|
Posted: Fri Jan 29, 2010 6:20 am Post subject: create except list |
|
|
Hello,
I've been helped to create a script, but now, i want to be excepted from that script
Thats why i tried to create an except list, based from hostnames. The idea was to set hostnames, which wont be affected by the script
So i tried something like this ;
| Code: |
set salon "#chan"
set excepts {
proxad.net
cegetel.fr
etc etc
}
bind join - * except
proc except { nick uhost handle channel } {
global salon excepts
set userhost [getchanhost $nick]
|
what can i add in my code ?
thanks a lot! |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Thu Jan 31, 2013 5:19 pm Post subject: |
|
|
You can try this
| Code: |
set temp(excepts) {
"something"
"else"
}
bind join - * pub:join
proc pub:join {nick uhost hand chan} {
global temp
foreach n $temp(excepts) {
if {![string match -nocase $n [lindex [split [getchanhost $nick $chan] @] 1]]} {
#if the host IS NOT in the excepts list do something
} else {
#if the host IS in the excepts list do something else
}
}
}
|
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Feb 01, 2013 3:22 am Post subject: |
|
|
| Code: |
set exceptsList [list "proxad.net" "cegetel.fr"]
bind join - "#salon *" except:join
proc except:join {nick uhost hand chan} {
if {[isbotnick $nick]} return
if {[lsearch -glob $::exceptsList [lindex [split $uhost @] 1]]==-1} {
# do whatever as host doesn't match anything in excepts
}
}
|
Haven't tested but in theory should do what you wanted. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|