*i'm a newbie in AHK*
Hi!
I wanna play roulette in a browser using a simple set of rules:
1. I bet only on black
2. If I win I stick to the amount
3. If I lose I double the amount
(NO NEED TO HELP ME WITH "SLEEP", I WILL DEAL WITH THE SYNCHRONISATION STUFF)
This is how it should work:
1. It clears the amount by pressing a button
2. It introduces the BASIC amount by pressing another button
3. It bets on black
HERE (for later)
4. It moves the mouse in the right side of the result
5. Left click goes down
6. Drags to left
7. Releases the left click
(now the result - red/black/green wins - is selected)
8. Sends Ctrl + C (a.k.a. ^c)
9. Transforms the clipboard into a value
10. Decides if the result is black or not
IF BLACK - retrun to the start (here I have a major problem, it says return is not a command)
IF else than BLACK - doubles the bet and retruns to HERE
THIS IS MY SUPER-NEWBIE, SUPER-MESSY SCRIPT. It works fine until it needs to decide wether it's black or someting else.
The main broblem I guess it's the fact that %here% doesn't work. I dunno how to tell the script to return in a certain place.
https://image.prntscr.com/image/llmGjgF ... Hi-orw.png
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.
Numpad1::
loop
{
Click 368 520 ; clear
sleep 1000
Click 503 522 ; 10
sleep 1000
Click 1482 650 ; bets on black
sleep 15000
%here%
MouseMove, 918, 241 ; right of the result
sleep 250
Click down ; holds down
sleep 250
MouseMove, 643, 239 ; drags to left
sleep 150
Click up ; releases
sleep 250
Send ^c ; result copy
sleep 250
clipboard = %clipboard% ; transforms clipboard into value
sleep 1000
if %clipboard% = WINNER: BLACK {sleep 5000 return %here%} else
{
Click 736 523 ; doubles the bet
sleep 2500
Click 1482 650 ; bets on black
sleep 2500
return
}}
return
$Numpad0:: Pause
Pleeeease help