MMOMinion

Full Version: [Request] Simple Pause Function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have absolutely no idea how to program something in LUA but I'm betting my request is pretty simple.

I'm looking for a module that will automatically pause the bot when I HOLD the shift key down and resume the bot when I lift my finger off the shift key.

If nobody is willing to make a module like this, maybe someone could show me where I can get started making something like this?

Thanks
Doing this from lua is trickier than it sounds...you would need to hook every gameloop_update callback and disable it while the shift key is pressed. A solution from the C++ side might be more appropriate. I'll discuss it with the team and see what they think.
(11-10-2013, 05:02 PM)f3re Wrote: [ -> ]Doing this from lua is trickier than it sounds...you would need to hook every gameloop_update callback and disable it while the shift key is pressed. A solution from the C++ side might be more appropriate. I'll discuss it with the team and see what they think.
Why that deep? :P There is an easy way, turn off the bot while shift is pressed and turn on when released Snicker

p.s i'll give it a go now :) If i got it right that's what you are looking for?

Has no GUI.
When you press Shift it will pause, when you release it will start.
Similarly if bot is turned off it will turn on when you press shift and turn off when you release shift.


BEWARE IT CATCHES KEYSTROKES EVEN WHEN YOUR MAIN FOCUS IS NOT FFXIV. Doubt this can be fixed Devil

USE AT YOUR OWN RISK, A POST BELOW EXPLAINS WHY IT MIGHT CAUSE BUGS :)
Turning off the bot only stops the Gameloop.Update handler in ffxiv_task_lua. There's absolutely no requirement that all lua code uses the same update handler function therefore by only stopping one of them you open up the possibility of having severe sync issues and possibly even crashes if one module expects certain data to be available/updated that is no longer valid due to having stopped the update handler that maintains that data.

We're not dummies, we know how this stuff works. If we say something is tricky its because we've considered it long ago and haven't decided on a good, safe implementation of it yet. An easy three minute hack is not the kind of code that we put into the main bot lua without considering all the implications (or at least that should be the ideal we strive for, if sometimes unfortunately fall short of). The reason I suggested the possibility of a solution from the C++ side is that we can simply stop the update loop pulse from being passed to the lua modules completely, which removes the possibility of one module getting updated while another does not. That's the only safe solution that won't lead to addon errors and maintainability problems down the road.

Edit: If that wasn't enough reason not to use this solution, the bot also resets all its data when its toggled on and off. Therefore you're not actually "pausing" it, you're "resetting" it, and there's a good possibility that the bot will not continue the action you were in the middle of when you start again.

Edit Again: Also, you can already do this. It's called "Ctrl-S" and works by default.
(11-11-2013, 12:07 AM)f3re Wrote: [ -> ]Turning off the bot only stops the Gameloop.Update handler in ffxiv_task_lua. There's absolutely no requirement that all lua code uses the same update handler function therefore by only stopping one of them you open up the possibility of having severe sync issues and possibly even crashes if one module expects certain data to be available/updated that is no longer valid due to having stopped the update handler that maintains that data.

We're not dummies, we know how this stuff works. If we say something is tricky its because we've considered it long ago and haven't decided on a good, safe implementation of it yet. An easy three minute hack is not the kind of code that we put into the main bot lua without considering all the implications (or at least that should be the ideal we strive for, if sometimes unfortunately fall short of). The reason I suggested the possibility of a solution from the C++ side is that we can simply stop the update loop pulse from being passed to the lua modules completely, which removes the possibility of one module getting updated while another does not. That's the only safe solution that won't lead to addon errors and maintainability problems down the road.

Edit: If that wasn't enough reason not to use this solution, the bot also resets all its data when its toggled on and off. Therefore you're not actually "pausing" it, you're "resetting" it, and there's a good possibility that the bot will not continue the action you were in the middle of when you start again.

Edit Again: Also, you can already do this. It's called "Ctrl-S" and works by default.
Yeah, but pressing Ctrl-S in a middle of a boss fight or in a middle of doing something important is not great at all :P

I feel stupid now, as I haven't thought about all the stuff you said, even tho I should have :P But yeah a 3 min hack is not something you'd put into the main bot. But i tested it for bout 10 mins and it continues doing what i was(i'm gathering tho nothing complex) :) People can use it at their own risk. And what Ctrl-S does is you have to press it then press again. What i've done is your press it and release it :P
I've tried to write most of the bot logic so that the behavior system will always revert to the appropriate location based on where its at in a task, and for gathering it should be fine. I can't say for certain that it would work for something more complex like fates, but generally if the cne priorities are written properly it should fall into the correct conditional to continue the task. The reason we're so picky about that stuff (and it might seem like we're just being lazy or missing an obvious solution) is that we have to think about the bigger picture all the time, which means making sure that any solution we provide will work with every addon that might be created down the road without crashing (and even in gw2minion we have multiple gameloop.update callbacks running in the main bot lua alone).

If the bot was designed perfectly so that every update pulse always came through the same function and the bot always reverted to the correct stage of its task 100% then your solution would work perfectly. So maybe I should really be scolding myself for not making the system better that you have to work with. Please continue to help with requests and don't take my sour response to indicate that I'm not hugely appreciative of your contributions.
(11-11-2013, 12:32 AM)f3re Wrote: [ -> ]I've tried to write most of the bot logic so that the behavior system will always revert to the appropriate location based on where its at in a task, and for gathering it should be fine. I can't say for certain that it would work for something more complex like fates, but generally if the cne priorities are written properly it should fall into the correct conditional to continue the task. The reason we're so picky about that stuff (and it might seem like we're just being lazy or missing an obvious solution) is that we have to think about the bigger picture all the time, which means making sure that any solution we provide will work with every addon that might be created down the road without crashing (and even in gw2minion we have multiple gameloop.update callbacks running in the main bot lua alone).

If the bot was designed perfectly so that every update pulse always came through the same function and the bot always reverted to the correct stage of its task 100% then your solution would work perfectly. So maybe I should really be scolding myself for not making the system better that you have to work with. Please continue to help with requests and don't take my sour response to indicate that I'm not hugely appreciative of your contributions.
Your response is cool tho, it makes me think about the bigger picture which is great too, although i can't really see it because i simply don't know enough info, at least at this stage Cutesmile
Wow I didn't think I would get so many responses, nor did I think it would be complicated lol. I actually didn't follow most of the explanations but I'd like to thank both of you for taking a look into it for me. I appreciate it.
(11-11-2013, 06:00 AM)OogieBoogie Wrote: [ -> ]Wow I didn't think I would get so many responses, nor did I think it would be complicated lol. I actually didn't follow most of the explanations but I'd like to thank both of you for taking a look into it for me. I appreciate it.

You should probably check out ymko's attachment, it might very well work great for what you're looking for. I may see about doing something on the c++ side in the future.
(11-11-2013, 06:02 AM)f3re Wrote: [ -> ]
(11-11-2013, 06:00 AM)OogieBoogie Wrote: [ -> ]Wow I didn't think I would get so many responses, nor did I think it would be complicated lol. I actually didn't follow most of the explanations but I'd like to thank both of you for taking a look into it for me. I appreciate it.

You should probably check out ymko's attachment, it might very well work great for what you're looking for. I may see about doing something on the c++ side in the future.

Yea I downloaded it to give it a try. Only really needed it for assist mode inside dungeons but I'm sure it will work great (as long as I don't break anything) Cutesmile
Pages: 1 2