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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Keypad Scripting

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Keypad Scripting

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Beale   (35 posts)  [Biography] bio
Date Fri 07 Mar 2008 09:54 PM (UTC)  quote  ]
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.)
[Go to top] top

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 07 Mar 2008 11:00 PM (UTC)  quote  ]

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

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


1,265 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]