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.

problem bind raw in 2 scripts

Old posts that have not been replied to for several years.
Locked
C
Careto
Voice
Posts: 11
Joined: Tue Mar 02, 2004 1:33 pm

problem bind raw in 2 scripts

Post by Careto »

I have problem with 2 script loaders.

1º script:

Code: Select all

bind pub o|o !signon whois
bind raw - 317 sig


proc whois {nick uhost handle chan arg} {
global ca
set ca $chan
foreach user [chanlist $chan] {
putserv "WHOIS $user $user" }
}

proc sig {from key arg} {
 global ca
 set nick [lindex [split $arg] 1]
 set signon1 [lindex [split $arg] 3]
 set formatdia "%e"
 set formathora "%H"
 set formatminutos "%M"
 set formatsegundos "%S"
 set formatsemanas "%W"
 set actual [clock seconds]
 set restauptime [expr $actual - $signon1]
 set pororden [lsort -decreasing -dictionary $restauptime]
 set resultadouptimedias [clock format $pororden -format $formatdia -gmt YES]
 set resultadouptimehoras [clock format $pororden -format $formathora -gmt YES]
 set resultadouptimeminutos [clock format $pororden -format $formatminutos -gmt YES]
 set resultadouptimesegundos [clock format $pororden -format $formatsegundos -gmt YES]
 set resultadosemanas [clock format $pororden -format $formatsemanas -gmt YES]
 set resultadouptimedias1 [expr $resultadouptimedias - 1]
 if {![string equal $nick $::botnick]} {
 putserv "PRIVMSG $ca :$nick: $resultadouptimedias1 dias $resultadouptimehoras horas $resultadouptimeminutos minutos $resultadouptimesegundos segundos"
 }
}
2º script:

Code: Select all

 bind pub - !nickregistrado panda
bind raw - 307 atest

proc panda {nick uhost handle chan arg} {
global cha
set cha $chan
foreach user2 [chanlist $chan] {
putserv "WHOIS $user2" }
}

proc atest {from key arg} {
 global cha
 set nick2 [lindex [split $arg] 1]
 set nickreg [lrange [split $arg] 2 end]
 if {![string equal $nick2 $::botnick]} {
  putserv "PRIVMSG $cha :$nick2 $nickreg"
 }
}
are 2 script different, when I execute one of them in a channel, bot executes the 2, I have proven with unbind in each script to annul raw opposite, but does not work anybody can help me?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This happens because when you whois the user in your second script, on bind raw 307, a whois display is binded to 4-5 raws, if you know what I mean. Each line is a whois is binded on a seperate raw number. :roll:

What I think here is raw 317 is binded maybe on your IRCd in the whois reply, hence when you try to whois a user raw 307 will fire, as well as raw 317. ;)

What you can do here is after the foreach loop has completed you can unbind any one of the raw binds, or maybe after a specific interval of time you can try unbinding the binded raw which fires on a public command both of which you use the more often.

Or you can directly make both the public commands fire to a new proc, which has a switch, set to 1, or 0. This can be a global array variable, then on the raw you can check if switch is 1 or 0 so the raw can fire, and in the end you can set the switch to 0 to disable it or the way you like.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked