Playing roulette in a browser Topic is solved

Ask gaming related questions (AHK v1.1 and older)
JoeHawk
Posts: 6
Joined: 06 Jan 2017, 15:19

Playing roulette in a browser

20 Nov 2017, 12:48

*sorry for my bad english*
*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
NOTE: Numpad0 for emergency

Pleeeease help :)
Last edited by JoeHawk on 20 Nov 2017, 12:58, edited 1 time in total.
JoeHawk
Posts: 6
Joined: 06 Jan 2017, 15:19

Re: Playing roulette in a browser

20 Nov 2017, 12:55

I played a little bit more with it. Seems like the major problem it's the fact that i dunno how to tell the script to return at a certain location.
Image
User avatar
masheen
Posts: 295
Joined: 06 Dec 2016, 14:10

Re: Playing roulette in a browser

21 Nov 2017, 05:57

Code: Select all

MsgBox 1

label1:
MsgBox 2
goto label1 ;if willnot work change it on gosub label1

MsgBox 3
JoeHawk
Posts: 6
Joined: 06 Jan 2017, 15:19

Re: Playing roulette in a browser

21 Nov 2017, 10:15

New code, new problems:

Image

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

{
label0:
Click 368 520                                                  ; clear
sleep 1000

Click 503 522                                                  ; 10
sleep 1000

Click 1482 650                                                 ; bets on black
sleep 15000

label1:

MouseMove, 918, 241                                            ; right of the result
sleep 250

Click down                                                     ; holds down
sleep 250

MouseMove, 643, 239                                            ; drags to left
sleep 250

Click up                                                       ; releases
sleep 250

Send ^c                                                        ; result copy
sleep 1000

clipboard = %clipboard%                                        ; transforms clipboard into value
sleep 1000




if %clipboard% = "WINNER: BLACK" {sleep 4000  goto label0} 
if %clipboard% = "WINNER: RED" goto label5 
if %clipboard% = "WINNER: GREEN" goto label5 
 
label5:
Click 736 523                                                  ; doubles the bet
sleep 2000

Click 1482 650                                                 ; bets on black
sleep 2000

goto label1
}
return

$Numpad0:: Pause



JoeHawk
Posts: 6
Joined: 06 Jan 2017, 15:19

Re: Playing roulette in a browser

21 Nov 2017, 10:21

Tried like this... Same thing... :/ (I went on the wiki and saw that the condition is between "(" and ")"...)
Image
User avatar
masheen
Posts: 295
Joined: 06 Dec 2016, 14:10

Re: Playing roulette in a browser  Topic is solved

22 Nov 2017, 06:27

JoeHawk wrote:Tried like this... Same thing... :/ (I went on the wiki and saw that the condition is between "(" and ")"...)
Image
first, this is superfluous in your code. You can safely remove it.

Code: Select all

clipboard = %clipboard%
then,

Code: Select all

if (clipboard = "WINNER: BLACK"){
	sleep, 4000  
	goto, label0
}else if (clipboard = "WINNER: RED"){
	goto, label5 
}else if (clipboard = "WINNER: GREEN"){
	goto, label5
} 
or

Code: Select all

if ( clipboard = "WINNER: BLACK" ) {
	sleep, 4000  
	goto, label0
} else {
	goto, label5 
} 
User avatar
masheen
Posts: 295
Joined: 06 Dec 2016, 14:10

Re: Playing roulette in a browser

22 Nov 2017, 06:44

Code: Select all

#NoEnv
SendMode Input

Numpad1::
Loop {

	bet:
	Click, 368 520			; clear
	Sleep, 1000
	Click, 503 522			; 10
	Sleep, 1000
	Click, 1482 650			; bets on black
	Sleep, 15000

	result:
	MouseMove, 918, 241		; right of the result
	Sleep, 250
	Click, down				; holds down
	Sleep, 250
	MouseMove, 643, 239		; drags to left
	Sleep, 250
	Click, up				; releases
	Sleep, 250
	Send, ^c				; result copy
	Sleep, 1000
	
	if ( clipboard = "WINNER: BLACK" ) {
		Sleep, 4000  
		Goto, bet
	} else {
		Goto, double
	} 
	
	double:
	Click, 736 523			; doubles the bet
	Sleep, 2000
	Click, 1482 650			; bets on black
	Sleep, 2000
	Goto, result
}
return

$Numpad0:: Pause
or

Code: Select all

#NoEnv
SendMode Input

$Numpad0:: Pause

Numpad1::
Loop {
	Click2(368, 520, 1000)		; clear
	Click2(503, 522, 1000)		; 10
	Click2(1482, 650, 15000)	; bets on black
	MouseMove2(918, 24)			; right of the result
	ClickUD("down")				; holds down
	MouseMove2(643, 239)		; drags to left
	ClickUD("up")				; releases
	
	result:
	Send, ^c					; result copy
	Sleep, 1000
	if ( clipboard = "WINNER: BLACK" ) {
		Sleep, 4000  
	} else {
		Click2(736, 523, 2000)
		Click2(1482, 650, 2000)
		Goto, result
	} 
}
return

Click2(x, y, slp){
	Click, % x " " y
	Sleep, % slp
}

ClickUD(state){
	Click, % state
	Sleep, 250
}

MouseMove2(x, y){
	MouseMove, % x " " y
	Sleep, 250
}
I think it will be work
_
Sorry for my English
JoeHawk
Posts: 6
Joined: 06 Jan 2017, 15:19

Re: Playing roulette in a browser

23 Nov 2017, 19:25

Thanks masheen... Thank you very much. If I become millionaire on CS:GO betting I'll buy you something.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 89 guests