[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  Problem with variables

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Problem with variables
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 28 Dec 2011 08:02 PM (UTC)  quote  ]
Message
Well let's not thrash around.

First, doing something like this should work:


\\\print "hello"


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
[Go to top] top

Posted by Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date 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/
[Go to top] top

Posted by Laurelei   (5 posts)  [Biography] bio
Date 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.
[Go to top] top

Posted by Laurelei   (5 posts)  [Biography] bio
Date 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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date 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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 27 Dec 2011 07:09 PM (UTC)  quote  ]
Message
Can you try this?


\\\print (SetVariable)


You should see something like:


function: 018DBA48


(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
[Go to top] top

Posted by Laurelei   (5 posts)  [Biography] bio
Date 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
[Go to top] top

Posted by Laurelei   (5 posts)  [Biography] bio
Date 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.
[Go to top] top

Posted by Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date 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/
[Go to top] top

Posted by Laurelei   (5 posts)  [Biography] 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
[Go to top] 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,489 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]