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 

Timer Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
retan
Voice


Joined: 11 Jun 2007
Posts: 5

PostPosted: Mon Jun 11, 2007 11:23 pm    Post subject: Timer Script Reply with quote

hello,
I've got three eggdrops and when I type !uptime, every eggdrop is posting his serveruptime since he was started.
It looks like this:
<Bot1> 12 days up
<Bot2> 13 days up
<Bot3> 14 days up

Now I need a script which shows me the total uptime of all servers. (it has to sum up 12,13 and 14)
So when I type !uptime, it has to come this:

<Bot1> 12 days up
<Bot2> 13 days up
<Bot3> 14 days up
<anotherBot> The total uptime of all servers: 39 days

How can I manage this?

What about a Timer?

My suggestion: When I type !uptime, the script should wait 5 seconds (until all three Bots posted there server uptime) and then the script sums up the total uptime. -> the problem is now how to read the specified strings. probably with reg expr?

Which tcl commands will I need or how has the code to look like?
Thank you all!
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 12, 2007 5:27 am    Post subject: Reply with quote

The sum of the uptimes isn't the total uptime. Actually, in your case you can't calculate a total uptime, each is independent. You should either consider the lowest uptime as the total uptime or the highest uptime (I guess the latter is better).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
retan
Voice


Joined: 11 Jun 2007
Posts: 5

PostPosted: Tue Jun 12, 2007 2:08 pm    Post subject: Reply with quote

I dont understand you.
Each eggdrop is running on another server, so the uptime of every eggdrop is different.
I just want all three uptimes summed up.

The script just has to search for the string "<Bot1>" and sum the letter after it (12) up with the other days (13 and 14).
The total uptime for me is: 39 days in my example.

So the method I thought about, is to make a timer, that the script wait for 5 secs after !uptime is typed. After the 5 seconds it searches the string between "<Bot1>" and "days up" (for all three bots). Then the script just has to sum the three uptimes up and puts it to the channel.
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 -> Script Requests 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