• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Error with Autoinfo

Status
Not open for further replies.

frankfarmer

who'r ninja now
Premium User
Joined
Aug 5, 2008
Messages
1,581
Reaction score
79
Code:
-- >>> AutoServer Info Script by Cybermaster <<< --
-- >>> Shortened by Elf <<< --
local uptime, players = getWorldUptime(), getWorldCreatures(0)  
local hours, minutes = math.floor(uptime / 3600), math.floor((uptime % 3600) / 60) doBroadcastMessage("[ServerInfo] " .. hours .. " hour" .. (hours == 1 and "" or "s") .. " and " .. minutes .. " minute" .. (minutes == 1 and "" or "s") .. " online, " .. (c < 1 and "Nobody" or (c .. "player" .. (c > 1 and "s" or ""))) .. " online.", 23)  
		return true 
	end
end

Error
Code:
[04/01/2010 22:02:35] [Error - LuaScriptInterface::loadFile] data/globalevents/scripts/autoinfo.lua:6: '<eof>' expected near 'end'
[04/01/2010 22:02:35] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/autoinfo.lua)
[04/01/2010 22:02:35] data/globalevents/scripts/autoinfo.lua:6: '<eof>' expected near 'end'

Fix? 0.3.6 :) Thanks!
 
@up:
You are right!

Lua:
-- >>> AutoServer Info Script by Cybermaster <<< --
-- >>> Shortened by Elf <<< --
local uptime, players = getWorldUptime(), getWorldCreatures(0)  local hours, minutes = math.floor(uptime / 3600), math.floor((uptime % 3600) / 60)   doBroadcastMessage("[ServerInfo] " .. hours .. " hour" .. (hours == 1 and "" or "s") .. " and " .. minutes .. " minute" .. (minutes == 1 and "" or "s") .. " online, " .. (c < 1 and "Nobody" or (c .. "player" .. (c > 1 and "s" or ""))) .. " online.", 23)  return true end
(http://otland.net/f82/server-autoinfo-uptime-players-54820/)
 
@up:
You are right!

Lua:
-- >>> AutoServer Info Script by Cybermaster <<< --
-- >>> Shortened by Elf <<< --
local uptime, players = getWorldUptime(), getWorldCreatures(0)  local hours, minutes = math.floor(uptime / 3600), math.floor((uptime % 3600) / 60)   doBroadcastMessage("[ServerInfo] " .. hours .. " hour" .. (hours == 1 and "" or "s") .. " and " .. minutes .. " minute" .. (minutes == 1 and "" or "s") .. " online, " .. (c < 1 and "Nobody" or (c .. "player" .. (c > 1 and "s" or ""))) .. " online.", 23)  return true end
(http://otland.net/f82/server-autoinfo-uptime-players-54820/)


Code:
[05/01/2010 13:05:18] [Error - LuaScriptInterface::loadFile] data/globalevents/scripts/autoinfo.lua:3: '<eof>' expected near 'end'
[05/01/2010 13:05:18] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/autoinfo.lua)
[05/01/2010 13:05:18] data/globalevents/scripts/autoinfo.lua:3: '<eof>' expected near 'end'
 
Code:
 -- >>> Server AutoInfo 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 = getWorldCreatures(0)
        if (c < 1) then
                players = "Nobody online."
        elseif (c == 1) then
                players = "1 player online."
        elseif (c > 1) then
                players = ''..getWorldCreatures(0)..' players online.'
        end
    doBroadcastMessage('[ServerInfo] '..hours..' hours and '..minutes..' minutes online, '..players..'', 23)
        return true
end
 
Code:
 -- >>> Server AutoInfo 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 = getWorldCreatures(0)
        if (c < 1) then
                players = "Nobody online."
        elseif (c == 1) then
                players = "1 player online."
        elseif (c > 1) then
                players = ''..getWorldCreatures(0)..' players online.'
        end
    doBroadcastMessage('[ServerInfo] '..hours..' hours and '..minutes..' minutes online, '..players..'', 23)
        return true
end

Thanks, but I found that script in my other servers. That script works atleast.

Rep for helping :)
 
Status
Not open for further replies.
Back
Top