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.

How to do multiple channel support.

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

How to do multiple channel support.

Post by Gothic-Angel »

Code: Select all

set nickpass "pass"
set channame "chan"
set nickserv "nickserv@services.dal.net"
set chanserv "chanserv@services.dal.net"
set blah "."

bind notc - "*This nick is owned by someone else*" services_ident
bind notc - "*Password accepted*" services_check
bind notc - "*You do not have access to op people*" services_ident
bind time - "0 * *" services_check
bind time - "5 * *" services_check
bind time - "10 * *" services_check
bind time - "15 * *" services_check
bind time - "20 * *" services_check
bind time - "25 * *" services_check
bind time - "30 * *" services_check
bind time - "35 * *" services_check
bind time - "40 * *" services_check
bind time - "45 * *" services_check
bind time - "50 * *" services_check
bind time - "55 * *" services_check
bind time - "00 * *" services_check
bind pub n|n ${blah}identify pub:ident
bind pub n|n ${blah}op pub:op
bind pub n|n ${blah}test services_check
bind ctcr - PING services_op
bind mode - "* -o" services_autoreop
bind need - "* unban" services_autounban

proc services_ident { nick uhost hand args } {
global botnick nickpass nickserv
putlog "Services: Trying to identify with nickserv"
putserv "PRIVMSG $nickserv :identify $nickpass"
}

proc services_ping {nick uhost hand args} {
putlog "PING: Trying to ping chanserv"
putserv "PRIVMSG $chanserv :\001PING"
}

proc services_op {nick uhost hand args} {
global botnick chanserv channame
putserv "PRIVMSG $chanserv :OP $channame $botnick"
}

proc services_check {nick uhost hand chan arg} {
global botnick channame chanserv
if {![botisop $channame] && [botonchan $channame] } {
putserv "PRIVMSG $chanserv :\001PING $chanserv"
 }
}

proc pub:ident {nick host hand chan text} {
global botnick nickpass nickserv
putserv "PRIVMSG $nickserv :identify $nickpass"
}

proc pub:op {nick host hand chan text} {
global botnick chanserv channame
putserv "PRIVMSG $chanserv :OP $channame $botnick"
}
proc services_autoreop {nick uhost hand chan deop deopd} {
global botnick channame
if {[matchattr $hand n]} { return }
if {([string match -nocase $deopd $botnick]) } {
putserv "ChanServ op $channame $botnick"
 }
}
proc services_autounban {chan unban} {
global channame botnick
putserv "ChanServ unban $chan"
}









I want to make it support more than one channel but not all, so could I set a variable like.

Code: Select all

 set chans "#chan #chan1 #chan2" 
[/code]
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Use a 'foreach'. Eg.

Code: Select all

foreach ch $chans {
bla bla bla
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

just a little tip :)

Code: Select all

bind time - "0 * *" services_check 
bind time - "5 * *" services_check 
bind time - "10 * *" services_check 
bind time - "15 * *" services_check 
bind time - "20 * *" services_check 
bind time - "25 * *" services_check 
bind time - "30 * *" services_check 
bind time - "35 * *" services_check 
bind time - "40 * *" services_check 
bind time - "45 * *" services_check 
bind time - "50 * *" services_check 
bind time - "55 * *" services_check 
bind time - "00 * *" services_check
this can be done by using just two lines:

Code: Select all

bind time - "*0 * *" services_check 
bind time - "*5 * *" services_check
Elen sila lúmenn' omentielvo
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Papillon wrote:just a little tip :)
this can be done by using just two lines:

Code: Select all

bind time - "*0 * *" services_check 
bind time - "*5 * *" services_check
i am unsure, wouldn't this trigger each minute when hour or day contains 0 or 5? you probably mean bind time - "*5 * * * *" services_check and bind time - "*0 * * * *" services_check
tcl-commands.tcl wrote:mask matches 5 space separated integers of the form:
"minute hour day month year". minute, hour, day, month have a
zero padding so they are exactly two characters long; year is
extended to four characters in the same way.
means the old bind bind time - "5 * *" services_check is wrong, too.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

*grml*
PS: you can delete this double post...
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

As you probably can see (or atleast you should..) Gothic-Angel is tryng to do a *call* for its proc from 5 in 5 minutes, so Papillon's tip is correct. :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

ok, ok

Post by De Kus »

seems you need an example:
like of the disciption from the doc file 2003-2-21 20:44 will be masked as ["44 20 21 02 2003". 44 is not dividable by 5, bot it still matchs "*0 * *" !!! first * is "44 2" then comes 0, then space, then "21 02", one more space, then 2003. it matchs and is true, and it will trigger EVERY minute in hours or months containg 0 or 5. * = can be ANY number of charachters, even zero. correct would be "?0*" or "*0 * * * *".

hope this helps you to understand the logic of a stupid computer :).
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Da Kus is correct in what he is saying.

However, at the same time, the original post was correct. "5 * *", Note the lack of wildcard before the 5, meaning this must be at the start.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

ppslim wrote:However, at the same time, the original post was correct. "5 * *", Note the lack of wildcard before the 5, meaning this must be at the start.
yes, its at the front, and this means its never true, because
tcl-commands.doc wrote:minute, hour, day, month have a zero padding so they are exactly two characters long
means, there will never be a 5 followed by an space at the begining because it will be 05 not 5 :).
Locked