AutoHotkey Community

It is currently May 26th, 2012, 5:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: April 3rd, 2008, 7:33 pm 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
I'm trying to be able to simulate clicks in the RuneScape applet when it's in the background using the ControlClick function, but I can't seem to get it working. The applet just doesn't detect the mouseclick. Here's the line of code:

Code:
ControlClick, %applet%, %WinTitle%, , , , X%rx% Y%ry%


Where applet is the ClassNN of the applet (SunAwtCanvas3 in this case), WinTitle is RuneScape, and rx,ry are the coordinates of where I want to click.

Does anyone see any problems with this? I've made sure that all of the variables are set correctly. Does ControlClick just not work with Java Applets for some reason?

_________________
All-in-One RuneScape Macro


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 7:36 pm 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
Since noone seems to know, I'm looking at using SendMessage/PostMessage instead, using WM_LBUTTONCLICK. However, the lparam is supposed to be the coordinates of the mouseclick, but I have no idea how to convert the x and y coordinates into a single value. Does anyone know how to do this? I found a couple C++ examples using google, but they use a function called MAKELPARAM, which AHK doesn't use. I assume it uses some combination of bitwise operators, but I don't know for sure...

_________________
All-in-One RuneScape Macro


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 7:51 pm 
Offline

Joined: February 18th, 2008, 8:26 pm
Posts: 442
Java apps don't respond to standard Windows messages like ControlClick/Send.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 8:03 pm 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
So is there another way I should go about doing this? Could I send the clicks to the browser window instead? Or is it just not possible?

Also, after looking at this page, it looks like the MAKELPARAM function simply appends the bits of the LOWORD to the bits of the HIWORD. Can anyone verify if this is correct? If so, then I think I've managed to create my own MAKELPARAM function:

Code:
MAKELPARAM(low,high) {
   result := (((high+1)*0xFFFF) & 0xFFFF0000) + low
   return result
}


EDIT: Also, when I was experimenting the other day, I was able to get keypresses detected by the Java Applet when it was the active window using ControlSend, just not when it was in the background...

_________________
All-in-One RuneScape Macro


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 8:56 pm 
Offline

Joined: February 18th, 2008, 8:26 pm
Posts: 442
I know RuneScape specifically checks if the mouse click is artificial (i.e. done by another program) and whether the applet has focus among other things. Many games use similar techniques to prevent bots. The best way to circumvent this is to run the game in a VM with a script that sends physical Clicks - even this is risky and may get you banned.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 9:38 pm 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
Do you know how exactly it determines whether or not it is artificial? And is there any way to make the applet think that it has focus by sending a certain message or something?

_________________
All-in-One RuneScape Macro


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 9:48 pm 
Offline

Joined: February 18th, 2008, 8:26 pm
Posts: 442
Game detections work on a lower level than system messaging, otherwise they'd be pretty useless. The only way like I said is using physical input like active mouse clicks or maybe even fake HID drivers.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2008, 2:16 am 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
Sounds like it's a lot more complicated than I originally thought. I guess I'll just have to stick to having RuneScape as the active window...

_________________
All-in-One RuneScape Macro


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, mrhobbeys, oldbrother, poserpro, rbrtryn and 71 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group