egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

create except list

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Thib
Voice


Joined: 11 Jan 2010
Posts: 9

PostPosted: Fri Jan 29, 2010 6:20 am    Post subject: create except list Reply with quote

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
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jan 31, 2013 5:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Feb 01, 2013 3:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber