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.

help requested

Help for those learning Tcl or writing their own scripts.
Post Reply
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

help requested

Post by kitsaras »

hi. is it possible to make in this script catch more than one stat u server in the same network ?

Code: Select all

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
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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

 tag when posting logs, code
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

Post by kitsaras »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

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.
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

Post by kitsaras »

Sir_Fz wrote:Try

Code: Select all

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.
:D work perfect Sir_Fz thanks again.
Post Reply