Search found 518 matches

by sinkfaze
15 Mar 2019, 09:14
Forum: Ask For Help
Topic: How to compare time strings? Topic is solved
Replies: 5
Views: 593

Re: How to compare time strings? Topic is solved

if (Round(A_Hour)=0) && (Round(A_Min)<=10)

:?:
by sinkfaze
14 Mar 2019, 14:45
Forum: Ask For Help
Topic: Please make me understand why the behavior of these two arrays is different as shown in these two examples?
Replies: 13
Views: 1349

Re: Please make me understand why the behavior of these two arrays is different as shown in these two examples?

You're not dealing with the same types of objects.

One is an AHK object, the other is an Excel object, they work with for-loops differently.

Code: Select all

Xl := ComObjActive("Excel.Application")
for c in Xl.Range("a1:a11")
	MsgBox % c.Value
by sinkfaze
14 Mar 2019, 14:22
Forum: Ask For Help
Topic: Cant make Excel to autosum by sending hotkeys Topic is solved
Replies: 5
Views: 633

Re: Cant make Excel to autosum by sending hotkeys Topic is solved

It only selects cells with data because that's how the AutoSum feature works, from the cell at which you call to AutoSum, it autoselects the contiguous range of cells with data directly above it to add. If you need one that selects a fixed range, that can probably be done.
by sinkfaze
14 Mar 2019, 13:47
Forum: Ask For Help
Topic: Internet explorer Kisok mode
Replies: 2
Views: 311

Re: Internet explorer Kisok mode

web_browser.theatermode

:?:
by sinkfaze
14 Mar 2019, 13:19
Forum: Ask For Help
Topic: Cant make Excel to autosum by sending hotkeys Topic is solved
Replies: 5
Views: 633

Re: Cant make Excel to autosum by sending hotkeys Topic is solved

This is something that will probably easiest to connect to Excel via COM and give it the information to do it. !SC00D:: <^>!SC00D:: if WinActive("ahk_exe EXCEL.EXE") { xl := ComObjActive("Excel.Application"), c := xl.Selection , c.Formula := "=SUM(" xl.Range(c.Offset(-1,0),c.Offset(-1,0).End(-4162))...
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: 711

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: 188

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: 456

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: 2216

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: 1106

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: 2216

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: 1106

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: 1082

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: 333

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: 593

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: 323

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: 1563

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: 884

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: 884

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: 325

Re: A bit lost regarding toggling Loops

Just out of curiosity, why do you wish to embed this in a function?

Go to advanced search