Uptime Script
 

News:

11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Uptime Script

Started by BrokenBrick, 22 October, 2003, 00:36:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BrokenBrick

This is a simple uptime script that I use, works in Td4 and IceCube.  It allows users to see the hubs running time (In days and hours) by typing +runtime.  I did not write this, but it works in both TD and IceCube as far as I know
_______________________________________

function DataArrival(USER,DATA)
if (strsub(DATA,1,1)=="<") then DATA=strsub(DATA,1,strlen(DATA)-1) s,e,CMD=strfind(DATA,".*%s+(%S+)")
if (strlower(CMD)=="+runtime") then local SC=clock()
USER:SendData("RUNTIME",floor(SC/86400).." days, "..floor(mod(SC/3600,24)).." hours, and "..floor(mod(SC/60,60)).." minutes.")
end
end
end
Indiecent Music
indiecent.no-ip.com:4141


Live the lonely life, walk the lonely path, die a lonely death

OpiumVolage

As far as i remember, comments where saying this part was extracted from retrobot.
Don't know who extracted it, i think it was skrollster.

BrokenBrick

Perhaps, I can't really remember, its been a while
Indiecent Music
indiecent.no-ip.com:4141


Live the lonely life, walk the lonely path, die a lonely death

Skrollster

i did it as far as i can remember... but i don't care, but write from where it was taken at least next time

BrokenBrick

I couldn't remember.  I was not claiming credit I can assure you of that.  I probably found it on the old forum as a response to someone problem and wanted to use it in my hub.  But that was months ago, and I have slept several times since then.  Sorry Skrollster
Indiecent Music
indiecent.no-ip.com:4141


Live the lonely life, walk the lonely path, die a lonely death

[NL]trucker

ok folks i had this one stll in my archive and thought it would serve some use.

it is a combined script with hub up time and hub info.

i just hope i put it in the right section.


-- Uptime by extracted from retrobot By Skrollster
-- Retrobot is made by Tezlo
-- Hiding of command from MainChat is added by JenZen?


BotName = "hubinfo"

sek = 1000
min = sek*60
hour = min*60
days = hour*24

time = 1*hour

function Main()
SetTimer(time)
StartTimer()
end


function DataArrival(user, data)
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
--extract command
_,_,cmd=strfind(data, "%b<>%s+(%S+)")
if(cmd == "uptime") then
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
user:SendData("uptime", "*** "..days.." days, "..hrs.." hours "..min.."

minutes and "..sec.." seconds")
return 1;
end
end


function OnTimer()
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
SendToAll(BotName,

"?=============="..frmHub:GetHubName().."=================| ?| ::Hub

Owner: xxxxx | ::Hub Info: Min Share xxx Gb | ::Hub Rules: Type !rules

or !help | ::Hub Op's: xxxx xxxxx xxxxxx | ::Hub E-Mail: xxxxxxxxxxx |

::Hub Address: xxxxxx or xxxxxx | ::Hub Network: xxxxxxxxx| ::Uptime =

"..days.." days, "..hrs.." hours "..min.." minutes and "..sec.."

seconds = ?")
SendToAll(BotName, "?============="..frmHub:GetUsersCount().." of

"..frmHub:GetMaxUsers().." Users Connected==================")
end
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

and another one whit out hubinfo .

i,m just not sure if it works for td4.

if so could anybody make it so that it will show automaticlly on a specific time-schedule?


--------------------------------------------------------------------------------
-- Uptime by extracted from retrobot By Skrollster
-- Retrobot is made by Tezlo
-- Hiding of command from MainChat is added by JenZen?

function DataArrival(user, data)
   -- remove end pipe
   data=strsub(data,1,strlen(data)-1)
   --extract command
   _,_,cmd=strfind(data, "%b<>%s+(%S+)")
   if(cmd == "uptime") then
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
user:SendData("uptime", "*** "..days.." days, "..hrs.." hours "..min.." minutes and "..sec.." seconds")
return 1;
   end
end
--------------------------------------------------------------------------------
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


SMF spam blocked by CleanTalk