I am trying to capture a name from a trigger and then decide which action to take based on the name. The trigger match is the following:
^(.*?)The black stone guides(.*?)into gaining level (.*?)\!$
my attempt at a script is the following:
SetVariable ("lasttolevel", %2)
local justleveled = GetVariable ("lasttolevel")
if justleveled == "Burzmali" then
SetVariable ("clevel", %3)
else
Send ("say keep on truckin justleveled. Gratz!")
end
I am hoping the value of justleveled will be output by the say command not "justleveled" but i haven't got that far yet. I am getting the error:
[string "Trigger: "]:1: bad argument #2 to 'SetVariable' (string expected, got nil)
stack traceback:
[C]: in function 'SetVariable'
[string "Trigger: "]:1: in main chunk
what am i missing?
^(.*?)The black stone guides(.*?)into gaining level (.*?)\!$
my attempt at a script is the following:
SetVariable ("lasttolevel", %2)
local justleveled = GetVariable ("lasttolevel")
if justleveled == "Burzmali" then
SetVariable ("clevel", %3)
else
Send ("say keep on truckin justleveled. Gratz!")
end
I am hoping the value of justleveled will be output by the say command not "justleveled" but i haven't got that far yet. I am getting the error:
[string "Trigger: "]:1: bad argument #2 to 'SetVariable' (string expected, got nil)
stack traceback:
[C]: in function 'SetVariable'
[string "Trigger: "]:1: in main chunk
what am i missing?