error that I have no idea where is coming from

Posted by Oriol on Wed 24 Jun 2009 07:50 AM — 6 posts, 23,433 views.

#0
Hi,
I'm trying to script something, and this error keeps coming up randomly, but when I look at the line (650-660) they make no sense and have nothing to do with the error, or at least I don't think. Here's what it says.

Error raised in timer function (in wait module).
stack traceback:
[string "Plugin"]:655: in function <[string "Plugin"]:612>
Run-time error
Plugin: AlterAeon (called from world: alter aeon)
Function/Sub: wait.timer_resume called by timer
Reason: processing timer "wait_timer_2252"
C:\Program Files\MUSHclient\lua\wait.lua:51: [string "Plugin"]:655: attempt to
concatenate field '?' (a boolean value)
stack traceback:
[C]: in function 'error'
C:\Program Files\MUSHclient\lua\wait.lua:51: in function <C:\Program
Files\MUSHclient\lua\wait.lua:43>
Australia Forum Administrator #1
Which version of MUSHclient are you using?

It is hard to debug without seeing the script.
USA #2
The error "attempt to concatenate field" comes up when you try concat two things, but one isn't a string or number.

The field "?" means the problem is that the item that it can't concat is in a table and what you're using to reference the key isn't a string (or is a string but is in a variable).

Oddly enough, it should say "(a nil value)" but it says "(a boolean value)". The only way I could replicate that is referencing it with a boolean value, or by using a metatable so it returns false or true when it can't find what it's looking for.

That's all I could figure out from the error, without seeing the script(s) itself.
Amended on Wed 24 Jun 2009 10:13 AM by Fadedparadox
#3
Thanks, I'm going to try to look at this.
But when it says script line, since the script is inside a plugin, means inside the <script> xml tag, right? or could it be inside a trigger as well.
Australia Forum Administrator #4
If inside a plugin, the line number is relative to the script inside the plugin.

If you type:


/Debug "plugins"


Then it outputs, amongst other things, the script in the plugin. With a bit of mucking around subtracting the first line from the current line, you can work out which actual line the error is in.
Australia Forum Administrator #5
Judging by this:


[string "Plugin"]:655: in function <[string "Plugin"]:612>


Unless you have a 655 line script in a trigger, it is the plugin script itself, inside the script tag. If you used "include standard constants" you need to offset that from the count.