Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Tips and tricks
➜ Problem with variables
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Laurelei
(5 posts) Bio
|
| Date
| Tue 27 Dec 2011 01:07 PM (UTC) |
| 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 (2,558 posts) Bio
Global Moderator |
| Date
| Reply #1 on Tue 27 Dec 2011 04:27 PM (UTC) 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. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Laurelei
(5 posts) Bio
|
| Date
| Reply #2 on Tue 27 Dec 2011 06:36 PM (UTC) |
| 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) |
| Message
| Actually, I typed it with quotes as well:
\\\SetVariable ( "mobname", "Naga")
Either way I get the error | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Tue 27 Dec 2011 07:09 PM (UTC) |
| 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 (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Tue 27 Dec 2011 07:10 PM (UTC) |
| 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) |
| 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) |
| 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 (2,558 posts) Bio
Global Moderator |
| Date
| Reply #8 on Wed 28 Dec 2011 02:26 PM (UTC) 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. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #9 on Wed 28 Dec 2011 08:02 PM (UTC) |
| 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.
29,857 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top