| View previous topic :: View next topic |
| Author |
Message |
Stelimar
Joined: 02 Apr 2008 Posts: 13
|
Posted: Thu Apr 03, 2008 7:33 pm Post subject: Control Click with RuneScape Applet |
|
|
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 |
|
| Back to top |
|
 |
Stelimar
Joined: 02 Apr 2008 Posts: 13
|
Posted: Fri Apr 04, 2008 7:36 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Apr 04, 2008 7:51 pm Post subject: |
|
|
| Java apps don't respond to standard Windows messages like ControlClick/Send. |
|
| Back to top |
|
 |
Stelimar
Joined: 02 Apr 2008 Posts: 13
|
Posted: Fri Apr 04, 2008 8:03 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Apr 04, 2008 8:56 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Stelimar
Joined: 02 Apr 2008 Posts: 13
|
Posted: Fri Apr 04, 2008 9:38 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Apr 04, 2008 9:48 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Stelimar
Joined: 02 Apr 2008 Posts: 13
|
Posted: Sat Apr 05, 2008 2:16 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|