v0.96 - Application not recieving input

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
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.
Post Reply
Message
Author
zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

v0.96 - Application not recieving input

#1 Post by zer0 » Sat Mar 15, 2008 12:19 am

I downloaded and used the latest release, v0.96(?), anyway as you know my script is huge, and is ideal for stress testing MicroMacro. :D
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.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: v0.96 - Application not recieving input

#2 Post by Administrator » Sat Mar 15, 2008 1:46 am

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.

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: v0.96 - Application not recieving input

#3 Post by zer0 » Sat Mar 15, 2008 5:52 am

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. >.<

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: v0.96 - Application not recieving input

#4 Post by Administrator » Sat Mar 15, 2008 10:26 am

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.

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: v0.96 - Application not recieving input

#5 Post by zer0 » Fri Mar 21, 2008 10:51 pm

*deleted*
reason: script code error.

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: v0.96 - Application not recieving input

#6 Post by zer0 » Mon Mar 24, 2008 4:55 am

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?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: v0.96 - Application not recieving input

#7 Post by Administrator » Mon Mar 24, 2008 8:37 am

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?

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: v0.96 - Application not recieving input

#8 Post by zer0 » Mon Mar 24, 2008 8:57 pm

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? :/

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: v0.96 - Application not recieving input

#9 Post by zer0 » Wed Mar 26, 2008 7:11 pm

*post updated*

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: v0.96 - Application not recieving input

#10 Post by Administrator » Wed Mar 26, 2008 7:48 pm

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.

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: v0.96 - Application not recieving input

#11 Post by zer0 » Sat Jun 28, 2008 11:16 am

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.
  1. Right click on taskbar.
  2. select properties.
  3. Un-tick "Show Window previews (thumbnails)"
  4. Click Apply then Ok.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: v0.96 - Application not recieving input

#12 Post by Administrator » Sat Jun 28, 2008 12:45 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests