The @variable form isn't actually part of Lua. MUSHclient evaluates @variables before running the script, so your code first becomes this:
SetVariable ("spellname1", "magic missile")
ColourNote ("white", "blue", "Spell is now: light")
ColourNote ("white", "blue", "Target is still: Somebody")
SetStatus ("Target: Somebody / Spell: light")
And -then- it's run. What you should do to avoid this is:
SetVariable ("spellname1", "magic missile")
local spellname1 = GetVariable("spellname1")
ColourNote ("white", "blue", "Spell is now: " .. spellname1)
ColourNote ("white", "blue", "Target is still: @target")
SetStatus ("Target: @target / Spell: " .. spellname1)
Here, I'm using a Lua function to get the spellname1 variable, so there aren't any nasty surprises. |