v0.96 - Application not recieving input
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
v0.96 - Application not recieving input
I downloaded and used the latest release, v0.96(?), anyway as you know my script is huge, and is ideal for stress testing MicroMacro.
Anyway, when I press F5, the script is executing, but the game (Shaiya) is not receiving any input, I've had to re-start MicroMacro a few times to get it working again.
Anyway, when I press F5, the script is executing, but the game (Shaiya) is not receiving any input, I've had to re-start MicroMacro a few times to get it working again.
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: v0.96 - Application not recieving input
Are you sure? I just tested your script, and although there is a 10 second pause at the beginning of the script where nothing is happening, it does eventually start and it doesn't appear that any input is being lost.
Re: v0.96 - Application not recieving input
hang on, I think I'm jumping the gun again. lol. It's because I have a P2P app running in the background congesting network traffic, which most likely causes it.
Sorry for worrying u with my errors. >.<
Sorry for worrying u with my errors. >.<
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: v0.96 - Application not recieving input
No problem. I'm glad you were able to find your problem. I do suggest that you artificially cap your upload rate for P2P software to 85% of your max upload rate. This not only means it's not causing a traffic jam (for lack of better word), but you will actually maintain a much better connection to peers, and will be able to upload and download more within a timeframe. You need to take packet overhead into account.
Re: v0.96 - Application not recieving input
*deleted*
reason: script code error.
reason: script code error.
Re: v0.96 - Application not recieving input
Sorry, I'm going to have to re-open this issue.
My script code seems to be fine, the application is not receiving input sometimes. Network congestion isn't the problem since manually using the keyboard, the game responds without an issue. Closing MicroMacro and re-launching it seems to correct the issue, it's intermittent, so the issue is very difficult to isolate.
edit: I think I figured out the issue by accident, it looks like the find_window() function is sometimes not returning the correct window, because the get_pixel function are returning unexpected values, when they should have been just black RGB(0,0,0). Would that cause the window not to receive input?
My script code seems to be fine, the application is not receiving input sometimes. Network congestion isn't the problem since manually using the keyboard, the game responds without an issue. Closing MicroMacro and re-launching it seems to correct the issue, it's intermittent, so the issue is very difficult to isolate.
edit: I think I figured out the issue by accident, it looks like the find_window() function is sometimes not returning the correct window, because the get_pixel function are returning unexpected values, when they should have been just black RGB(0,0,0). Would that cause the window not to receive input?
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: v0.96 - Application not recieving input
Well at least we've made some progress, huh?
getPixel() reads from the HDC, not the window. You should not be reopening the HDC or win every round, so I'm not sure why this would happen intermittently. Or do you mean that it sometimes decides not to send any input from the start?
Are you running in an attached state (using attach())? The attached input does not really work with Shaiya (it uses DirectInput, and does not read from the standard Windows input queue), but it will also send the standard (un-attached) keyboard messages if the attached window is on top (in other words, it tries to cover both ends of input sending for compatibility). It could just be a bug in the check to see if the correct window is on top. What happens if you alt-tab back and forth a few times? What happens if you try re-attaching every couple seconds?
getPixel() reads from the HDC, not the window. You should not be reopening the HDC or win every round, so I'm not sure why this would happen intermittently. Or do you mean that it sometimes decides not to send any input from the start?
Are you running in an attached state (using attach())? The attached input does not really work with Shaiya (it uses DirectInput, and does not read from the standard Windows input queue), but it will also send the standard (un-attached) keyboard messages if the attached window is on top (in other words, it tries to cover both ends of input sending for compatibility). It could just be a bug in the check to see if the correct window is on top. What happens if you alt-tab back and forth a few times? What happens if you try re-attaching every couple seconds?
Re: v0.96 - Application not recieving input
I haven't had probs this morning, so I'd put it down to my coding being the issue, again.
I fixed my code to open the hdc only once.
edit: Game wasn't receiving input again, script was running as functions print messages were being displayed. I tried switch game graphics from (16-32 bit), restarting script, restarting micromacro didn't work.
Restarting Shaiya did work, it's really strange...
Could it be attaching the wrong process or something? :/
I fixed my code to open the hdc only once.
edit: Game wasn't receiving input again, script was running as functions print messages were being displayed. I tried switch game graphics from (16-32 bit), restarting script, restarting micromacro didn't work.
Restarting Shaiya did work, it's really strange...
Could it be attaching the wrong process or something? :/
Re: v0.96 - Application not recieving input
*post updated*
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: v0.96 - Application not recieving input
I don't know. It's hard to say. I suppose that it is possible that Shaiya could have already had threads attached to it's input queue and that could interfere, but this would require that you are attaching and improperly closing MicroMacro. I assume this happens after you've closed MicroMacro while the script is running, more often than not. Make sure you always use CTRL+L to reload instead, if this is the case.
I've never had this happen to me before, so I'm not sure what the problem could be. A possible cause is that there is some other always-on-top window interfering (but I doubt this). When calling keyboardPress() in attached mode, a check is made to see if the attached window is on top. If it is, SendInput() is called in combination with PostMessage().
Using attached input doesn't work with Shaiya anyways, so there really is no need to use attach(). Some keyboard functionality has been fixed in 0.96, so using standard keyboard simulation should work just fine.
I've never had this happen to me before, so I'm not sure what the problem could be. A possible cause is that there is some other always-on-top window interfering (but I doubt this). When calling keyboardPress() in attached mode, a check is made to see if the attached window is on top. If it is, SendInput() is called in combination with PostMessage().
Using attached input doesn't work with Shaiya anyways, so there really is no need to use attach(). Some keyboard functionality has been fixed in 0.96, so using standard keyboard simulation should work just fine.
Re: v0.96 - Application not recieving input
Elverion I found out why it was returning an invalid window.
Vista shows windows previews in the task bar, over other windows, that's what the issue was all along.
Disabling Vista's window previewing fixes it.
Vista shows windows previews in the task bar, over other windows, that's what the issue was all along.
Disabling Vista's window previewing fixes it.
- Right click on taskbar.
- select properties.
- Un-tick "Show Window previews (thumbnails)"
- Click Apply then Ok.
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: v0.96 - Application not recieving input
Nice find. I never would have figured that out. I'm sure there is a way to get the full window name (and/or class). If you can find information on that, I can perhaps write a fix that willll prevent MicroMacro from targeting those windows.
Who is online
Users browsing this forum: No registered users and 0 guests