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.

create except list

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
T
Thib
Voice
Posts: 9
Joined: Mon Jan 11, 2010 11:45 am

create except list

Post by Thib »

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: Select all

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!
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

You can try this

Code: Select all

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
		}
	}
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

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.
Post Reply