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 ➜ VBscript ➜ Script for changing values of numeric keypad?

Script for changing values of numeric keypad?

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


Posted by Gamoneterik   (5 posts)  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.
Top

Posted by Crowe   (21 posts)  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.
Top

Posted by Crowe   (21 posts)  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?
Top

Posted by Nick Gammon   Australia  (23,140 posts)  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
Top

Posted by Miraj   (2 posts)  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?

--
Top

Posted by Miraj   (2 posts)  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.

--
Top

Posted by Nick Gammon   Australia  (23,140 posts)  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
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.


27,106 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.