scripting error

Posted by Geraint on Tue 30 Dec 2008 05:28 PM — 4 posts, 14,310 views.

#0
First put this in bug reports, upon consideration.. I dont think it is a mush bug report!

--

This bug report popped up after the system cures an affliction.




Error number: 0
Event: Run-time error
Description: ...Hclient\ACS2\modules\scripts\plugins\afflictions.lua:709: attempt to call field '?' (a nil value)

stack traceback:

...Hclient\ACS2\modules\scripts\plugins\afflictions.lua:709: in function 'default'

...Hclient\ACS2\modules\scripts\plugins\afflictions.lua:715: in function '?'

...)\MUSHclient\ACS2\modules\scripts\plugins\prompt.lua:179: in function <...)\MUSHclient\ACS2\modules\scripts\plugins\prompt.lua:54>
Called by: Function/Sub: on_prompt called by trigger

Reason: processing trigger "PromptTrigger"


It also made every prompt line pop a line up that said "on_prompt" had an issue.

I really don't know that much about this business, and the system creator isn't around. Any direction as tow here to begin to fix this would be great, or maybe I did something stupid with settings!


Here we go

http://www.geocities.com/gd1960/luas.zip

the two LUA's it mentions are in that zip file, only place to upload was GeoShitties =\
USA #1
I've taken the liberty of removing your other post since you seem to want this one to be the reference post.
Australia Forum Administrator #2
It is hard to say, seeing as I didn't write any of this, but some debugging would help. Around line 709, where the error occurred, in file afflictions.lua, add the extra code in bold so it reads like this:


function afflict_default(affliction)
	local acknowledged = afflicted(affliction)

  if not cures[affliction] then   -- add these 3 lines
      Note ("No cure known for affliction ", affliction)
  else 	
  	if(acknowledged and acknowledged[2]) then
	  	cures[affliction]()
  	end
  end  -- add this too	
end


I am guessing that the variable "affliction" is set to something that is not in the cures table, and thus cures[affliction] is nil, and you cannot call a nil value.
Amended on Tue 30 Dec 2008 07:38 PM by Nick Gammon
#3
It helped find the problem lines, thakn you =D

I'm trying to see if I can fix it. It has some break lines that are wrong.


5268h, 5255m, 32080e, 29110w exdb-
Both of your legs must be free and unhindered to do that.
No cure known for affliction crippledleg
5268h, 5255m, 32080e, 29110w exdb-
No cure known for affliction crippledleg




Rean lets fly at you with a snap kick.
To your horror, your right leg has been mutilated beyond repair by ordinary
means.
He connects to the right leg!
parry right leg
5045h, 5255m, 32080e, 29110w exdb-
drink health
apply mending to legs
Rean balls up one fist and hammerfists you.
He connects to the right leg!
parry right leg
Your shield completely absorbs the damage.
5045h, 5255m, 32080e, 29110w exdb-
Rean balls up one fist and hammerfists you.
He connects to the right leg!
parry right leg
4641h, 5255m, 32080e, 29110w exdb-
You will now attempt to parry attacks to your right leg.
4641h, 5255m, 32080e, 29110w exdb-
You take a drink from a black-walnut vial.
The elixir heals and soothes you.
5900h, 5255m, 32080e, 29110w exdb-
You take out some salve and quickly rub it on your legs.
The salve fizzles away without effect.
5900h, 5255m, 32080e, 29110w exdb-



6636h, 5255m, 32080e, 29110w exdb-
Rean lets fly at you with a snap kick.
Your left leg is greatly damaged from the beating.
He connects to the left leg!
parry left leg
5733h, 5255m, 32070e, 29092w exdb-
apply mending to legs
Rean balls up one fist and hammerfists you.
He connects to the left leg!
parry left leg
5329h, 5255m, 32070e, 29092w exdb-
drink health
Rean balls up one fist and hammerfists you.
He connects to the left leg!
parry left leg
Your shield completely absorbs the damage.
5329h, 5255m, 32070e, 29092w exdb-
You will now attempt to parry attacks to your left leg.
5329h, 5255m, 32070e, 29092w exdb-
You take out some salve and quickly rub it on your legs.
The salve fizzles away without effect.
5329h, 5255m, 32070e, 29092w exdb-


In every case that it applied mending to legs, its hould've done apply restoration.

I'm a tinkerin! I dont know where the cure calls are, so I have to find those.