Problem with SetVariable

Posted by Lidi on Mon 29 Aug 2005 09:35 AM — 3 posts, 17,327 views.

China #0
trigger: there is *
send to script: SetVariable ("Name", %1)

If %1 is a number,it works perfectly.
When %1 is a string,it goes wrong.

[string "Trigger: "]:1: bad argument #2 to `SetVariable' (string expected, got nil)
stack traceback:
[C]: in function `SetVariable'
[string "Trigger: "]:1: in main chunk
#1
Try quotes around the %1? That will treat your parameter as a string, which is what the SetVariable method expects every time, even if the value is really a number. Better to be safe and put it in quotes.
China #2
Great thanks to larkin!
I solved the problem.