Gammon Forum
Entire forum
MUSHclient
Tips and tricks
Sending variables with script
Sending variables with script
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Cyrgon
(6 posts) bio
|
Date
| Thu 14 Jun 2007 04:26 PM (UTC) |
Message
| Alright, so I have an alias named test.
Within, I have lua script as such:
var = tonumber (GetVariable("x")) or 0
Now, I want to Send this variable to the mud like this:
Send(say <var>)
Is this possible in any way?
I've looked through the help, the faq, searched on the forum, checked lua functions, and I've found nothing.
Anyone able to help? :) | top |
|
Posted by
| Shaun Biggs
USA (644 posts) bio
|
Date
| Reply #1 on Thu 14 Jun 2007 04:36 PM (UTC) |
Message
| Send( "say "..var )
Send will push a string to the mud, so you just send it as a string. |
It is much easier to fight for one's ideals than to live up to them. | top |
|
Posted by
| Cyrgon
(6 posts) bio
|
Date
| Reply #2 on Thu 14 Jun 2007 04:41 PM (UTC) |
Message
| Sweet. Thanks man. | top |
|
Posted by
| Shaun Biggs
USA (644 posts) bio
|
Date
| Reply #3 on Thu 14 Jun 2007 05:09 PM (UTC) |
Message
| Here's a good thing to get in the habit of doing. When you are looking to use a MUSHclient function, look it up in the list of script functions, and check the data types required. Then if you're unsure of certain methods used to alter the data in that data type, look it up in the lua tutorial provided at the lua wiki. This has saved me countless hours of trying to figure out some of these things on my own.
MUSHclient function list:
http://www.gammon.com.au/scripts/function.php
For a nice tutorial on Lua:
http://lua-users.org/wiki/TutorialDirectory |
It is much easier to fight for one's ideals than to live up to them. | top |
|
Posted by
| Cyrgon
(6 posts) bio
|
Date
| Reply #4 on Thu 14 Jun 2007 06:57 PM (UTC) |
Message
| Thanks a lot. That helped me out quite a bit. | 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.
15,488 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.