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.
Entire forum
➜ MUSHclient
➜ General
➜ Keypad Value & Changes?
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| MattMc
USA (54 posts) Bio
|
Date
| Fri 16 Jun 2006 04:42 AM (UTC) |
Message
| Is there any known way to get the value of a keypad key (like 5, or period, etc) and to change said value all within scripts? I looked a bit and couldn't find anything to do this. | Top |
|
Posted by
| Onoitsu2
USA (248 posts) Bio
|
Date
| Reply #1 on Fri 16 Jun 2006 04:50 AM (UTC) |
Message
| Setting I think can be achieved using the Accelerator functions, but I am not sure, as I have both CTRL and non-CTRL keypad buttons set, so I have 30 buttons I can set, I have all non-CTRL set, and most of the CTRL have a function.
Hope that helps a little lol...
Laterzzz,
Onoitsu2 | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #2 on Fri 16 Jun 2006 05:17 AM (UTC) |
Message
| If you set your keypad with Accelerator() then you can later retrieve the bindings with AcceleratorList(). There's no way, I think, to get what a keypad button was set to if it was set through the dialogue. | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #3 on Fri 16 Jun 2006 06:43 AM (UTC) |
Message
| You could use ExportXML to get keypad values. For example to see what is bound to the "/" key:
print (ExportXML (5, "/"))
Output
<keypad>
<key name="/" >
<send>inventory</send>
</key>
</keypad>
Run that through a string.gsub in Lua and you have the answer:
_, _, k = string.find (ExportXML (5, "/"), "<send>(.*)</send>")
print (k) --> inventory
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #4 on Fri 16 Jun 2006 06:46 AM (UTC) |
Message
| Of course you could use ImportXML to change it. :)
/ImportXML [[
<keypad>
<key name="/" >
<send>say ohno!</send>
</key>
</keypad>
]]
|
- 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.
16,490 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top