controlclick in the online casino and its failings

Ask gaming related questions (AHK v1.1 and older)
densch
Posts: 120
Joined: 29 May 2018, 15:10

controlclick in the online casino and its failings

Post by densch » 26 Jul 2021, 15:49

Hello,
I am trying to work with controlclick but I seem to be doing something very wrong or it doesnt work as intended I dont know.
the situation:
I have this ahk code:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

a::
    Toggle := !Toggle
     While Toggle{
	Sleep 100
	SetControlDelay -1
	ControlClick,x974 y249,French Roulette im Real-Modus spielen | 5Gringos Casino - Google Chrome,,,,na pos
	Sleep 100
    }
return
and I have chrome browser open, with a single tab that has a casino roulette table open with the above used window title (found that title with window spy).

now I checked controclick working beforehand by msgboxing the errorlevel wich is 0.
but still it didnt click where I wanted it.

I tried the same with a simple click command isntead (no coordinates, jsut clicking wherever the mosue is) and it worked.

however controlclick didnt seem to do the click in the intended place, despite having no obvious error.

now by mere accident I moved the mouse physically over the roulette table.
and weirdly enough my controlclick script above actually periodically does clicks at the mouse position which makes zero sense!

what's even more obscure:
while the clicks are registered when over a number field (like when you click on the "0" to place a chip on that number), the click is registered.
however when using the buttons below, like the one to cycle through the chip sizes and such, it doesnt work.

so first off and weirdly enough isntead of clicking at the given coordinates, it clicks at the current mouse position.
it also activates the window and brings it to the foreground (which is totally opposite to the very reason why I used controlclick. I wanted stuff to work in the background -.-)

and secondly, after a bit of observation, I realized that the number field (where the click is registered) already count the click when the down event is triggered.
which I could also confirm physically, as after pressing down the mouse, the chip was already placed on the field, even before releasing the mosue again.

however the buttons where the clicking doesnt work wait for both the down and up event.
and for some reason, the up event is not registered there properly.
so i can visually see that the button is pressed down but doesnt get released again (or at least it aint recognized as such. which would be needed as only down+up event count as a click there)

long story short the up event of the control click doesnt seem to get recognized there and I dont know why.

any idea what i could do about the mentioned issues?
but the up event issue as well as the fact that controlclickw weirdly acts as if it was the simple click event instead?

gregster
Posts: 8886
Joined: 30 Sep 2013, 06:48

Re: controlclick in the online casino and its failings

Post by gregster » 26 Jul 2021, 16:06

It's probably not clear, if a control delay of -1 is really ideal in this case (see https://www.autohotkey.com/docs/commands/SetControlDelay.htm#Remarks).
Also, you could send separate down and up events with ControlClick (see its options), with a decent sleep in-between. Generally, the game might be looking for a more human-like click.
With this kind of automation, it's often a matter of trial-and-error, until you (perhaps) find good settings for a specific use case.

ControlClicks or -Sends and browsers are usually not a great match, at least in my experience.
Perhaps other browser automation techniques like Chrome.ahk or Acc.ahk could work better in this case, but I have never used them with browser games (and my interest in doing so is limited). Others might have some insights...

densch
Posts: 120
Joined: 29 May 2018, 15:10

Re: controlclick in the online casino and its failings

Post by densch » 27 Jul 2021, 07:46

but how would I achieve such a more human-like click?

I cant exactly control what controlclick does while performing the click :-/

gregster
Posts: 8886
Joined: 30 Sep 2013, 06:48

Re: controlclick in the online casino and its failings

Post by gregster » 27 Jul 2021, 07:55

The click might be too fast. I mentioned a few parameters you can play with, which will effect the way ControlClick will click: try different control delays and separate down and up events with a decent sleep in-between.
But if ControlClick is suited at all for this game, I don't know.

Perhaps, you could run the browser (and the script) instead in a virtual machine, and then use normal Clicks. 🤷‍♂️

Post Reply

Return to “Gaming Help (v1)”