need help with a debug....

DanaLea73
Posts: 46
Joined: Fri Jul 09, 2010 12:04 am

need help with a debug....

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

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: need help with a debug....

Post 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.

DanaLea73
Posts: 46
Joined: Fri Jul 09, 2010 12:04 am

Re: need help with a debug....

Post 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

DanaLea73
Posts: 46
Joined: Fri Jul 09, 2010 12:04 am

Re: need help with a debug....

Post 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?

DanaLea73
Posts: 46
Joined: Fri Jul 09, 2010 12:04 am

Re: need help with a debug....

Post by DanaLea73 »

here's the visual...

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

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: need help with a debug....

Post 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

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: need help with a debug....

Post 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.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: need help with a debug....

Post by Vadi »

You need to use plain quotes, not fancy quotes

DanaLea73
Posts: 46
Joined: Fri Jul 09, 2010 12:04 am

Re: need help with a debug....

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

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: need help with a debug....

Post 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.

Post Reply