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

Strange symbols in database

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
400
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
Can anyone help me?
a while ago I had a problem with a script, then deactivated the script.
But the "nothing" gave the same error in a current script, made by Darkoahs.
Link of script that are giving erro http://otland.net/f83/grizzly-adams-killing-name-quest-all-tasks-more-real-tibia-159150/
The error consists of, instead of getting numerical values ​​in the database, something is "corrupting" my database, rendering them with symbols.
Look at the picture.

Capturar.JPG

If anyone knows how I can fix, I thank you.
I think it must be something in the sourcer, because the script made ​​by him is without error.
Note: I'm using TFS 0.3.6 PL1
 
Last edited:
Here the line completed of error

[20.10.2013 16:00:15] [Error - CreatureScript Interface] [20.10.2013 16:00:15] data / creaturescripts / scripts / attribute_points.lua: onAdvance [20.10.2013 16:00:15] Description: [20.10.2013 16:00:15] data / creaturescripts / scripts / attribute_points.lua: 3: attempt to perform arithmetic on a string value [20.10.2013 16:00:15] stack traceback: [20.10.2013 16:00:15] data / creaturescripts / scripts / attribute_points.lua: 3: in function <data/creaturescripts/scripts/attribute_points.lua:1>
 
I'm not sure, the script runs fine for me.

Do you have anything in login.lua that is related to the script?
 
Only this
Code:
if getPlayerStorageValue(cid, 47061) < 0 then  -- Attribute_points
  setPlayerStorageValue(cid, 47061, 0)
  end
and
registerCreatureEvent(cid, "Attribute_points")


NOTE: works perfectly for some time and after that "corrupts".
not happen "instantaneously"[/code]
 
Today's your lucky day, I happen to know how to fix this error.

In the creaturescript, try changing this line:
Code:
doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, getCreatureStorage(cid, KILLSSTORAGE_BASE + id) + 1)
with:
Code:
local storageUpdate = getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) + 1
setPlayerStorageValue(cid, KILLSSTORAGE_BASE + id, storageUpdate)
 
But there are other scripts with the same error ...
among many users who use this system because it just happened to me?

dont have logical for this problem :(

It depends on which version of tfs is being used. Did you try my solution?
 
Since you're only storing numbers in the "value" column, you can change its databype to int instead of varchar. This will prevent the nonsense symbols from being successfully ineserted in the db, but depending on your server, it might flood you with errors when it attempts to insert the symbols since they aren't ints. That's the worst case scenario, and even if that happens, it narrows down when the weird stuff starts to happen.
 
Forcing a column in SQL to be of a certain type garuntees that data not of the column's type will be rejected by SQL. When the server tries to insert the garbage symbols, SQL rejects it and sends back an error. What happens next is up to the server. Most likely it throws an error, if not then the server ignores the SQL error and continues running as normal. In the case of an error, you get more information to use in debugging. If not, then everything should be fine .
 
Back
Top