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


Register forum user name Search FAQ

Gammon Forum

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

Sending variables with script

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Cyrgon   (6 posts)  [Biography] 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? :)
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Cyrgon   (6 posts)  [Biography] bio
Date Reply #2 on Thu 14 Jun 2007 04:41 PM (UTC)
Message
Sweet. Thanks man.
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Cyrgon   (6 posts)  [Biography] bio
Date Reply #4 on Thu 14 Jun 2007 06:57 PM (UTC)
Message
Thanks a lot. That helped me out quite a bit.
[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.


15,488 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]