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 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Sat Oct 20, 2007 4:13 am    Post subject: Uptime+away Reply with quote

Hi,iam looking for tcl that show Bot Uptime in his away msg..is there such tcl in egghelp

ex:Bot is away: Bot has a total uptime of week(s) day(s) hour(s) minute(s) second(s)
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Oct 20, 2007 6:49 pm    Post subject: Reply with quote

You may have joy by searching the Tcl Archive.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Sat Oct 20, 2007 11:58 pm    Post subject: Reply with quote

thanks for reply Alchera ..i have try to seach in tcl archeive and i dont find any away tcl that perform bot or shell uptime.. i want te script for reason that it will show my shell uptime in his away when any user /whois bot

thanks if anyone can help
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Oct 21, 2007 12:20 am    Post subject: Reply with quote

sk-4 wrote:
thanks for reply Alchera ..i have try to seach in tcl archeive and i dont find any away tcl that perform bot or shell uptime.. i want te script for reason that it will show my shell uptime in his away when any user /whois bot

thanks if anyone can help
I hope you are aware that it would only display the uptime when away is set, doing a whois on the bot will not show a current uptime.
Back to top
View user's profile Send private message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Sun Oct 21, 2007 1:41 am    Post subject: Reply with quote

Thanks for reply : yes i do understand the Uptime work if bot is set to away
that the reason i need a sample of script whr the bot will set itself away for certain time ot with any comamnd ..maybe if bot idle for more then 30min it set away itself and the away msg should be Bot uptime

ex : Bot is away: is away: (Playing basketball) [BX-MsgLog On]
and i wan it to display
Bot is away: is away: (Bot Uptime 365days 20min ) something like that..
Back to top
View user's profile Send private message
iamdeath
Master


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

PostPosted: Sun Oct 21, 2007 11:52 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"

# 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 {} {
foreach chan [channels] {
putserv "away :[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"


Ok That script is done by someone else I have modified it for your needs, what it will do is, it will make your bot away and show uptime in its away msg. You can also put ### infront of binds you dont want, you can also change colors, but the bot will refresh its away uptime in every 1 minute. So new update will come in 1 minute, if it's fine with you. You can also change that too. Let me know

I have checked it so this is how it worked:

Code:

-
Cricket`- is cricket@cricket.users.undernet.org * Cricket is my passion.
Cricket`- using *.undernet.org The Undernet Underworld
Cricket`- is away: Cricket`- has been up for: 0 weak(s) 4 day(s) 22 hour(s) 17 minute(s) 23 second(s).
Cricket`- is logged in as cricket
Cricket`- has been idle 16secs, signed on Fri Oct 19 03:14:32
Cricket`- End of /WHOIS list.
-
Cricket`- is cricket@cricket.users.undernet.org * Cricket is my passion.
Cricket`- using *.undernet.org The Undernet Underworld
Cricket`- is away: Cricket`- has been up for: 0 weak(s) 4 day(s) 22 hour(s) 18 minute(s) 23 second(s).
Cricket`- is logged in as cricket
Cricket`- has been idle 12secs, signed on Fri Oct 19 03:14:32
Cricket`- End of /WHOIS list.


You can notice a 1 minute change in every whois info.

iamdeath

EDIT: It will set away msg in 60 minutes now.
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...


Last edited by iamdeath on Mon Oct 29, 2007 2:02 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Sun Oct 21, 2007 7:37 pm    Post subject: great Reply with quote

iamdeath: Thanks bro ur script worked fine as i wish.. Thanks for the guide and others who reply my Post
Back to top
View user's profile Send private message
iamdeath
Master


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

PostPosted: Sun Oct 21, 2007 8:01 pm    Post subject: Re: great Reply with quote

sk-4 wrote:
iamdeath: Thanks bro ur script worked fine as i wish.. Thanks for the guide and others who reply my Post


You're most welcome, I wish I knew TCL scripting as nml as sirfz as user or as rosc then I'd be the only person who would reply everyone here but hey that script isn't mine the credit goes to the real author I just modified it for you.

Enjoy Wink
iamdeath
_________________
|AmDeAtH @ Undernet


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


Joined: 06 Oct 2007
Posts: 51

PostPosted: Sun Oct 21, 2007 9:20 pm    Post subject: Reply with quote

i tested the script for few hours and i found it getting killed with this msg (Killed (stats.dal.net (User has been banned from DALnet (Drones are not permitted on DALnet)))) or it will ping timeout ..i tried change timer to 30min it still same..i guess dalnet having issue with funny away msg i guess Very Happy

il try with dif network and see how it work
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Oct 21, 2007 11:32 pm    Post subject: Reply with quote

sk-4 wrote:
i tested the script for few hours and i found it getting killed with this msg (Killed (stats.dal.net (User has been banned from DALnet (Drones are not permitted on DALnet)))) or it will ping timeout ..i tried change timer to 30min it still same..i guess dalnet having issue with funny away msg i guess Very Happy

il try with dif network and see how it work

Join #OperHelp to get details on the a-kill supplying the kill id.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Mon Oct 22, 2007 12:36 am    Post subject: Reply with quote

sk-4 wrote:
i tested the script for few hours and i found it getting killed with this msg (Killed (stats.dal.net (User has been banned from DALnet (Drones are not permitted on DALnet)))) or it will ping timeout ..i tried change timer to 30min it still same..i guess dalnet having issue with funny away msg i guess Very Happy

il try with dif network and see how it work
Most likely DALnet has a problem with away being set every minute.
Back to top
View user's profile Send private message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Mon Oct 22, 2007 7:05 am    Post subject: Reply with quote

(Killed (stats.dal.net (User has been banned from DALnet (Drones are not permitted on DALnet))))

No kill id to refer to operhelp
As Dragonlord say dalnet having issue with away msg that update every min..they say u cant run it..end of the story

To bad i cannot use it ..
Back to top
View user's profile Send private message
wac
Halfop


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

PostPosted: Sun Oct 28, 2007 5:36 pm    Post subject: lol Reply with quote

You might try setting it higher like to an hour or so or a day or something and adding into the away message that it has an "uptime of x at y" like
"bot1 has had an uptime of 12 years at 3pm CST" or something similar to that

On a side note I found my answer to using the timer function I think. Yay!
_________________
I see j00!
Back to top
View user's profile Send private message
iamdeath
Master


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

PostPosted: Mon Oct 29, 2007 2:05 am    Post subject: Reply with quote

I have set it to change away in 60 minutes == 1 hour. Should'nt be a problem now.

Thanks
iamdeath
_________________
|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: Mon Oct 29, 2007 2:44 pm    Post subject: :D Reply with quote

yeah np
_________________
I see j00!
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
Goto page 1, 2  Next
Page 1 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