Run-time error
World: myworld
Immediate execution
[string "Script file"]:5: bad argument #1 to 'GetVariable' (string expected, got nil)
stack traceback:
[C]: in function 'GetVariable'
[string "Script file"]:5: in function 'mywork'
[string "Trigger: "]:1: in main chunk
Error context in script:
1 : function mywork(var1)
2 : --print (_VERSION);
3 :
4 :
5*: local v = GetVariable(var1);
6 : local mymaster = GetVariable("master");
7 : local myskills = GetVariable("skills");
8 :
9 : --print (mymaster);
I am newbie.Just want to trigger a patten and pass the matched content to function mywork.
why the var1 is always nil? I am confused, because I can see the matched content when choose the send to output!!
World: myworld
Immediate execution
[string "Script file"]:5: bad argument #1 to 'GetVariable' (string expected, got nil)
stack traceback:
[C]: in function 'GetVariable'
[string "Script file"]:5: in function 'mywork'
[string "Trigger: "]:1: in main chunk
Error context in script:
1 : function mywork(var1)
2 : --print (_VERSION);
3 :
4 :
5*: local v = GetVariable(var1);
6 : local mymaster = GetVariable("master");
7 : local myskills = GetVariable("skills");
8 :
9 : --print (mymaster);
I am newbie.Just want to trigger a patten and pass the matched content to function mywork.
why the var1 is always nil? I am confused, because I can see the matched content when choose the send to output!!