Search found 2876 matches

by Exaskryz
01 Dec 2018, 10:39
Forum: Ask For Help
Topic: A_Index fails in Excel COM, manual increment works
Replies: 13
Views: 531

Re: A_Index fails in Excel COM, manual increment works

Jumping on to test in just a moment. Thanks for the idea just me! Edit: Yes, the +0 trick worked. And I did a bit more diagnosis that it only matters that the c:=A_Index is set in the outer loop. If I set it in the inner loop (which I did to test if a 1,1 pair would work), there is no issue. To clar...
by Exaskryz
01 Dec 2018, 02:26
Forum: Ask For Help
Topic: A_Index fails in Excel COM, manual increment works
Replies: 13
Views: 531

Re: A_Index fails in Excel COM, manual increment works

Formatting fixed. It was never an issue of r = 1. It does r++. 1506 times. Then goes back to 0. And repeats that 272 times. To be clear, in both instances, the values of r and c are 1 to produce the 1, 1 pair. The first code continues on to 2, 1 then 3, 1 . The second code, which uses A_Index, insta...
by Exaskryz
30 Nov 2018, 22:58
Forum: Ask For Help
Topic: A_Index fails in Excel COM, manual increment works
Replies: 13
Views: 531

A_Index fails in Excel COM, manual increment works

The code below works ex:=ComObjActive("Excel.Application") Loop % 26*10+12 ; this is columns { c++ Loop 1506 ; this is rows { r++ MsgBox % r "," c formula:=ex.Cells(r, c).formula If StrLen(formula)>80 ex.Cells(r, c).formula:="=IF(A5=""CP""," SubStr(formula,2) ",IF(A5=""Stats Sum"",(INDIRECT(""R"" & ...
by Exaskryz
24 Sep 2018, 17:24
Forum: Ask For Help
Topic: how to tell if a variable is integer? Topic is solved
Replies: 7
Views: 345

Re: how to tell if a variable is integer? Topic is solved

If var is digit Digit does not accept periods (nor commas), so it works in identifying a value as an integer. However, you may want to incorporate it with another check for it to have a value, as otherwise a null value in the variable is also accepted. If !var { MsgBox %var% has no value or is fals...
by Exaskryz
17 Sep 2018, 14:53
Forum: Ask For Help
Topic: [Solved] Sending 2 different action when a key is pressed + when it’s released Topic is solved
Replies: 4
Views: 254

Re: Sending an action when a key is pressed + when a key is released Topic is solved

Bah, I forgot down is not a modifier for hotkeys.

Code: Select all

MButton::SoundSet, 0,, Mute, 2
MButton up::SoundSet, 1,, Mute, 2
by Exaskryz
17 Sep 2018, 12:37
Forum: Ask For Help
Topic: [Solved] Sending 2 different action when a key is pressed + when it’s released Topic is solved
Replies: 4
Views: 254

Re: Sending an action when a key is pressed + when a key is released Topic is solved

MButton can be finicky, but the code should be

Code: Select all

MButton down::SoundSet, 0,, Mute, 2
MButton up::SoundSet, 1,, Mute, 2

If it doesn't work as is, try a different key instead of MButton, just to test it. Then we can come up with a different solution.
by Exaskryz
11 Sep 2018, 20:40
Forum: Ask For Help
Topic: Using IE COM, how can I scroll to bottom of page? Topic is solved
Replies: 4
Views: 272

Re: Using IE COM, how can I scroll to bottom of page? Topic is solved

It's complained about scroll and scrollTo if I omitted window, will start trialing those in any combination I can think of.

Edit: That worked straight away. Thanks!
by Exaskryz
11 Sep 2018, 20:32
Forum: Ask For Help
Topic: Using IE COM, how can I scroll to bottom of page? Topic is solved
Replies: 4
Views: 272

Re: Using IE COM, how can I scroll to bottom of page? Topic is solved

Didn't work: --------------------------- &Test Script.ahk --------------------------- Error: 0x80020006 - Unknown name. Specifically: window Line# 375: { 376: if (ex.Range("N" A_Index).DisplayFormat.Interior.Color != 6249471) 377: Continue 378: if (ex.Range("N" A_Index).value="") 379: Break 381: ie....
by Exaskryz
11 Sep 2018, 17:19
Forum: Ask For Help
Topic: Using IE COM, how can I scroll to bottom of page? Topic is solved
Replies: 4
Views: 272

Using IE COM, how can I scroll to bottom of page? Topic is solved

I could end up focusing the browser window and then using Send {End} , but for curiosity's sake, I'd like to get it done with COM. (It'd be slightly more fluid too, letting me do stuff in the meantime while I wait on webpages to load instead of having to leave it focused.) I've tried stuff like ie.s...
by Exaskryz
07 Sep 2018, 14:56
Forum: Ask For Help
Topic: round to nearest non-zero number
Replies: 5
Views: 306

Re: round to nearest non-zero number

Two improvements. Try in the RegEx method the needle "^0*\K\.0*" . The ^ means we must match the beginning of the string. 0.something will match, but 160.something will not. The 0* also lets .something, with no digits left of decimal match. The \K means all matching characters in pattern to left of ...
by Exaskryz
07 Sep 2018, 08:56
Forum: Ask For Help
Topic: round to nearest non-zero number
Replies: 5
Views: 306

Re: round to nearest non-zero number

There's probably a way more efficient way. But you can identify how many 0s there are by using RegExMatch to extract the string of ".000..." for how many zeroes there are, then use the StrLen command to find how many positions to go. This counts the period in the strlen, but we want that, or else it...
by Exaskryz
30 Aug 2018, 22:05
Forum: Ask For Help
Topic: Loop with increments 1a, 1b, 1c, 2a, 2b, 2c, 3a etc
Replies: 5
Views: 319

Re: Loop with increments 1a, 1b, 1c, 2a, 2b, 2c, 3a etc

There's more than one way to solve this problem. Rather than any loop inside of a loop, here's an answer with a single loop. In a loop, you have the variable A_ Index . We will use this in conjunction with the Ceil () function (Ceil, rounds up) and the Mod () function (Modulus, calculates a remainde...
by Exaskryz
27 Aug 2018, 12:23
Forum: Ask For Help
Topic: If color=green then click x, y. So simple but doesnt work Topic is solved
Replies: 1
Views: 156

Re: If color=green then click x, y. So simple but doesnt work Topic is solved

(Foreword: I have not downloaded "Case Clicker.ahk", just using the reference code you copy and pasted to the forum.) First off, when you find the Target_Color matches Current_Color1, you are making it click at Target_X2 and _Y2, not _X1 and _Y1. May be purposeful, but I otherwise saw a pattern that...
by Exaskryz
02 Aug 2018, 19:41
Forum: Ask For Help
Topic: Binding a key for a Sequence
Replies: 2
Views: 211

Re: Binding a key for a Sequence

This is possible with a counting variable and an If statement. var:=0 ; start this at zero e:: var++ ; increments the variable by 1 If (var=1) Send 1 else if (var=2) Send 2 ; add in 3 and 4, to make sure you understand what is going on else if (var=5) { Send 5 var:=0 ; reset to zero } return You can...
by Exaskryz
26 Jun 2018, 14:39
Forum: Ask For Help
Topic: AHK with 2 programs?
Replies: 3
Views: 246

Re: AHK with 2 programs?

Reading through your post, I think you've got it. As far as I understand the #persitent thingie (does the #persistent make the stuff after it run nonstop?) # Persistent prevents the script from closing when it reaches the auto- execute section. Normally people start out with AHK using a Hotkey , whi...
by Exaskryz
25 Jun 2018, 15:16
Forum: Ask For Help
Topic: AHK with 2 programs?
Replies: 3
Views: 246

Re: AHK with 2 programs?

Here's a template, you will have to change this. Click on any links in the code to look at the documentation. Oh, it's not in the code, but check out CoordMode to make sure your coordinates are right between ImageSearch and Clicks. #Persistent SetTimer, Routine, 30000 ; checks every 30 seconds retur...
by Exaskryz
13 Jun 2018, 16:10
Forum: Forum Issues
Topic: +1 feature on the forum
Replies: 30
Views: 2774

Re: +1 feature on the forum

I would use a +1 at times. It'd be my way of saying "This post is quality", "It helps the user", "It is a great example", "It uses a good technique", etc. without bumping a thread.
by Exaskryz
13 Jun 2018, 16:08
Forum: Ask For Help
Topic: Hotkey
Replies: 4
Views: 267

Re: Hotkey

(Note: The first link is from the old forums, the second link is on these forums) http://www.autohotkey.com/board/topic/6 ... re-thread/ or https://autohotkey.com/boards/viewtopic.php?f=7&t=11952
by Exaskryz
09 Jun 2018, 00:56
Forum: Ask For Help
Topic: help with playing macro only once Topic is solved
Replies: 7
Views: 419

Re: help with playing macro only once Topic is solved

Use Qysh's code, but add KeyWait, \ before the return line. See KeyWait.
by Exaskryz
03 Jun 2018, 13:23
Forum: Ask For Help
Topic: For a simple CTRL+AX, should I make it longer so that AHK will have enough time to process?
Replies: 1
Views: 158

Re: For a simple CTRL+AX, should I make it longer so that AHK will have enough time to process?

It isn't necessarily that AHK needs time to process, but the target program does. AHK can send input to a program too fast for it to handle at times. You can try to avoid interlacing the Sleep, 100 by instead using SetKeyDelay . CTRLDOWN isn't a key, but CTRL is. You can use Send {Ctrl Down} and Sen...

Go to advanced search