Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Laurelei
(5 posts) bio
|
| Date |
Tue 27 Dec 2011 01:07 PM (UTC) [ quote
] |
| Message |
I viewed the tutorial about variables, but when I try to use SetVariable similarly in the client (for Aardwolf) I get a runtime error. See below
Run-time error
World: Aardwolf
Immediate execution
[string "Command line"]:1: attempt to call global 'SetVariable' (a string value)
stack traceback:
[string "Command line"]:1: in main chunk | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #1 on Tue 27 Dec 2011 04:27 PM (UTC) [ quote
] Amended on Tue 27 Dec 2011 04:28 PM (UTC) by Fiendish
|
| Message |
| You will have greater luck getting help if you actually show us what you did to get that error message. |
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Laurelei
(5 posts) bio
|
| Date |
Reply #2 on Tue 27 Dec 2011 06:36 PM (UTC) [ quote
] |
| Message |
| I typed \\\SetVariable ( mobname, Naga) in the command line of the client (where I enter my commands to move about the mud), just like in the tutorial. my scripting page shows the three backslashes as my script prefix. | top |
|
| Posted by |
Laurelei
(5 posts) bio
|
| Date |
Reply #3 on Tue 27 Dec 2011 06:38 PM (UTC) [ quote
] |
| Message |
Actually, I typed it with quotes as well:
\\\SetVariable ( "mobname", "Naga")
Either way I get the error | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #4 on Tue 27 Dec 2011 07:09 PM (UTC) [ quote
] |
| Message |
Can you try this?
You should see something like:
(The numbers might be different).
I suspect you have assigned a string to SetVariable. Reloading the script environment (Game Menu -> Reload Script File) should help. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #5 on Tue 27 Dec 2011 07:10 PM (UTC) [ quote
] |
| Message |
Laurelei said:
I typed \\\SetVariable ( mobname, Naga) in the command line of the client (where I enter my commands to move about the mud), just like in the tutorial. my scripting page shows the three backslashes as my script prefix.
That is wrong anyway, because mobname and Naga will be treated as variables (not literals) and are probably nil. You need the quotes. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Laurelei
(5 posts) bio
|
| Date |
Reply #6 on Wed 28 Dec 2011 01:08 PM (UTC) [ quote
] |
| Message |
| Typing \\\print (SetVariable) gives me "unknown command, please check the helpfiles"--I think that's aard's message, not mush. | top |
|
| Posted by |
Laurelei
(5 posts) bio
|
| Date |
Reply #7 on Wed 28 Dec 2011 01:09 PM (UTC) [ quote
] |
| Message |
That is wrong anyway, because mobname and Naga will be treated as variables (not literals) and are probably nil. You need the quotes.
Like I said, I did it with quotes with the same result. | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #8 on Wed 28 Dec 2011 02:26 PM (UTC) [ quote
] Amended on Wed 28 Dec 2011 02:32 PM (UTC) by Fiendish
|
| Message |
Laurelei said: Typing \\\print (SetVariable) gives me "unknown command, please check the helpfiles"--I think that's aard's message, not mush.
I think that's not possible unless you disabled the script engine before that. Make sure the script engine is enabled, set to Lua, and that you typed it correctly. |
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #9 on Wed 28 Dec 2011 08:02 PM (UTC) [ quote
] |
| Message |
Well let's not thrash around.
First, doing something like this should work:
If not, you don't have \\\ as your scripting prefix, or you don't have scripting turned on (or set to Lua).
Note that your scripting prefix must be the very first thing entered, a leading space means what you type just goes to the MUD.
Second, you may as well use the version that will work:
SetVariable ( "mobname", "Naga")
Third, if it says SetVariable is a string, it is because you made it so. Maybe you did this at some stage:
SetVariable = "mobname", "Naga"
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,493 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )