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 

Uptime+away
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Tue Oct 30, 2007 11:30 pm    Post subject: Reply with quote

Hi iamdeath, can u help me regarding that showing bot uptime but i wanted it shows the uptime on channel every 1 hour w/o typing !uptime, .uptime.... thanks in advance Very Happy
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Wed Oct 31, 2007 1:39 am    Post subject: Reply with quote

Code:
# Title: Simple eggdrop uptime script
############################################################################
# Description:
#  - An os independent os script verry simple. I know to simple but seems
#    hard to find a deasend script that doesn't use the shell uptime but
#    but the actual uptime of the eggdrop. You can also use this in scripts
#    Example: [eggtime] this will return the value that is returned in
#             channel.
#  - This has dcc, pub & msg binds you can set them to your preference.
#
# Install:
#  - Put this script into the scripts dir of the eggdrop
#  - Add this to your eggdrop config: "source scripts/uptime.tcl"
#  - Rehash the bot and your done.
#
# HomePage: http://www.ofloo.net/
# Mail: support[at]ofloo.net
#
# ChangeLog:
#  - 15/12/2003 :: Weak fix & adjusted msg little & added n00b help ;)
############################################################################

############################################################################
# SETTINGS

# Set the triggers to you preference..
# Dcc is always with a . infront also you don't have to add it in the bind
# I prefer for msg it to be a . as well so I always use . for msg (.uptime)
# You can use whatever of course for example ?uptime
# For channel triggers I always use ! you can change that as well to your
# preference also it doesn't have to be uptime you can choose whatever

set time(dcc) "uptime"
set time(msg) ".uptime"
set time(pub) "!uptime"
set mychannel "#channel"

# This is the flag to whom is able to use it if you would like only known
# users to use it set it to "h" because the eggdrop will add users by default
# as hp if you didn't change it of course. You can also limit it to channel
# operators this means they have to be known to the eggdrop of course then
# set it to "o" masters "m" owers "n" whatever you prefer of course.
# read the doc files to find out more about flags

set time(flag) "-"

# How to edit the colors:
# for an eggdrop to know its an color you always need \003 so then put your
# favorite color behind it like mirc <ctrl> <k> you get a choice menu
# <ctrl> <k> <4> = red so look below \0034 = red yellow \0038 orange = \0037
# and so on and so on think you get the idea ?

set time(col1) "\00314"
set time(col2) "\0034"

############################# DO NOT EDIT BELOW ############################

set vrs "0.2"

############################################################################
# BINDS

bind pub "$time(flag)" "$time(pub)" uptime:pub
bind dcc "$time(flag)" "$time(dcc)" uptime:dcc
bind msg "$time(flag)" "$time(msg)" uptime:msg

############################################################################
# PROCS

timer 60 set:eggtime
proc set:eggtime {} {
global mychannel
foreach chan [channels] {
putserv "PRIVMSG $mychannel :[eggtime]"
timer 60 set:eggtime
 }
}

proc uptime:pub {nick uhost hand chan arg} {
  putserv "PRIVMSG $chan :[eggtime]"
}

proc uptime:msg {nick uhost hand arg} {
  putserv "PRIVMSG $nick :[eggtime]"
}

proc uptime:dcc {hand idx arg} {
  putdcc $idx "[eggtime]"
}

proc eggtime {} {
  set ::time(uptime) [expr [clock seconds]-$::uptime]
  set ::time(weak) [expr $::time(uptime)/604800]
  set ::time(uptime) [expr $::time(uptime)-$::time(weak)*604800]
  set ::time(days) [expr $::time(uptime)/86400]
  set ::time(uptime) [expr $::time(uptime)-$::time(days)*86400]
  set ::time(hour) [expr $::time(uptime)/3600]
  set ::time(uptime) [expr $::time(uptime)-$::time(hour)*3600]
  set ::time(mins) [expr $::time(uptime)/60]
  set ::time(uptime) [expr $::time(uptime)-$::time(mins)*60]
  set ::time(secs) $::time(uptime)
  set ::time(return) "$::time(col2)$::botnick $::time(col1)has been up for:$::time(col2) $::time(weak) $::time(col1)weak\(s\)$::time(col2) $::time(days) $::time(col1)day\(s\)$::time(col2) $::time(hour) $::time(col1)hour\(s\)$::time(col2) $::time(mins) $::time(col1)minute\(s\)$::time(col2) $::time(secs) $::time(col1)second\(s\)."
  return $::time(return)
}

############################################################################
putlog "Sucsesfully loaded \002Ofloo\002 uptime script version\002 $vrs\002"



You need to set mychannel value and it will show uptime every 1 hour in that channel
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Wed Oct 31, 2007 2:48 am    Post subject: Reply with quote

do you think that could work for multiple channels? (like space separated list) or would it just need to be run a seperate tcl for each channel? I'm just curious is all.
_________________
I see j00!
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Wed Oct 31, 2007 10:06 am    Post subject: Reply with quote

wac wrote:
do you think that could work for multiple channels? (like space separated list) or would it just need to be run a seperate tcl for each channel? I'm just curious is all.



If you change this:

Code:
timer 60 set:eggtime
proc set:eggtime {} {
global mychannel
foreach chan [channels] {
putserv "PRIVMSG $mychannel :[eggtime]"
timer 60 set:eggtime
 }
}


Replace with:

Code:
timer 60 set:eggtime
proc set:eggtime {} {
foreach chan [channels] {
putserv "PRIVMSG $chan :[eggtime]"
timer 60 set:eggtime
 }
}


Then I think it should work, I am not sure or else you can add channels manually but adding:

Code:
putserv "PRIVMSG $chan1 :[eggtime]"
putserv "PRIVMSG $chan2 :[eggtime]"
putserv "PRIVMSG $chan3 :[eggtime]"


I am not that good coder so I am not sure what I am doing I test them to find out if they're working, so I need to test right now I am busy so I can't test Very Happy

thanks
iamdeath[/code]
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Wed Oct 31, 2007 4:20 pm    Post subject: Reply with quote

Hey it's cool I'm not that great either I either learn from others or read it myself and then test it till I get it to work, I was just curious as to how something like that might get implemented. Thanks for your info though. Very Happy
_________________
I see j00!
Back to top
View user's profile Send private message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Thu Nov 15, 2007 2:17 pm    Post subject: Reply with quote

How to change the away output ,i want something like this

earlier away msg is
Bot has been up for: 0 weak(s) 0 day(s) 0 hour(s) 11 minute(s) 42 second(s).

how to make it show the day and time..maybe bot can set away or back according timer
Bot is away: 4 Online: 22 days, 02:03 Hours
Back to top
View user's profile Send private message
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Thu Nov 15, 2007 2:44 pm    Post subject: Reply with quote

I'm guessing you would just take out the one's you don't want, like week, mins, seconds. That would be my first guess but don't quote me on that Wink
_________________
I see j00!
Back to top
View user's profile Send private message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Fri Nov 16, 2007 6:24 am    Post subject: Reply with quote

yes i just want it to show bot uptime in this way

bot Online: 22 days, 18:13 Hours
Back to top
View user's profile Send private message
YooHoo
Owner


Joined: 13 Feb 2003
Posts: 939
Location: Redwood Coast

PostPosted: Fri Nov 16, 2007 10:05 am    Post subject: Reply with quote

sk-4, you need to visit the Tcl Archives, and use the keyword uptime. I found nine such scripts already written that will display your shell's uptime in your channel, plus many other features.
_________________
Mr. Green
Johoho's TCL for beginners
Mr. Green
Back to top
View user's profile Send private message Send e-mail
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Fri Nov 16, 2007 10:51 am    Post subject: Reply with quote

thanks for reply yahoo

actually iam looking for script that will show bot uptime in his away msg..

ex. Bot is away: Online: 22 days, 22:43 Hours
Back to top
View user's profile Send private message
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Fri Nov 16, 2007 1:21 pm    Post subject: Reply with quote

YooHoo wrote:
sk-4, you need to visit the Tcl Archives, and use the keyword uptime. I found nine such scripts already written that will display your shell's uptime in your channel, plus many other features.


did you miss that part, and wth you didn't search before posting? come on dude... Laughing
_________________
I see j00!
Back to top
View user's profile Send private message
YooHoo
Owner


Joined: 13 Feb 2003
Posts: 939
Location: Redwood Coast

PostPosted: Sat Nov 17, 2007 8:23 pm    Post subject: Reply with quote

sk-4 wrote:
thanks for reply yahoo

actually iam looking for script that will show bot uptime in his away msg..

ex. Bot is away: Online: 22 days, 22:43 Hours
then try botaway.tcl which does this already
_________________
Mr. Green
Johoho's TCL for beginners
Mr. Green
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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