Search found 659 matches

24 May 2020, 02:54
Topic: Calculating Clicks per Second Topic is solved
Replies: 5
Views: 310

Re: Calculating Clicks per Second Topic is solved

Some like this ? Click on gui to see the result. I got a maximum of 5 clicks. Please note that the function takes some milliseconds to execute so the count is approximate. #SingleInstance, force #Persistent SetBatchLines, -1 OnMessage(0x0201, "WM_LBUTTONDOWN") gui, Font,s30 gui, Add, Text, vTx1, 0 g...
17 May 2020, 12:29
Topic: How to quickly generate random strings? Topic is solved
Replies: 12
Views: 760

Re: How to quickly generate random strings? Topic is solved

Code: Select all

``````str := "0123456789abcdefghijklmnopqrstuvwxyz"
s := StrSplit(str str str)
Loop, 4 {
Random, rnd, 1, % s.MaxIndex()
i .= s.removeat(rnd)
}
msgbox % i``````
08 May 2020, 11:52
Topic: Do something after every X loops Topic is solved
Replies: 3
Views: 231

Re: Do something after every X loops Topic is solved

Code: Select all

``````Loop, 100 {
if (Mod(A_Index, 5) = 0)
MsgBox % A_Index
; do something
}``````
26 Apr 2020, 12:40
Topic: Spintax random text on key press. Topic is solved
Replies: 3
Views: 404

Re: Spintax random text on key press. Topic is solved

Or: Var1 := "Hello" Var2 := "{Hi|hallo} i want to talk with you" Var3 := "{Hallooo|Hey} I am availible" Var4 := "Greetings" Var5 := "Bla bla" F1:: Random, OutputVar , 1, 5 Sendraw, % GetRandom(Var%OutputVar%) Return GetRandom(string) { if !InStr(string,"{") return string arr := StrSplit(RegExReplace...
26 Apr 2020, 06:03
Topic: Jump cursor to line number & column number on Notepad window?
Replies: 1
Views: 204

Re: Jump cursor to line number & column number on Notepad window?

JumpInNotepad(7,3) ; row,column ( column is optional ) ExitApp JumpInNotepad(row,col:=1) { ControlGetText,ovar,Edit1,ahk_class Notepad arr := StrSplit(ovar, "`n" , "`r") char := 0 for k, v in arr { if (k < row ) char += StrLen(v) +2 } ControlGet, hCtl, Hwnd,, Edit1, ahk_class Notepad if col > 1 cha...
26 Apr 2020, 03:40
Topic: Get Line and Column numbers of a Notepad window? Topic is solved
Replies: 2
Views: 256

Re: Get Line and Column numbers of a Notepad window? Topic is solved

This works for me in Win10:

Code: Select all

``````StatusBarGetText, StatusText, 2, ahk_class Notepad
MsgBox, % StatusText``````
25 Apr 2020, 12:20
Topic: Alignment in Edit control Topic is solved
Replies: 2
Views: 274

Re: Alignment in Edit control Topic is solved

Code: Select all

``````Gui, Add, Edit, w200 r1 vvEdit hwndEDI
Gui, Show, w230
GuiControl, , vEdit, 000aaaaaaaaaaaaa bbbbbbbbbbbb ccccccccccccccccc dddddddd eeeeeeeeee ffffffffff 9999
SendMessage, 0xB1, -2, -1, , % "ahk_id" EDI ; "0xB1", EM_SETSEL
return
``````
25 Apr 2020, 05:05
Topic: check if key and value exist in array of key:values Topic is solved
Replies: 3
Views: 453

Re: check if key and value exist in array of key:values Topic is solved

Code: Select all

``````for k, v in arr {
if (k = "aaa")
MsgBox % "Key`t" k "`nValue`t" v
}``````
25 Apr 2020, 04:59
Topic: How to: Send Array[integer] Topic is solved
Replies: 6
Views: 472

Re: How to: Send Array[integer] Topic is solved

Code: Select all

``Loop, % max``
21 Apr 2020, 03:05
Topic: Send random phrase out of pre-defined list?
Replies: 9
Views: 609

Re: Send random phrase out of pre-defined list?

From the docs Unless the asterisk option is in effect, you must type an ending character after a hotstring's abbreviation to trigger it. This will fire the Hotstring without an ending char list := StrSplit("Ola!,Bonjour,How are you?",",") :*:Hello:: Random, rnd, 1, % list.Maxindex() send, % list[rn...
20 Apr 2020, 08:57
Topic: StrSplit and RegExReplace Topic is solved
Replies: 2
Views: 204

Re: StrSplit and RegExReplace Topic is solved

Code: Select all

``````Title := "AUYIuyt896ytT1 (404) Error"
MsgBox % RegExReplace(Title, ".*\((.*)\).*", "\$1")
``````
20 Apr 2020, 03:06
Topic: Lines on GUI's Topic is solved
Replies: 4
Views: 386

Re: Lines on GUI's Topic is solved

vert := 0, hor := 1 Gui, +ToolWindow GuiDrawLine(5,5,100,hor) GuiDrawLine(5,5,100,vert) GuiDrawLine(5,100+5,100,hor) GuiDrawLine(100+5,5,100,vert) GuiDrawLine(5,120,120,hor) GuiDrawLine(5,145,120,hor) GuiDrawLine(5,165,120,hor) Gui,Show,h200 w150,GUI Return GuiDrawLine(X,Y,len,VH="1") { if VH Gui, ...
19 Apr 2020, 06:23
Topic: Send random phrase out of pre-defined list?
Replies: 9
Views: 609

Re: Send random phrase out of pre-defined list?

Code: Select all

``````list := StrSplit("Ola!,Bonjour,How are you?",",")
::Hello::
Random, rnd, 1, % list.Maxindex()
send, % list[rnd]
return
``````
19 Apr 2020, 06:19
Topic: Detect Resolution and change coordinates accordingly
Replies: 8
Views: 1702

Re: Detect Resolution and change coordinates accordingly

19 Apr 2020, 03:11
Topic: I would be very grateful
Replies: 4
Views: 375

Re: I would be very grateful

~sc03F:: word01 := " " ;-search word here FileRead, var, C:\Users\computer\Desktop\MyScript.log arr := strsplit(var, "`n", "`r") loop, % ln := arr.length() { currln := arr.Pop() if (instr(currln, word01)) { MsgBox % "The word " word01 " was found at line " Ln-A_Index+1 Break } if (A_Index > 50) { b...
18 Apr 2020, 11:42
Topic: Determing types and numbers of controls on a Gui
Replies: 3
Views: 273

Re: Determing types and numbers of controls on a Gui

16 Apr 2020, 04:53
Topic: simple 2D-array: use variable with removeat() method Topic is solved
Replies: 2
Views: 261

Re: simple 2D-array: use variable with removeat() method Topic is solved

Code: Select all

``````arr := []
arr[1] := [1,2,3,4,5,6,7]
arr[2] := [11,12,13,14,15,16,17]
arr[3] := [21,22,23,24,25,26,27]
Loop 3 {
arr[A_Index].RemoveAt(1)
}
MsgBox % arr[1].1 "`n" arr[2].1 "`n" arr[3].1
``````
10 Apr 2020, 06:50
Topic: Find folder created recently
Replies: 3
Views: 193

Re: Find folder created recently

Code: Select all

``````folder := ComObjCreate("Shell.Application").NameSpace("shell:downloads").self.path
Loop, files, %folder%\Cognos*.*, DR
str .= A_LoopFileTimeCreated "`t" A_LoopFilepath "`n"
sort, str, R
msgbox % str
``````
08 Apr 2020, 09:07
Topic: Autohotkey for Dummies, the most simple tricks
Replies: 6
Views: 459

Re: Autohotkey for Dummies, the most simple tricks

@sholzers Ti ho inviato un Personal Message.
08 Apr 2020, 03:03