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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Script for changing values of numeric keypad?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Script for changing values of numeric keypad?

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


Posted by Gamoneterik   (5 posts)  [Biography] bio
Date Thu 25 Nov 2010 12:21 AM (UTC)
Message
95% of the time my numeric keypad is exactly as it's supposed to be: North, South, East, etc.

But I would like to be able to make an alias that switches the values of the cardinal points to "Evade North", "Evade East" etc. whereby "Evade" is a class ability that allows me to move more freely in times of combat.

Can this be done?

If so, please let me know how. Cheers.
[Go to top] top

Posted by Crowe   (21 posts)  [Biography] bio
Date Reply #1 on Thu 25 Nov 2010 12:56 AM (UTC)
Message
You can press and hold ctrl to get another set of keypad buttons. You need to look on the Keypad and check to see it.
[Go to top] top

Posted by Crowe   (21 posts)  [Biography] bio
Date Reply #2 on Thu 25 Nov 2010 11:25 AM (UTC)
Message
I was thinking about this topic some more and have a question. Why does the keypad not have a save and load like the macros, aliases, triggers, and variables? Could the feature be added? Or would it be to difficult?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 25 Nov 2010 10:29 PM (UTC)
Message
You can do it with ImportXML:

Template:function=ImportXML ImportXML

The documentation for the ImportXML script function is available online. It is also in the MUSHclient help file.



As an example, in Lua:


ImportXML ('<keypad> <key name="0" > <send>dodge left</send> </key> </keypad>')


And in VBscript:


ImportXML "<keypad> <key name=""1"" > <send>dodge right</send> </key> </keypad>"


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Miraj   (2 posts)  [Biography] bio
Date Reply #4 on Thu 25 Oct 2012 08:25 AM (UTC)
Message
ImportXML ('<keypad> <key name="0" > <send>dodge left</send> </key> </keypad>')

how do i replace <send>dodge left</send> with a script function instead?

--
[Go to top] top

Posted by Miraj   (2 posts)  [Biography] bio
Date Reply #5 on Thu 25 Oct 2012 08:38 AM (UTC)
Message
Miraj said:

ImportXML ('<keypad> <key name="0" > <send>dodge left</send> </key> </keypad>')

how do i replace <send>dodge left</send> with a script function instead?

--


nvm ... got it:

<send>/lua mix_stun_powder()</send>

where /lua is my alias for running a script.

--
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 25 Oct 2012 08:36 PM (UTC)
Message
Or you could send some word, eg. "dodge_left_script" and make an alias that matches that, and then calls your script.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


6,071 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]