• 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!

Problem with Record/Start.lua [Help]

Kaywin

Lord of War WoW/Tibia 2D
Joined
Oct 24, 2008
Messages
541
Reaction score
6
Location
SwedeN
Hello! This is my errors and I have been working with this two errors from the begining of the day i downloaded this server! I really need help!

First Error , (When I start the server, Console window).

Code:
[Error - Globalevent interface]
data/globalevents/scripts/start.lua:onStartup
Description:
data/globalevents/scripts/start.lua:2: attempt to call field 'executeQuery' <a nil value>
Stack traceback:
data/globalevents/scripts/start.lua:2: in function <data/globalevents/scripts/start.lua:1


Seconds Error , (When a player login at my server, console window).

Code:
[Error - Globalevent interface]
data/globalevents/scripts/record.lua:onStartup
Description:
data/globalevents/scripts/record.lua:2: attempt to call field 'executeQuery' <a nil value>
Stack traceback:
data/globalevents/scripts/record.lua:2: in function <data/globalevents/scripts/record.lua:1>
 
Start.lua
Code:
function onStartup()
	db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
	db.executeQuery("UPDATE `players` SET `posx` = "..getConfigValue('newPlayerSpawnPosX')..", `posy` = "..getConfigValue('newPlayerSpawnPosY')..", `posz` = "..getConfigValue('newPlayerSpawnPosZ').." WHERE `name` = 'Account Manager';")
	return TRUE
end

Record.lua

Code:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end
 
Are you using 0.3.6 or 0.4?

I'm not sure o.O

Geisor 0.2.1 or Geisor 0.3.6 or Geisor 0.3.8 :$

I got a 8.60 version server with 0.4 Dev TFs

I think the basic geisor is 0.2.1 but i got some other version's inside of it cuz it diden't work 100%. :$
 
I'm not well versed on 0.4 as my AntiVirus deleted my .exe (it thought it was a trojan) so I can no longer test things in 0.4.

It doesn't look like anything is wrong with your record.lua, but I recall trying to execute a multi-verse(?) query through lua doesn't work properly.

Try this for startup:
LUA:
function onStartup()
	db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
	db.executeQuery("UPDATE `players` SET `posx` = " ..getConfigValue('newPlayerSpawnPosX').. " WHERE `name` = 'Account Manager';")
	db.executeQuery("UPDATE `players` SET `posy` = " ..getConfigValue('newPlayerSpawnPosY').. " WHERE `name` = 'Account Manager';")
	db.executeQuery("UPDATE `players` SET `posz` = " ..getConfigValue('newPlayerSpawnPosZ').. " WHERE `name` = 'Account Manager';")
	return TRUE
end

My next question (which seems fairly stupid considering you have geisor) is: are you using MySQL or SQLite?

note: If they changed the way queries are executed or some formatting for your scripts in the update to 0.4 I have no idea how I could help you, sorry.
 
I'm using MySQL at database, and i replaced your start.lua and I got the same error, I don't know whats the foult. :/ damit! ;( Is there any chance that you can remove your antivirus program just for a secound? and help me with this error? O.O
 
I removed that anti-virus program a long time ago, when I removed it I also removed all the "Quarantined" items that it moved, including all .exe's I had for my servers (minus a select few). I am currently in no possession of a 0.4 exe file so I couldn't test stuff even if I wanted to, sorry :/

Edit: D'OH, just realized I still had my DOC file, try using these?:

Startup:
LUA:
function onStartup()
	db.query("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
	db.query("UPDATE `players` SET `posx` = " ..getConfigValue('newPlayerSpawnPosX').. " WHERE `name` = 'Account Manager';")
	db.query("UPDATE `players` SET `posy` = " ..getConfigValue('newPlayerSpawnPosY').. " WHERE `name` = 'Account Manager';")
	db.query("UPDATE `players` SET `posz` = " ..getConfigValue('newPlayerSpawnPosZ').. " WHERE `name` = 'Account Manager';")
	return TRUE
end

Record:
LUA:
function onRecord(current, old, cid)
	db.query("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end
 
well thank you anyways! You got my reputation even if we diden't get the problem solved! Oh.. This is like my last hard problem on the server :/
 
I'm not well versed on 0.4 as my AntiVirus deleted my .exe (it thought it was a trojan) so I can no longer test things in 0.4.

It doesn't look like anything is wrong with your record.lua, but I recall trying to execute a multi-verse(?) query through lua doesn't work properly.

Try this for startup:

My next question (which seems fairly stupid considering you have geisor) is: are you using MySQL or SQLite?

note: If they changed the way queries are executed or some formatting for your scripts in the update to 0.4 I have no idea how I could help you, sorry.

If you compiled it then most surely your AntiVirus gave you a False Positive, now what you can do is whitelist "TheForgottenServer.exe", when your Anti-Virus detects it just let it be(tell it to do nothing), go to settings and find anything that has to do with "exceptions" or anything like that then add that exe to the list and no more bothers from AV!
 
If you compiled it then most surely your AntiVirus gave you a False Positive, now what you can do is whitelist "TheForgottenServer.exe", when your Anti-Virus detects it just let it be(tell it to do nothing), go to settings and find anything that has to do with "exceptions" or anything like that then add that exe to the list and no more bothers from AV!

You seems to know a bit about the new version 0.4 DEV and what it supports for files/websites. I using Geisor 0.3.8 and got some mixed file versions in it aswell because it diden't work 100% when I installed it ^^ Can't you write a code in the databas and in some way make Start/record.lua files be able to work?
 
You seems to know a bit about the new version 0.4 DEV and what it supports for files/websites. I using Geisor 0.3.8 and got some mixed file versions in it aswell because it diden't work 100% when I installed it ^^ Can't you write a code in the databas and in some way make Start/record.lua files be able to work?

I know stuff but not about your situation, sorry :/. Word of advice, don't use Gesior nor XAMPP they have lots of security issues and you will be hacked if you host a server with it. here go to this link http://otland.net/f479/nothing-full...niform-server-forgotten-server-0-3-6-a-77593/
many people say it's very helpful and secure!
 
I know stuff but not about your situation, sorry :/. Word of advice, don't use Gesior nor XAMPP they have lots of security issues and you will be hacked if you host a server with it. here go to this link http://otland.net/f479/nothing-full...niform-server-forgotten-server-0-3-6-a-77593/
many people say it's very helpful and secure!
XAMPP is secure, and certain versions of Gesior have more bugs than others but all of them share a few same exploits.

I dont see why is everyone saying "use UniServ instead of XAMPP".
It wasn't XAMPP's fault that people's servers were getting hacked, it was poorly secured servers and scripts in Gesior AAC.
 
Back
Top