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 

help requested

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
kitsaras
Voice


Joined: 02 Feb 2006
Posts: 29

PostPosted: Thu Feb 16, 2006 11:16 pm    Post subject: help requested Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Feb 16, 2006 11:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
kitsaras
Voice


Joined: 02 Feb 2006
Posts: 29

PostPosted: Fri Feb 17, 2006 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Feb 17, 2006 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
kitsaras
Voice


Joined: 02 Feb 2006
Posts: 29

PostPosted: Fri Feb 17, 2006 9:55 pm    Post subject: Reply with quote

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.


Very Happy work perfect Sir_Fz thanks again.
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 -> Scripting Help 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