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
➜ Lua
➜ Update to Base documentation?
Update to Base documentation?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| WillFa
USA (525 posts) Bio
|
Date
| Sun 05 Feb 2006 02:26 AM (UTC) |
Message
| Hey Nick. :)
I've been running MushClient 3.70 under Wine on Fedora. So I need to learn Lua.
Could you clarify the documentation for the Unpack() function in the Base docs?
In python (and also in Lua!!), you can unpack an array/dictionary easily with multiple assignments on a line. (a, b, c = 1,2,3) I noticed unpack in the docs, but it appears from the docs that there isn't a difference between table.concat and unpack.
Could you note that concat returns one variable of all values run together, while unpack returns n variables for n values?
For Example:
Trigger: HP: (%d)/(%d) SP: (%d)/(%d)
Script: iHP, iHPMax, iSP, iSPMax = unpack(arrWildCards)
Note (iHP)
Note (iSP)
prints:
100
100
Script: iHP, iHPMax, iSP, iSPMax = table.concat(arrWildCards)
Note (iHP)
Note (iSP)
prints:
100 200 100 200
nil
The current documentation is unclear since print() and Note() handle multiple parameters transparently.
I've worked around the confusion by updating my trigger itself with NamedParameters (HP: (?P<iHP>%d)/...) before I figured it out.
Oh, you had also mentioned that if there was an interest, you'd distribute MushClient in a tarball as well. :)
Thanks!
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 07 Feb 2006 12:43 AM (UTC) |
Message
| I have clarified the documentation slightly as you requested. I will do a tarball shortly when I release version 3.74. |
- 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.
6,380 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top