Page 2 of 3

Re: ArcheAge Anti-idle script

Posted: Mon Oct 13, 2014 2:37 am
by Administrator
That does seem odd. The keypresses seem to work find everywhere else. Care to share your script?

Re: ArcheAge Anti-idle script

Posted: Mon Oct 13, 2014 2:42 am
by Micke
if u set focus on chat input Lisa, MM also only write the first key ? i've seen it can be usefull for debug incoming

Re: ArcheAge Anti-idle script

Posted: Mon Oct 13, 2014 5:23 am
by lisa
I'll do some testing with the chat box but I only tested with the interaction which is by default F.

I did it on my other PC, I will post it later.

My testing of mouse clicks seemed to work ok but you would need to make it search for the plants because people can just give you a push and then the coords would be off and not work anymore, the F key however can harvest the plants as long as they are still within range. Obviously this would be easier if we coulod get coords from the game lol

Re: ArcheAge Anti-idle script

Posted: Mon Oct 13, 2014 9:24 am
by lisa
So I tried with
keyboard.press(key.VK_F);
and
keyboard.virtualPress(win, key.VK_F)

both had the same results when it came to the interaction with "F", I even tried alternating them but same results.
Would do first time and no other UNLESS I physically pressed a key myself between the MM key presses. Being focus and not focus made no difference.

Re: ArcheAge Anti-idle script

Posted: Tue Oct 14, 2014 7:47 pm
by Administrator
I don't think this is related, but I did have a minor issue today with a new script I started working on. It made the press() act like a hold(), and so only was recognizing the first input. The cause was due to async input. Remember, using the press() functions in async mode (default) doesn't cause a rest and release right away, but instead queues up the release for later. As such, it was actually just holding and never really getting around to the release. So, if you are spamming the key fast, before it can release, it might not be generating a full press.

I'm sorry that was explained in such a confusing way, but I'm not really sure how to put it.

Re: ArcheAge Anti-idle script

Posted: Tue Oct 14, 2014 10:52 pm
by lisa
hmm that does make things a clearer with other things I had too.

When I was doing mouse clicks and then moving the mouse it would do the click but then would move the screen just a little, as if mouse button was down when it did the mouse move.

Any way to make it release it straight away (both key and mouse click) or should I just do a rest/pause

On a side note I really miss yrest() function, so many times I just want a 1sec rest before doing something and returning to the main "loop" each time for what I want is silly =(

Re: ArcheAge Anti-idle script

Posted: Tue Oct 14, 2014 11:10 pm
by Administrator
There's two things you can do. You could just not use the asyncronous press (just pass false as the second parameter), which will cause it to press, rest 50ms, then release before continuing. You can also just call hold() and release() right away, which might work (depends on how the game handles input).

system.rest() has superseeded yrest(). It causes the script to pause for that amount of time, but does not do anything with coroutines or threads. It is still advised to avoid it where possible, but the functionality is still there when it is needed.

Re: ArcheAge Anti-idle script

Posted: Wed Oct 15, 2014 2:12 am
by lisa
Ok I worked out a little test so you can see what it is doing, it really is holding down the key.
Place an item in the shortcut bar that can be refined to something else, example potatoes.
Then get MM to do the keypress for the number that the item is in.
You can see the white outer edge square go in smaller and stay there, this only happens when you hold down the key.
So the key press seems to be holding the key down, for archeage anyway.

I will test doing hold and release and using false for second arg and then post my finding, waiting for new crops to finish.


-- false as second arg,
worked for the shortcut key and also harvesting with "F"

So yeah I think it is pretty clear the press is being held down in game and not released unless you physically do something to release it. Like your own key press or I changed windows when it was doing a non virtual press and this also released the key.

I can also confirm doing a release straight after the usual press works fine.

Code: Select all

Command> system.rest(5000) for i = 1,3 do keyboard.press(key.VK_F) keyboard.release(key.VK_F)  print("F pressed") system.rest(12000) end
that was my test, the 5 second at start was just to get focus on game.

So
keyboard.press(key.VK_F,false)
and
keyboard.press(key.VK_F) keyboard.release(key.VK_F)
works

Re: ArcheAge Anti-idle script

Posted: Wed Oct 15, 2014 2:38 am
by Administrator
The async key releases will only be happen directly before the main function is re-called. If you're not using the main loop, that key release would never happen.

Re: ArcheAge Anti-idle script

Posted: Wed Oct 15, 2014 2:55 am
by lisa
so it's working as intended, I was just using it wrong.
I can live with that =)

Re: ArcheAge Anti-idle script

Posted: Wed Oct 15, 2014 8:06 am
by redemption94
Thank you for this script. Do you think on working on a hunting bot also ?

Re: ArcheAge Anti-idle script

Posted: Wed Oct 15, 2014 4:53 pm
by markd
How amazing it would be if we could use the rom createpath in this game for the long trade treks. :) You guys turned me on to this game and I love it. I also want to thank for all the support you gave and still give to rom.

Re: ArcheAge Anti-idle script

Posted: Wed Oct 15, 2014 10:45 pm
by lisa
markd wrote:How amazing it would be if we could use the rom createpath in this game for the long trade treks. :) You guys turned me on to this game and I love it. I also want to thank for all the support you gave and still give to rom.
We would need to get around hackshield to be able to do anything like that.
I have been doing some research and I have tried a few things but nothing that has been successful yet.
Even found a programme that is completely in russian for extracting files from the game, little tricky to work out what buttons do what but it does seem to work atleast.

Re: ArcheAge Anti-idle script

Posted: Thu Oct 16, 2014 4:54 am
by Micke
if there are further russian translation questions e.g. youtube based guids .... ask.

Re: ArcheAge Anti-idle script

Posted: Sat Oct 25, 2014 5:55 pm
by saucy
Hi I have been using your anti-idle script for a good while now and it works great for me. My friends wanted to try it but when they do it just errors out.

The first computer we tried it on complained about something being nil, don't have the exact error for that one.

But the second one:

2014-10-25 18:37:09 : MicroMacro version 1.9.20.275 (Alpha)
2014-10-25 18:37:09 : AMD A10-5800K APU with Radeon(tm) HD Graphics @3800MHz, Windows 7
2014-10-25 18:37:09 : User privilege: Administrator
-------------------------------------------------------------------------------


2014-10-25 18:37:11 : Failed to run init function, err code: 7 (Runtime error)
aaa.lua:12: bad argument #2 to 'printf' (not a non-negative number in proper range)
stack traceback:
[C]: in function 'printf'
aaa.lua:12: in function 'searchForWindow'
aaa.lua:22: in function <aaa.lua:18>
2014-10-25 18:37:21 : Process forcefully terminated (Win32 callback)


Now I was curious because I play the game in directx 9 and have not had any issues. Both my friends default to directx 11, out of curiosity i changed the directx 11 to directx 9 on the second computer, the one with this error and voila it loaded without any issues.


As soon as my other friend logs in I'm going to have him test it again under directx 9 to see if it also loads. I was wondering if there is a simple fix for this issue, as they both want to use this but also play under directx 11.

I got the version, and the two scripts from the links at the top of this forum page.

Re: ArcheAge Anti-idle script

Posted: Sat Oct 25, 2014 8:02 pm
by lisa
I changed mine to Dx11 and tested it and it still worked fine.

The error seems to be about finding the game window, so I doubt testing MM against other programmes would help discover the issue.

I think Admin will have to help you on this 1.

Re: ArcheAge Anti-idle script

Posted: Sun Oct 26, 2014 2:10 am
by saucy
So interesting still on another computer we loaded it, and used the default dx11 and it worked. It seems to just randomly not find the window on some computers.

Also why does it sometimes complain about a sound error? Why does the software care about the soundcard or sound in game at all?

Re: ArcheAge Anti-idle script

Posted: Mon Oct 27, 2014 12:26 am
by lisa
saucy wrote:Also why does it sometimes complain about a sound error? Why does the software care about the soundcard or sound in game at all?
nothing to do with game sound, MM itself uses sounds if told to.

Are they in windowed mode or full screen?
If windowed then check the actual name of the window on the top bar.
If full screen then try minimizing it and seeing name on the task bar.

Re: ArcheAge Anti-idle script

Posted: Tue Oct 28, 2014 5:16 pm
by saucy
lisa wrote:
saucy wrote:Also why does it sometimes complain about a sound error? Why does the software care about the soundcard or sound in game at all?
nothing to do with game sound, MM itself uses sounds if told to.

Are they in windowed mode or full screen?
If windowed then check the actual name of the window on the top bar.
If full screen then try minimizing it and seeing name on the task bar.
The window name is the standard name and it doesn't change from client to client that we can tell. It works perfectly for me. Works on one other machine that I have seen but errors on two others and they are all exactly the same, the only difference is when running in dx11 mode DX11 is added to the window title.

Re: ArcheAge Anti-idle script

Posted: Wed Oct 29, 2014 3:04 am
by Administrator
On the topic of not finding the window, are you (or your friends) running the game first, or MicroMacro and starting the script first? When you say "randomly" does this mean it sometimes works and sometimes doesn't for those same people? Is there any sort of anti-virus or firewall software that could be interfering? Are you running it with administrator privileges?

And, on the topic of a sound error you mentioned, make sure you get an exact copy of the error message next time you see it. Without even knowing what the error is, I couldn't even begin to guess what's wrong.