Well I was bored and made this easy script out of tfs uptime talkaction
What does it do? Simple. Every xx minutes(mine is 25m) a message is broadcasted displaying the server uptime and the amount the players online.
You may use it to broadcast any message if you modify it correctly.:thumbup:
add line@data/globalevents/globalevents.xml
create script @ data/globalevents/scripts/autoinfo.lua
What does it do? Simple. Every xx minutes(mine is 25m) a message is broadcasted displaying the server uptime and the amount the players online.
You may use it to broadcast any message if you modify it correctly.:thumbup:
GlobalEvents TimeCalc Example: <!--1500seconds = [[25minutes]] x 60s-->If there is nobody online it'll print: "Nobody Online"
If there is just 1 player it'll print: "1 player online"
If there is more than 1 player online it'll print: "xx players online"
[26/10/2009 16:20:32] > Broadcast: "Server Info: 0 hours and 10 minutes online, Nobody online."
add line@data/globalevents/globalevents.xml
Lua:
<globalevent name="autoinfo" interval="1500" event="script" value="autoinfo.lua"/> <!--1500s = [25m] x 60s-->
create script @ data/globalevents/scripts/autoinfo.lua
Lua:
-- >>> AutoServer Info Script by Cybermaster <<< --
function onThink(interval, lastExecution)
local hours = math.ceil(getWorldUpTime() / 3600) - 1
local minutes = math.ceil((getWorldUpTime() - (3600 * hours)) / 60)
if minutes == 60 then minutes, hours = 0, hours + 1 end
local c, players = getWorldCreatures(0), ""
if c < 1 then
return true
elseif c == 1 then
players = "1 player online."
elseif c > 1 then
players = c..' players online.'
end
doBroadcastMessage('[ServerInfo] '..hours..' hours and '..minutes..' minutes online, '..players..'', 23)
return true
end
Last edited: