Register forum user name Search FAQ

Gammon Forum

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 ➜ General ➜ Keypad Scripting

Keypad Scripting

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


Posted by Beale   (35 posts)  Bio
Date Fri 07 Mar 2008 09:54 PM (UTC)
Message
Does anyone know any way to get or set the values of the keypad executors? I couldn't find one, and didn't want to give up entirely.

(Yes, I know I could manually assign aliases to all of them and then change the aliases, but I'd like to make a plugin, and would rather not have to make people type these things in themselves.)
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 07 Mar 2008 11:00 PM (UTC)

Amended on Fri 07 Mar 2008 11:01 PM (UTC) by Nick Gammon

Message
You can use ExportXML and ImportXML to do this.

ExportXML gives you the XML code, like this:


/print (ExportXML (5, "0"))


... prints:


<keypad>

  <key name="0" >
  <send>look</send>
  </key>
</keypad>


To get the actual value extract the stuff between <send> and </send>, like this:


/print (string.match (ExportXML (5, "0"), "<send>(.*)</send>"))  --> look


For the key names edit any MUSHclient world file using a text editor and you will see them. They look like "0", "1" .. "9", ".", "/", "*", "-", and "+" and then the same with "Ctrl+" in front of them (eg. "Ctrl+8").

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Beale   (35 posts)  Bio
Date Reply #2 on Sat 08 Mar 2008 01:06 AM (UTC)
Message
Awesome, thanks.
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.


10,723 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.