PDA

View Full Version : [Tutorial] Understanding Errors



Spectrus
03-12-2014, 11:35 PM
Quick tutorial today explaining script errors and how to diagnose issues in your script. I've seen far too many threads where eople are asking for help when the error message is pretty clear on what is wrong.

Here is an example of an error:

16:22 XenoScript Error:
Script: tut.lua
Line #: 1
Chunk: C:?Users?Spectrus?Documents?XenoBot?Scripts?tut.lu a
Error: attempt to call global 'Print' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

You can see it tells you some information about the 'Script', the 'Line', the 'Chunk', and the 'Error'.

The 'Script' is the file that crashed as a result of the error.
The 'Line' is the line of code that is causing the error (NOTE: This is not always in the 'Script' file.)
The 'Chunk' is the path to the file that caused the error (NOTE: Not always the same as the 'Script' file.)
The 'Error' is what is wrong.

The reason that the Line and Chunk do not always correspond to the Script file is that scripts can rely on other files (i.e. through dofile() or the native library). The most common issue that I've seen when the Line/Chunk do not line up with the Script is where bad parameters are being passed to a function in the native library (C:/Program Files/Xenobot/Data/XenoLuaLib.lua). You can open the native library, go to the specified line, see what function it is a part of, then go back to your script and make sure any calls to that function are proper.

Regarding understanding the Error message: In the example, it says it is attempting to call a function called "Print", which is a nil value (doesn't exist). The reason for this is that the print function is has a lowercase 'p'. Functions are case sensitive, make sure you have the right casing. If the error is similar but says attempt to 'index' instead of 'call' then it is referring to a variable.

There are many other types of error messages, most of which can be understood by simply reading it and then looking at the line of code it is tied to. If there are any error messages that you can't understand you can post them in this thread and I will do my best to help. Please post them wrapped in [code] tags ([code][ /code]).

With all of this said, please stop posting requests for help before reading the error message and trying to understand.

retsamfrost
03-13-2014, 06:56 AM
nice post

Abbepowerd
03-14-2014, 08:37 AM
I keep getting this error.
([code]12:29 XenoScript Error:
Script: [XBFS] [RP] Corruption Hole.lua
Error: cannot open C:\Users\Oskar\Documents\XenoBot\Scripts\[XBFS] Library.lua: No such file or directory[ /code]).
I dont know what it wants from me, there is no file called Library.lua but does it want me to create a lua file named that?
As you can see im trying to download the free XBFS scripts and I need help.
Thanks alot.

only4tibia
03-14-2014, 09:44 AM
I keep getting this error.
([code]12:29 XenoScript Error:
Script: [XBFS] [RP] Corruption Hole.lua
Error: cannot open C:\Users\Oskar\Documents\XenoBot\Scripts\[XBFS] Library.lua: No such file or directory[ /code]).
I dont know what it wants from me, there is no file called Library.lua but does it want me to create a lua file named that?
As you can see im trying to download the free XBFS scripts and I need help.
Thanks alot.

Download [XBFS] library.lua file and put it in your scripts folder.

Regards,
O4T

Abbepowerd
03-14-2014, 11:18 AM
Download [XBFS] library.lua file and put it in your scripts folder.

Regards,
O4T
Nono there is no such file.. It was a package I downloaded and so there is nothing called [XBFS] Library.lua.
This is the lua if you might understand. Im sorry if this might be seen as spam, I just really want to know why its not working, the same goes for almost all other scripts from XBFS.

Abbepowerd
03-15-2014, 05:23 AM
Oh sorry I feel really stupid now. Thanks alot for the help.

Ghazkyt
03-18-2014, 11:37 PM
18:25 XenoScript Error:
Script: ek223_ej.lua
Error: (null)
This is an error with user-input and should not be reported as a bug with XenoBot.


wtf xd.

weea
03-20-2014, 02:50 AM
18:25 XenoScript Error:
Script: ek223_ej.lua
Error: (null)
This is an error with user-input and should not be reported as a bug with XenoBot.


wtf xd.

I am having this same error.

anthh
03-23-2014, 04:39 PM
XenoScript Error:
Script: [EK] HUD-Ankrahmun Terramites.xblua
Error: Could not read "[EK] Ankrahmun Terramites.xbst", make sure the file exists in the Settings folder.
This is an error with user-input and should not be reported as a bug with XenoBot.

would you know what is possibly happening with this script?

Spectrus
03-23-2014, 04:45 PM
XenoScript Error:
Script: [EK] HUD-Ankrahmun Terramites.xblua
Error: Could not read "[EK] Ankrahmun Terramites.xbst", make sure the file exists in the Settings folder.
This is an error with user-input and should not be reported as a bug with XenoBot.

would you know what is possibly happening with this script?

This is a custom error used by JXScripts. You need to ensure that the .xbst file is in the Documents/Xenobot/Settings folder. Any further help with this error should be posted in their thread.

swev
03-27-2014, 01:25 PM
help here please ?

http://imagizer.imageshack.us/v2/xq90/823/uz0a.jpg (https://imageshack.com/i/mvuz0aj)

astrio123
03-27-2014, 03:02 PM
help here please ?

http://imagizer.imageshack.us/v2/xq90/823/uz0a.jpg (https://imageshack.com/i/mvuz0aj)You dont have forgee.lua, download it then save it in your scripts folder.

swev
03-27-2014, 03:08 PM
You dont have forgee.lua, download it then save it in your scripts folder.

when i setup xenobot i found no scripts folder :/

http://imagizer.imageshack.us/v2/xq90/21/hh96.jpg (https://imageshack.com/i/0lhh96j)

Spectrus
03-27-2014, 04:03 PM
You're in the wrong directory. Look in C:/Users/USER_NAME/Xenobot/Scripts

swev
03-30-2014, 11:44 AM
another problem

13:43 XenoScript Error:
Script: [XBFS] [EK] Venore Coryms.lua
Error: cannot open C:\Users\SAMSUNG\Documents\XenoBot\Scripts\[XBFS] Library.lua: No such file or directory
This is an error with user-input and should not be reported as a bug with XenoBot.

and even after i put the xbfs file on scripts section still same problem any help ?

http://imagizer.imageshack.us/v2/xq90/541/37ga.jpg (https://imageshack.com/i/f137gaj)

only4tibia
03-30-2014, 12:44 PM
another problem

13:43 XenoScript Error:
Script: [XBFS] [EK] Venore Coryms.lua
Error: cannot open C:\Users\SAMSUNG\Documents\XenoBot\Scripts\[XBFS] Library.lua: No such file or directory
This is an error with user-input and should not be reported as a bug with XenoBot.

and even after i put the xbfs file on scripts section still same problem any help ?

http://imagizer.imageshack.us/v2/xq90/541/37ga.jpg (https://imageshack.com/i/f137gaj)

Its looking for [XBFS] Library.lua, you have [XBPS] Library.lua

swev
03-30-2014, 12:52 PM
well thanks :D got the link ? :)

Glowingstick
03-30-2014, 03:15 PM
Just rename the document

Furpan
03-30-2014, 08:20 PM
well thanks :D got the link ? :)
I've added the two libraries to my signature to be easier to find, I get atleast one PM a week about the link. FYI, both the libraries are either in the first or second post from the thread you download the script

Just rename the document
That's a bad idea, I believe no functions will work :(

swev
03-31-2014, 03:54 AM
first of all sorry for sending many problems guys :) and second last day i downloaded a script with something strange as i know all scripts have 2 files 1 normal which you put in setting or w.e and the other is lua which you put in scripts but when i opened this script i got no lua files which i cant load on scripts its "xblua" any help here ? :D

http://imagizer.imageshack.us/v2/xq90/41/nrsf.jpg (https://imageshack.com/i/15nrsfj)

swev
03-31-2014, 12:20 PM
I've added the two libraries to my signature to be easier to find, I get atleast one PM a week about the link. FYI, both the libraries are either in the first or second post from the thread you download the script

That's a bad idea, I believe no functions will work :(


first of all sorry for sending many problems guys :) and second last day i downloaded a script with something strange as i know all scripts have 2 files 1 normal which you put in setting or w.e and the other is lua which you put in scripts but when i opened this script i got no lua files which i cant load on scripts its "xblua" any help here ? :D

http://imagizer.imageshack.us/v2/xq90/41/nrsf.jpg (https://imageshack.com/i/15nrsfj)

thanks for help mate but can you help me too in this problem ? :D

only4tibia
03-31-2014, 03:13 PM
thanks for help mate but can you help me too in this problem ? :D

Lua files and xblua files belong in the script folder, not the settings folder.

Regards,
O4T

swev
03-31-2014, 03:42 PM
Lua files and xblua files belong in the script folder, not the settings folder.

Regards,
O4T

i know mate i put the xblua files in scripts and still cant load them :/

swev
04-01-2014, 01:22 PM
any help !

swev
04-03-2014, 09:29 AM
hello ? :D