Search found 513 matches

by sinkfaze
14 Mar 2019, 08:06
Forum: Ask For Help
Topic: Loop each line of string and replace nth character Topic is solved
Replies: 9
Views: 411

Re: Loop each line of string and replace nth character Topic is solved

Make sure to read through the Regular Expressions Quick Reference and the documentation for RegExReplace() for more information. FWIW, my solution, with no subpattern: text = ( 123456 Some text 654321 Some more text 112233 Even more text ) msgbox % text newtext := RegExReplace(text, "`am)^\d{6}\K ",...
by sinkfaze
13 Mar 2019, 15:43
Forum: Ask For Help
Topic: problems with Function
Replies: 2
Views: 124

Re: problems with Function

ahk-antuan wrote:
13 Mar 2019, 15:19
sorry the Add at the end sould be a Test. but that was not the problemsolver.
I corrected this in your post and added code tags.
by sinkfaze
13 Mar 2019, 13:21
Forum: Ask For Help
Topic: Better way of monitoring active window?
Replies: 3
Views: 317

Re: Better way of monitoring active window?

Code: Select all

#Persistent
SetTitleMatchMode, 2

SetTimer, MonitorWindow, 100
return

MonitorWindow:
If	WinActive("Post Payments")
{
	<< Perform the additional tasks while window is active... >>
}
Return
:?:
by sinkfaze
13 Mar 2019, 08:03
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 1537

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

Please accept my apologies DRocks , I had forgotten that key in objects does not operate strictly in expression mode. This should get it: ;-------------------------------------------------------------------------------------------------------------------------------------------------- WM_SETCURSOR(w...
by sinkfaze
12 Mar 2019, 15:26
Forum: Ask For Help
Topic: How to use regexmatch Match.Count()?
Replies: 9
Views: 641

Re: How to use regexmatch Match.Count()?

\v stands for a vertical whitespace character, which includes `r and `n , + stands for "one or more", so \v+ stands for one or more vertical whitespace characters. The "" in the ReplaceWith field is meaningless since we're not saving the modified string, but c is the variable where the count of occ...
by sinkfaze
12 Mar 2019, 14:57
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 1537

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

Also my 2c: If you keep an object around that has the hWNDs as keys you can use: if (objContainingAllhWNDs.hasKey(hWND)) My thoughts exactly: ;-------------------------------------------------------------------------------------------------------------------------------------------------- WM_SETCUR...
by sinkfaze
12 Mar 2019, 12:47
Forum: Ask For Help
Topic: How to use regexmatch Match.Count()?
Replies: 9
Views: 641

Re: How to use regexmatch Match.Count()?

Probably better to use RegExReplace():

Code: Select all

list=
(
the quick
brown fox
jumps over
the
lazy dog
)
RegExReplace(list,"\v+","",c)
MsgBox %	c
by sinkfaze
11 Mar 2019, 15:34
Forum: Ask For Help
Topic: Excel-COM: Creating borders for a defined range of cells? Topic is solved
Replies: 10
Views: 660

Re: Excel-COM: Creating borders for a defined range of cells? Topic is solved

As an aside: rangeArray := ["B3:C6", "E8:F11"] ; List of cell blocks which should be colored (will be completed later) for i in rangeArray ; Cycle through all elements of rangeArray ... If you're going to manipulate a patchwork of ranges in the exact same way, use the Union method : For i, rng in ["...
by sinkfaze
11 Mar 2019, 13:50
Forum: Ask For Help
Topic: Help with PixelSearch Functions
Replies: 2
Views: 239

Re: Help with PixelSearch Functions

r::SetTimer, FindOre, 800 s::SetTimer, CheckStamina, Off FindOre: CoordMode, Pixel, Screen ImageSearch, FoundX, FoundY, 10, 31, 616, 576, *20 C:\Users\Core\Desktop\Server\Untitled.png if ErrorLevel = 0 { SetTimer, FindOre, Off SetTimer, CheckStamina, 300 return } else if ErrorLevel = 1 Send, {Numpa...
by sinkfaze
11 Mar 2019, 12:48
Forum: Ask For Help
Topic: Map Ctrl-Space to LeftAlt-Shift Topic is solved
Replies: 5
Views: 418

Re: Map Ctrl-Space to LeftAlt-Shift Topic is solved

What should be the intended result of hitting this key combination in your end program?
by sinkfaze
11 Mar 2019, 11:52
Forum: Ask For Help
Topic: Illegal Character % Topic is solved
Replies: 2
Views: 216

Re: Illegal Character % Topic is solved

If you're going to use Send in this way you need to add an escape character before the percents, otherwise it will try to read everything between them as a variable, in which case } is an illegal character:

Code: Select all

Send {Text}ugvkjn`%ufuzgi`%jzfzg
removed pw
by sinkfaze
11 Mar 2019, 09:33
Forum: Ask For Help
Topic: Windows 7 to Windows 10: Having to Reload Script
Replies: 15
Views: 975

Re: Windows 7 to Windows 10: Having to Reload Script

I can run those hotstrings on my Windows 10 machine without any issue. Are you running your script as administrator?
by sinkfaze
11 Mar 2019, 09:17
Forum: Ask For Help
Topic: Copy from Excel and Paste Tab Delimited Until Clipboard is Empty? Topic is solved
Replies: 9
Views: 546

Re: Copy from Excel and Paste Tab Delimited Until Clipboard is Empty? Topic is solved

I set F3 to reload the script and it's working great. You could also use F3 to "reset" the array and the counter so you don't have to reload the script. A rewrite with some extra checks: F3:: if IsObject(data) ; if the array already exists, check if it should be overwritten { MsgBox, 52, Array Rese...
by sinkfaze
11 Mar 2019, 07:57
Forum: Ask For Help
Topic: Copy from Excel and Paste Tab Delimited Until Clipboard is Empty? Topic is solved
Replies: 9
Views: 546

Re: Copy from Excel and Paste Tab Delimited Until Clipboard is Empty? Topic is solved

What does this mean please? RegExReplace(Clipboard,"s)\s+$") When you copy data from Excel to the Clipboard, it will leave a trailing newline after you data (and on some rare occasions a tab), which will affect how a parsing loop parses the data. I use RegExReplace() to remove any of that trailing ...
by sinkfaze
08 Mar 2019, 16:06
Forum: Ask For Help
Topic: A bit lost regarding toggling Loops
Replies: 4
Views: 196

Re: A bit lost regarding toggling Loops

Just out of curiosity, why do you wish to embed this in a function?
by sinkfaze
08 Mar 2019, 15:52
Forum: Ask For Help
Topic: Copy from Excel and Paste Tab Delimited Until Clipboard is Empty? Topic is solved
Replies: 9
Views: 546

Re: Copy from Excel and Paste Tab Delimited Until Clipboard is Empty? Topic is solved

Decrementing the contents of the Clipboard is going to be considerably more trouble than it's worth, better to push the contents to an array and send each field when needed. Clipboard := RegExReplace(Clipboard,"s)\s+$") , data := [] , i := 1 Loop, Parse, Clipboard, `n, `r Loop, Parse, A_LoopField, `...
by sinkfaze
08 Mar 2019, 15:03
Forum: Ask For Help
Topic: A bit lost regarding toggling Loops
Replies: 4
Views: 196

Re: A bit lost regarding toggling Loops

A loop like that, generally, is not a good way to run a toggle.

Might I suggest using SetTimer instead?

Code: Select all

F5::
Toggle := !Toggle
SetTimer, SendQ, %	Toggle ? 10 : "Off"
return

SendQ:
Send q
return
by sinkfaze
08 Mar 2019, 14:33
Forum: Forum Issues
Topic: Limited to 3 images?
Replies: 3
Views: 456

Re: Limited to 3 images?

We're having trouble with a malicious spammer who is uploading tens of obscene images in a post, we have taken measures to counteract his ability to spam here, I'm certain that your issue stems from this.
by sinkfaze
07 Mar 2019, 13:06
Forum: Ask For Help
Topic: Windows 7 to Windows 10: Having to Reload Script
Replies: 15
Views: 975

Re: Windows 7 to Windows 10: Having to Reload Script

That's hard for us to determine if we can't see your script, can you share it?
by sinkfaze
07 Mar 2019, 13:04
Forum: General Discussion
Topic: Is AHK dead? (not developed any more)
Replies: 62
Views: 6861

Re: Is AHK dead? (not developed any more)

I have moved this to Offtopic.

Go to advanced search