My spellup script erred because of the latest version

Posted by porridge cat on Sat 28 Apr 2007 08:05 PM — 5 posts, 20,643 views.

#0
my version was 3.78 and i don't know what stuff has been changed... resulting in this error. finally! how to revise it?



-----------------------
DeleteTrigger("deleteall")
ArrayDelete "spells"
ArrayCreate "spells"

t = {
Shield = 1,
['Mental barrier'] = 1,
['Underwater breathing'] = 1,
Armor = 1,
Bless = 1,
Blur = 1,
['Enhanced strength'] = 1,
['Adrenaline control'] = 1,
Avoidance = 1,
Aid = 1,
['Thought shield'] = 1,
['Detect magic'] = 1,
['Detect invis'] = 1,
['Magic circle'] = 1,
['Mystic might'] = 1,
['Giant strength'] = 1,
['Inertial barrier'] = 1,
Accelerate =1,
Enlightenment =1,
Displacement =1,
['Harden body'] =1,
['Godly embrace'] =1,
['Flesh armor'] =1,
Absorb =1,
}

backt = {
['Energy containment'] =1,
['Magical rush'] =1,
['Prayer of fortune'] =1,
Sanctuary =1,
['Intellect fortress'] =1,
['Indestructible aura'] =1,
Perception =1,
['True seeing'] =1,
Frenzy =1,
['Stone skin'] =1,
Calculation =1,
['Divine swiftness'] =1,
Revelation =1,
Rally =1,
['Channel energy'] =1,
['Line of protection'] =1,
Warmth =1,
Compression =1,
['Antimagic shell'] =1,
Vaccinate =1,
Acidproof =1,
['Energy shield'] =1,
Awakening =1,
Shockproof =1,
['Holy mirror'] =1,
Lightspeed =1,
['Self harmony'] =1,
['Grey aura'] =1,
['Toxic resistance'] =1,
}

ArrayImport ("spells", t)

AddTriggerEx("deleteall", [[^You are affected by (.*?) and (.*?)]], [[

DeleteTrigger("casted")

local bb = ArrayListKeys ("spells")
if bb == nil then
--Note ("")
else
for k, v in pairs (ArrayListKeys ("spells")) do
Send ("cast ".."'"..v.."'")
end
end

DoAfterSpecial (1, [[
ArrayDelete "spells"
DeleteTrigger("deleteall")]], 12)

]], 1+32+1024, -1, 0, "", "", 12, 99)

AddTriggerEx("casted", [[^Spell \\: ([\\w\\s]+) \\(]], [[
ArrayDeleteKey ("spells", "%%1")
]], 1+32+1024, -1, 0, "", "", 12, 99)

Send ("saff")

Australia Forum Administrator #1
Can you give the error message please? It is so hard to debug when people say "it gave an error".
#2
Compile error
World: aardwolf
Immediate execution
[string "Alias: "]:83: unexpected symbol near ']'

thanks for the trouble you've taken~

USA #3

DoAfterSpecial (1, [[
ArrayDelete "spells"
DeleteTrigger("deleteall")]], 12)

]], 1+32+1024, -1, 0, "", "", 12, 99)

The last line in this is line 83. The ]] doesn't pair with anything previous in the file. The [[ in line 79 pairs with the ]] in line 81, leaving no open brackets to close.
USA #4
Also, just to enforce a suggestion in another thread, you should really be enabling and disabling the triggers instead of creating and destroying them. This is just a simple toggle, rather than making MUSHclient go through a much longer process having to muck about with the trigger queue repeatedly. For the mud you're playing on, I tend to walk around with 50 spells on at any given time, and having that much creation and deletion will cause a greater chance for errors.

Just keeping the trigger will also solve this error you are having, since you could just have a trigger made in the trigger config menu, and not have to make a long addtrigger function.