Search found 557 matches
- 18 May 2018, 09:58
- Forum: Ask For Help
- Topic: How to triggerbot with multiple pixel images under certain condition syntax...
- Replies: 2
- Views: 1004
Re: How to triggerbot with multiple pixel images under certain condition syntax...
My first guess is that your if statements are not blocked correctly. Put the expression in parenthesis and add a { to the end of each, like this: If (Errorlevel = 0) { Then, after the mouse click, add this: }}}}}}}}}}}}}}}}}}
- 18 May 2018, 09:17
- Forum: Wish List
- Topic: Switch/Case statement
- Replies: 14
- Views: 11921
Re: Switch/Case statement
Bumping this because my script is full of ugly walls of if/else and a switch/case implementation would be so much easier to read, not to mention more aesthetically pleasing.
- 17 May 2018, 15:10
- Forum: Wish List
- Topic: (Forum Suggestion) Code Block Links
- Replies: 0
- Views: 912
(Forum Suggestion) Code Block Links
The fact that keywords inside code blocks automatically link to documentation is awesome. However, there's no easy way to link to the documentation on parse/read/file loops. For example, all of the following just link to the basic loop documentation: Loop, Read Loop, Parse Loop, File Would it be pos...
- 17 May 2018, 15:03
- Forum: Ask For Help
- Topic: CSV to fields from another program Topic is solved
- Replies: 4
- Views: 1058
Re: CSV to fields from another program Topic is solved
This should be fairly easy to do with two loops, a file read loop and a CSV parse loop. Here is an example: FileSelectFile, FilePath Loop, Read, %FilePath% { ;Any code that needs to be executed for each line of the CSV file goes here Loop, Parse, A_LoopReadLine, CSV { ;Inside this loop, the variable...
- 17 May 2018, 09:04
- Forum: Ask For Help
- Topic: Run script on program startup, and then turn off script on program shutdown
- Replies: 2
- Views: 747
Re: Run script on program startup, and then turn off script on program shutdown
Alternatively, you could use if statements and #IfWinExist statements to make the script only do anything when the software is running, and then the script can just run all the time.
- 10 May 2018, 09:53
- Forum: Ask For Help
- Topic: Square Bracket In 2-Key Combo Problem
- Replies: 3
- Views: 949
Re: Square Bracket In 2-Key Combo Problem
This line works fine for me:
Is the script not sending anything at all? Also, are you being sure to press [ first and space second?
Code: Select all
[ & space::MsgBox Test
- 04 May 2018, 10:13
- Forum: Ask For Help
- Topic: Stop (not pause) the current thread and start a new thread
- Replies: 4
- Views: 817
Re: Stop (not pause) the current thread and start a new thread
Unfortunately I don't think there's a super clean way to do this, but you can use an if statement to check at each point you might want the thread to terminate, like this: c:: SaveKey = %A_ThisHotkey% sendinput, a sleep, 1000 if (A_ThisHotkey != Savekey) return sendinput, a sleep, 1000 if (A_ThisHot...
- 01 May 2018, 10:00
- Forum: Ask For Help
- Topic: Execute Subroutine on press and not on release
- Replies: 5
- Views: 950
Re: Execute Subroutine on press and not on release
As a sorta janky workaround, you could have a hotkey looking for mouse clicks, then have that hotkey do MouseGetPos to find the control under the mouse and trigger the label based on that. Have the buttons themselves not actually do anything.
- 01 May 2018, 09:32
- Forum: Ask For Help
- Topic: How to get resolution and refresh rate?
- Replies: 2
- Views: 1011
Re: How to get resolution and refresh rate?
I don't know about refresh rate, but A_ScreenWidth and A_ScreenHeight are built in variables that will give you the resolution.
- 27 Apr 2018, 10:14
- Forum: Ask For Help
- Topic: CTRL Key stuck after script
- Replies: 13
- Views: 3816
Re: CTRL Key stuck after script
Sorry if I'm not understanding correctly, but wouldn't that mean that ANY blocking wait, regardless of what it is waiting for, would have that issue?
- 26 Apr 2018, 14:42
- Forum: Ask For Help
- Topic: Array Syntax Topic is solved
- Replies: 3
- Views: 782
Array Syntax Topic is solved
I am so, so bad at array syntax. I can never get to the point that it actually makes sense to me in a way that works consistently. Can someone please tell me what the correct syntax for this is? Col1Array := { 1 : "" }, Col2Array := { 1 : "" }, Col3Array := { 1 : "" }, Col4Array := { 1 : "" }, Col5A...
- 26 Apr 2018, 11:01
- Forum: Ask For Help
- Topic: ahk script to select sql select script Topic is solved
- Replies: 11
- Views: 1927
Re: ahk script to select sql select script Topic is solved
I've been thinking of how to use the regex, and unfortunately I'm coming up blank, at least as far as instantly. You could Ctrl + A, Ctrl + C to select everything, the parse the clipboard for that regex, but I'm not sure where to go from there. Actually, I think there is a script to search the scree...
- 26 Apr 2018, 10:22
- Forum: Ask For Help
- Topic: CTRL Key stuck after script
- Replies: 13
- Views: 3816
Re: CTRL Key stuck after script
Okay, yes, it doesn't work if you are triggering multiple hotkeys simultaneously because of limitations with GetKeyState. In my use case as far as I can tell it works fine because all of my hotkeys are discreet; they never trigger concurrently. I also don't use A_ThisHotKey. That all said, in most c...
- 26 Apr 2018, 10:12
- Forum: Ask For Help
- Topic: ahk script to select sql select script Topic is solved
- Replies: 11
- Views: 1927
Re: ahk script to select sql select script Topic is solved
~^LButton:: Send {Home} ClipText := "" Breaktest:= 0 while (!InStr(SubStr(ClipText, 1, 9), "SELECT")) { Send +{Up} ClipSave := clipboard clipboard := "" Send ^c ClipWait ClipText := clipboard clipboard := ClipSave Breaktest++ if (Breaktest > 50) { MsgBox % "No valid start point found." return } } B...
- 25 Apr 2018, 16:17
- Forum: Ask For Help
- Topic: ahk script to select sql select script Topic is solved
- Replies: 11
- Views: 1927
Re: ahk script to select sql select script Topic is solved
I suspect it is also not finding "GO" for the same reason.
- 25 Apr 2018, 15:07
- Forum: Ask For Help
- Topic: How to make PDF's into images
- Replies: 5
- Views: 1033
Re: How to make PDF's into images
Fair enough, and if I hadn't been totally out of it this morning I actually would have given the same answer as jeeswg; I totally forgot that I use pdftotext in one of my scripts. ^^;;omar wrote:@MaxAstro it's all about being lazy and automating everything - isn't that why you use AHK?
- 25 Apr 2018, 15:04
- Forum: Ask For Help
- Topic: ahk script to select sql select script Topic is solved
- Replies: 11
- Views: 1927
Re: ahk script to select sql select script Topic is solved
If it's highlighting all the way to the top, it's not finding the SELECT; probably because it's not seeing the newline it expects. Try changing "SELECT`r" to "SELECT`n" or even just "SELECT" (although that will have issues if the word SELECT appears anywhere in the block of text.)
- 25 Apr 2018, 11:15
- Forum: Ask For Help
- Topic: I want to scan a given region for the 6 most common colors
- Replies: 9
- Views: 3594
Re: I want to scan a given region for the 6 most common colors
First off, for the love of all that is holy, use GDI+ instead of PixelGetColor, your script will be about a hundred times faster. GDI+ libraries attached. Secondly, what I would probably do is check the color of each pixel in the area one at a time and build an array. Use the color as the key and th...
- 25 Apr 2018, 10:59
- Forum: Ask For Help
- Topic: How to make PDF's into images
- Replies: 5
- Views: 1033
Re: How to make PDF's into images
Forgive me if this isn't what you mean, but can you just use http://pdf2png.com/?
- 25 Apr 2018, 10:56
- Forum: Ask For Help
- Topic: ahk script to select sql select script Topic is solved
- Replies: 11
- Views: 1927
Re: ahk script to select sql select script Topic is solved
So this is a weird and hacky solution, but it might actually work. I am assuming that a) You want to select everything from SELECT to GO, b) the statements you are talking about always begin with SELECT on a line of its own, c) they always end with GO, d) the words "SELECT" and "GO" do not appear al...