LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Creating a button to fire a keybound action? (https://www.lotrointerface.com/forums/showthread.php?t=1867)

Delone 09-09-2012 04:17 AM

Creating a button to fire a keybound action?
 
Is there any way to link a button created in a window to a keybound action?

e.g. If I wanted to create a button on a quickbar which was to toggle autorun on and off?

If yes, does it work for specific commands, or does it just fire a particular keypress, and that is then dependant on people having the required action bound to that key? If it's command specific, is there a listing of the commands associated with particualr actions? I couldn't find anything along these lines in the documentation.

Any additional information would be most welcome, still muddling my way through learning this, and with no programming background at all I'm mostly just picking and prodding at others code where I see them doing something similar to what I want to achieve in order to learn how things work.

Thanks in advance, Delone.

Queekusme 09-09-2012 10:55 AM

As far as I know, you cannot use either Quickslots or a button on an interface to control a keyboard press or bound action.

if it were possible then people would skip the button aspect and create bots to auto level them (by standing them in front of a mob and spawn-killing them) when they went to work/school/sleep etc.

I must admit if it were possible, it is tempting, but I doubt that I personally would do it.

Delone 09-09-2012 04:33 PM

From what I can see, it would be no more possible to do this with an action bound to a button on a quickslot than it is now - you would still have to click the button on the interface each time to fire the event, just as you would have to be at the keyboard to press the keystroke.

As it is, every quickslot in existance is capable of firing an action, including all of our attacks - what I was asking was if it's possible to trigger actions that are NOT attacks/skills but rather the various commands that are triggered via keybindings at the moment. I have limited mobility in my left arm, and as such I use my left hand on WASD for steering and movement, but very little else. All other actions I fire with mouse. Up till now that hasn't been a problem, but being in the RoR beta and with the new moving combat style, I'm having to use the mouse to control movement as well, so having to let go of it to perform keyboard actions leaves me unable to control the camera for longer periods of time than I like - being able to bind these actions to an onscreen button would make things much easier for me. :)

Since the original post I've come across Garan's posting on action codes: http://forums.lotro.com/showthread.p...I.Lotro.Action (great stuff from Garan as usual :) ) and have seen a couple of examples of responding to keypresses via codes to get events to fire, but can't get my head around a way of working it back the other way - using a click to trigger a code which then fires the action.

Garan 09-09-2012 05:32 PM

Quote:

Originally Posted by Delone (Post 8150)
Since the original post I've come across Garan's posting on action codes: http://forums.lotro.com/showthread.p...I.Lotro.Action (great stuff from Garan as usual :) ) and have seen a couple of examples of responding to keypresses via codes to get events to fire, but can't get my head around a way of working it back the other way - using a click to trigger a code which then fires the action.

Thanks. Unfortunately, that post is sorely outdated. There are quite a few Action codes that have been added since that post and even more that will be added with RoR. I'll have to get around to updating that post sometime after RoR release.

As to your original question, no, there is no way at present to use a quickslot to fire Actions. The closest thing we can come to that are Aliases such as emotes, etc. since those can be bound to a quickslot.

Delone 09-09-2012 07:39 PM

Quote:

Originally Posted by Garan (Post 8151)
Thanks. Unfortunately, that post is sorely outdated. There are quite a few Action codes that have been added since that post and even more that will be added with RoR. I'll have to get around to updating that post sometime after RoR release.

As to your original question, no, there is no way at present to use a quickslot to fire Actions. The closest thing we can come to that are Aliases such as emotes, etc. since those can be bound to a quickslot.

Thanks for the info Garan, can stop going in circles trying to get this to work now.

Whilst your post I refered to may be outdated, it still has a lot of info that I didn't see anywhere else and was helpful for the exact things I was trying to do :)

As part of my experiments, I was mucking around with pre-defining a quickslot button, using the line

self.TestQS1:SetShortcut( Turbine.UI.Lotro.Shortcut( 6.0, "0x7002E996" ) );

and attempting to use codes directly in combination with changing the type values of "6.0" to see if any of them might happen to pass the code through in a usable form (just blind stabs, but you never know, heh), and worked out that 6.0 was for skills, and 4.0 causes it to be considered an alias and 7.0 seemed to be a pet command shortcut based on the error message (wasn't using a pet class)... is there a listing of what the various types are for these values somewhere?

Edit: 2.0 is an item, 9.0 is a hobby... still testing :)

3.0 gives an odd effect when you mouseover it, with a small white line popping up below and to the right of the quickslot when you place the mouse over it, but, along with 5.0 seems to accept any form of shortcut paired with it without giving an invalid shortcut error - but doesnt display or allow that shortcut to be used.


All times are GMT -5. The time now is 10:47 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI