Help with ahk

Get help with using AutoHotkey and its commands and hotkeys
ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Help with ahk

11 Aug 2018, 20:18

Hi! I am a beginer and i don't know why my ahk is not working totally. It's going through 1 loop and then nothing.. I tried find something on site to solve this but i don't understand all from them. Please help me and sorry for my english.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

Rohwedder
Posts: 1190
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Help with ahk

12 Aug 2018, 03:32

Hallo,
6 Errors: Missing "}"
Try it with a clean indentation!
https://autohotkey.com/docs/Tutorial.htm#s84
Alibaba
Posts: 471
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: Help with ahk

12 Aug 2018, 14:34

Hello ivyandrei, welcome to the forums!
For your future topics, please try to use more specifical titles. “Help with ahk” is a bit too general for an ahk help forum. ;)
"Nothing is quieter than a loaded gun." - Heinrich Heine
ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Re: Help with ahk

12 Aug 2018, 14:48

I modified the script to look better and understand something from it and i solved the problem with the missing "}", but it's not doing what i want. I made this script to play for me at roulette. The site is automatic and it doesn't have a start button so i had to schedule it to wait for the spins. I made him to open my chrome tab and fix the page exactly where i need, then is verifying if the last 3 spins were black and then is waiting for the next spin and if it is black it places bet on red and it it is red, restart the all loop.. If i have more black spins in a row it have to double the bet.. The ahk is only fixing my web page and it's not placing any bet. The "loopifthecolorwillchange" is used where i see what came out this round, i used it because there is coming a black/red/green square with a yellow edge.. Please help me!

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Re: Help with ahk

14 Aug 2018, 13:37

Someone know what is the problem?
User avatar
Xtra
Posts: 1193
Joined: 02 Oct 2015, 12:15

Re: Help with ahk

14 Aug 2018, 14:09

Read here: CoordMode
ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Re: Help with ahk

14 Aug 2018, 18:33

Xtra wrote:Read here: CoordMode

Thank you for your suggestion. That went some way, it's not entering looplast3 where it was supposed to verify if the last three numbers were black and then continue, but it's placing bet after 1 black indifferent if the last 3 are black/red/green.
User avatar
Xtra
Posts: 1193
Joined: 02 Oct 2015, 12:15

Re: Help with ahk

14 Aug 2018, 19:04

Did you set coordmode for mouse and pixel ?

Show your changes.
ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Re: Help with ahk

14 Aug 2018, 20:03

I did not understand everything from there. That's the ahk with the changes. It's skipping the looplast2. There is the problem.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

User avatar
Xtra
Posts: 1193
Joined: 02 Oct 2015, 12:15

Re: Help with ahk

14 Aug 2018, 20:07

Put:
CoordMode, Pixel , Screen
and
CoordMode, Mouse, Screen

At the top of the script and remove all the other coordmode references you added.

Try it and see what happens.
ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Re: Help with ahk

14 Aug 2018, 20:55

I tried and it's doing the same thing. I posted you a photo of the site to see how it looks.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus


https://imgur.com/a/PzId9OO
User avatar
Xtra
Posts: 1193
Joined: 02 Oct 2015, 12:15

Re: Help with ahk

14 Aug 2018, 21:20

When you got all the coords for "everything" you need make sure you used screen coords (aka absolute)

Might be a good time to start using message boxes or tooltips to debug the issue.

Thats about all i can recommend atm.
ivyandrei
Posts: 7
Joined: 11 Aug 2018, 20:10

Re: Help with ahk

14 Aug 2018, 22:00

Xtra wrote:When you got all the coords for "everything" you need make sure you used screen coords (aka absolute)

Might be a good time to start using message boxes or tooltips to debug the issue.

Thats about all i can recommend atm.

Thank you for your help and for your wasted time. I really appreciate that. Maybe the problem is with “CoorMode, pixel, screen”. Should i use “CoordMode, pixel, window”? I used Mpos/Mousecoord or something like this to found the coordinates for the entire ahk.
User avatar
Xtra
Posts: 1193
Joined: 02 Oct 2015, 12:15

Re: Help with ahk

14 Aug 2018, 22:27

Whichever you used to get the coordinates and colors is what you need to use for the CoordMode setting.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot] and 33 guests