Page 1 of 2

need help with a debug....

Posted: Fri Sep 17, 2010 2:51 am
by DanaLea73
here's the trigger... I tested it with the send that is now commented out... what's wrong with my array?
Screen shot 2010-09-16 at 9.41.41 PM.png
here's the whole array...
Code: [show] | [select all] lua
Spell_list = {Displacement,Harden body,Vitality,Domination,Godly embrace,Remove curse,Cancellation,Dampening field,Skin,Windblast,Fly,Preserve,Summon,Third attack,Flesh armor,Absorb,Aim,Negation,Cure critical,Fast healing,Energy containment,Magical rush,Prayer of fortune,Spirit shield,Sanctuary,Intellect fortress,Cleansing,Indestructible aura,Ground strike,True seeing,Ice storm,Heal,Stone skin,Calculation,Divine swiftness,Sustenance,Power grip,Fourth attack,Awareness,Berserk,Solar Flare,Champions strength,Revelation,Reskin,Charge,Wolf spirits,Slit,Holy aura,Channel energy,Line of protection,Heat shield,Hydroblast,Mist form,Herbal remedy,Warmth,Grey aura,Compression,Web,Dissolve,Renew,Blockexit,Locate corpse,Energy ball,Illuminate,Unlawful entry,Antimagic shell,Recon,Strangle,Vaccinate,Acidproof,Retreat,Second attack dual,Spirit strike,Power of faith,Energy shield,Knock,Translocate,Awakening,Earth shroud,Shockproof,Holy mirror,Bashdoor,Disrupt,Solidify,Panic,Rejuvenate,Survey,Camp,Reverse align,Lightspeed,Self harmony,Resonate,Miracle,Holy word,Wayfind,Third attack dual,Toxic resistance,Counter strike,Party harmony,Restore life,Party shield,Tempest,Eruption,Incomplete healing,Merge chaos}
and the error, in case you cant read it...
  • Lua syntax error:[string "function Trigger3250.."]:4 "}" expected near 'body'
thanks in advance!

Re: need help with a debug....

Posted: Fri Sep 17, 2010 3:42 am
by tsuujin
You must enclose your list elements with quotation marks.

var = {"test", "another test"}

if they don't have quotation marks around them, lua assumes you're calling a variable, and the word "body" was completely out of place in that mindset.

Re: need help with a debug....

Posted: Fri Sep 17, 2010 5:14 am
by DanaLea73
oh man... there's over a hundred items in that list... really wish I'd known that before... I guess I get to see if find and replace will work. :P

Re: need help with a debug....

Posted: Fri Sep 17, 2010 5:21 am
by DanaLea73
grrr.... what about now?

Lua syntax error:[string "function Trigger3250.."]:4: unexpected symbol near '?'
Code: [show] | [select all] lua
Spell_list = {“Displacement", "Harden body", "Vitality", "Domination", "Godly embrace", "Remove curse", "Cancellation", "Dampening field", "Skin", "Windblast", "Fly", "Preserve", "Summon", "Third attack", "Flesh armor", "Absorb", "Aim", "Negation", "Cure critical", "Fast healing", "Energy containment", "Magical rush", "Prayer of fortune", "Spirit shield", "Sanctuary", "Intellect fortress", "Cleansing", "Indestructible aura", "Ground strike", "True seeing", "Ice storm", "Heal", "Stone skin", "Calculation", "Divine swiftness", "Sustenance", "Power grip", "Fourth attack", "Awareness", "Berserk", "Solar Flare", "Champions strength", "Revelation", "Reskin", "Charge", "Wolf spirits", "Slit", "Holy aura", "Channel energy", "Line of protection", "Heat shield", "Hydroblast", "Mist form", "Herbal remedy", "Warmth", "Grey aura", "Compression", "Web", "Dissolve", "Renew", "Blockexit", "Locate corpse", "Energy ball", "Illuminate", "Unlawful entry", "Antimagic shell", "Recon", "Strangle", "Vaccinate", "Acidproof", "Retreat", "Second attack dual", "Spirit strike", "Power of faith", "Energy shield", "Knock", "Translocate", "Awakening", "Earth shroud", "Shockproof", "Holy mirror", "Bashdoor", "Disrupt", "Solidify", "Panic", "Rejuvenate", "Survey", "Camp", "Reverse align", "Lightspeed", "Self harmony", "Resonate", "Miracle", "Holy word", "Wayfind", "Third attack dual", "Toxic resistance", "Counter strike", "Party harmony", "Restore life", "Party shield", "Tempest", "Eruption", "Incomplete healing", "Merge chaos”}
if table.contains(Spell_list, matches[2])
	then echo("gt I can now prac: " .. matches[2])
end
(the spell list is all on one line)

I don't see a '?' anywhere in there.... help?

Re: need help with a debug....

Posted: Fri Sep 17, 2010 5:28 am
by DanaLea73
here's the visual...

Screen shot 2010-09-17 at 12.23.14 AM.png

Re: need help with a debug....

Posted: Fri Sep 17, 2010 6:00 am
by Heiko
The problem is the very first " before Displacement and the very last after "Merge chaos". They are not green, but black -> wrong symbol. Somehow They got translated into fancier versions. Did you use a word processor to write the code?
Mudlet's syntax highlighting comes handy in such cases. All items should be green.
Code: [show] | [select all] lua
Spell_list = {"Displacement", "Harden body", "Vitality", "Domination", "Godly embrace", "Remove curse", "Cancellation", "Dampening field", "Skin", "Windblast", "Fly", "Preserve", "Summon", "Third attack", "Flesh armor", "Absorb", "Aim", "Negation", "Cure critical", "Fast healing", "Energy containment", "Magical rush", "Prayer of fortune", "Spirit shield", "Sanctuary", "Intellect fortress", "Cleansing", "Indestructible aura", "Ground strike", "True seeing", "Ice storm", "Heal", "Stone skin", "Calculation", "Divine swiftness", "Sustenance", "Power grip", "Fourth attack", "Awareness", "Berserk", "Solar Flare", "Champions strength", "Revelation", "Reskin", "Charge", "Wolf spirits", "Slit", "Holy aura", "Channel energy", "Line of protection", "Heat shield", "Hydroblast", "Mist form", "Herbal remedy", "Warmth", "Grey aura", "Compression", "Web", "Dissolve", "Renew", "Blockexit", "Locate corpse", "Energy ball", "Illuminate", "Unlawful entry", "Antimagic shell", "Recon", "Strangle", "Vaccinate", "Acidproof", "Retreat", "Second attack dual", "Spirit strike", "Power of faith", "Energy shield", "Knock", "Translocate", "Awakening", "Earth shroud", "Shockproof", "Holy mirror", "Bashdoor", "Disrupt", "Solidify", "Panic", "Rejuvenate", "Survey", "Camp", "Reverse align", "Lightspeed", "Self harmony", "Resonate", "Miracle", "Holy word", "Wayfind", "Third attack dual", "Toxic resistance", "Counter strike", "Party harmony", "Restore life", "Party shield", "Tempest", "Eruption", "Incomplete healing", "Merge chaos"}
if table.contains(Spell_list, matches[2])
        then echo("gt I can now prac: " .. matches[2])
end

Re: need help with a debug....

Posted: Fri Sep 17, 2010 6:02 am
by demonnic
good eye. You can even see it in the lua code block on the forum here. Of course, I didn't until I read the above post.

Re: need help with a debug....

Posted: Fri Sep 17, 2010 1:08 pm
by Vadi
You need to use plain quotes, not fancy quotes

Re: need help with a debug....

Posted: Fri Sep 17, 2010 9:13 pm
by DanaLea73
yes, I used a word processor. find/replace seemed the best way to do this.

but it's all good now.. well.. the debugger is gone. now to go level a few times and test it. :)

thanks everyone!!!

Re: need help with a debug....

Posted: Fri Sep 17, 2010 9:47 pm
by Vadi
find/replace was a fine idea but not in a word processor. Better to use something thats better designed for coding - I think Textmate for Macs comes highly recommended.