| View previous topic :: View next topic |
| Author |
Message |
kitsaras Voice
Joined: 02 Feb 2006 Posts: 29
|
Posted: Thu Feb 16, 2006 11:16 pm Post subject: help requested |
|
|
hi. is it possible to make in this script catch more than one stat u server in the same network ?
| Code: |
bind pub - !servers statsu
bind raw - 242 show:statsu
proc statsu {nick uhost hand chan arg} {
global statsu
if {![info exists statsu([set chan [string tolower $chan]])]} {
set statsu($chan) 0
putserv "stats u"
}
}
proc show:statsu {from kw arg} {
global statsu
foreach {c v} [array get statsu] {
puthelp "privmsg $c :$from [join [lrange [split $arg] 1 end]]"
array unset statsu $c
}
}
|
thanks |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Feb 16, 2006 11:56 pm Post subject: |
|
|
supply server name after the command: STATS u irc.server.com
obviously, for multiple servers you need to do that multiple times; beware however that STATS command is usually pace-limited, i.e. you are normally allowed only one command in 2 or more seconds _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
kitsaras Voice
Joined: 02 Feb 2006 Posts: 29
|
Posted: Fri Feb 17, 2006 10:59 am Post subject: |
|
|
| demond wrote: | supply server name after the command: STATS u irc.server.com
excusme obviously, for multiple servers you need to do that multiple times; beware however that STATS command is usually pace-limited, i.e. you are normally allowed only one command in 2 or more seconds |
excuse me but i dont now a lot of tcl
i have 4 connected servers in my network
with the command
!servers (or i try to do a timer)
<bot> irc.server.com1 up bla bla
<bot> irc.server.com2 up bla bla
<bot> irc.server.com3 up bla bla
<bot> irc.server.com4 up bla bla
i dont have a limit time for stats u in my network only ircops can do stats u so i give the analog flags in a bot to do it
i only want to reply the stats u of the connected servers every i.e. 2 - 4 hours or 2 times the day or when we execute the command in the channel #bla bla |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Feb 17, 2006 8:19 pm Post subject: |
|
|
Try
| Code: | bind pub - !servers statsu
bind raw - 242 show:statsu
set statscu 0
proc statsu {nick uhost hand chan arg} {
global statsu statsuc
if {$statsuc > 0} {
puthelp "privmsg $chan :Already in progress"
return 0
}
set servers {server1.irc.net server2.irc.net server3.irc.net}
foreach server $servers {
incr statsuc
if {![info exists statsu([set chan [string tolower $chan]]:$statsuc)]} {
set statsu($chan:$statsuc) 0
putserv "stats u $server"
}
}
}
proc show:statsu {from kw arg} {
global statsu statsuc
foreach {c v} [array get statsu] {
puthelp "privmsg [lindex [split $c :] 0] :$from [join [lrange [split $arg] 1 end]]"
array unset statsu $c
incr statsuc -1
break
}
} |
Don't forget to edit the servers. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
kitsaras Voice
Joined: 02 Feb 2006 Posts: 29
|
Posted: Fri Feb 17, 2006 9:55 pm Post subject: |
|
|
| Sir_Fz wrote: | Try
| Code: | bind pub - !servers statsu
bind raw - 242 show:statsu
set statsuc 0
proc statsu {nick uhost hand chan arg} {
global statsu statsuc
if {$statsuc > 0} {
puthelp "privmsg $chan :Already in progress"
return 0
}
set servers {server1.irc.net server2.irc.net server3.irc.net}
foreach server $servers {
incr statsuc
if {![info exists statsu([set chan [string tolower $chan]]:$statsuc)]} {
set statsu($chan:$statsuc) 0
putserv "stats u $server"
}
}
}
proc show:statsu {from kw arg} {
global statsu statsuc
foreach {c v} [array get statsu] {
puthelp "privmsg [lindex [split $c :] 0] :$from [join [lrange [split $arg] 1 end]]"
array unset statsu $c
incr statsuc -1
break
}
} |
Don't forget to edit the servers. |
work perfect Sir_Fz thanks again. |
|
| Back to top |
|
 |
|