Keypad Scripting

Posted by Beale on Fri 07 Mar 2008 09:54 PM — 3 posts, 14,447 views.

#0
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.)
Australia Forum Administrator #1
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").
Amended on Fri 07 Mar 2008 11:01 PM by Nick Gammon
#2
Awesome, thanks.