Search found 659 matches

by Odlanir
24 May 2020, 02:54
Forum: Ask For Help
Topic: Calculating Clicks per Second Topic is solved
Replies: 5
Views: 270

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...
by Odlanir
17 May 2020, 12:29
Forum: Ask For Help
Topic: How to quickly generate random strings? Topic is solved
Replies: 12
Views: 671

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
by Odlanir
08 May 2020, 11:52
Forum: Ask For Help
Topic: Do something after every X loops Topic is solved
Replies: 3
Views: 222

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
}
by Odlanir
26 Apr 2020, 12:40
Forum: Ask For Help
Topic: Spintax random text on key press. Topic is solved
Replies: 3
Views: 361

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...
by Odlanir
26 Apr 2020, 06:03
Forum: Ask For Help
Topic: Jump cursor to line number & column number on Notepad window?
Replies: 1
Views: 195

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...
by Odlanir
26 Apr 2020, 03:40
Forum: Ask For Help
Topic: Get Line and Column numbers of a Notepad window? Topic is solved
Replies: 2
Views: 246

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
by Odlanir
25 Apr 2020, 12:20
Forum: Ask For Help
Topic: Alignment in Edit control Topic is solved
Replies: 2
Views: 247

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
by Odlanir
25 Apr 2020, 05:05
Forum: Ask For Help
Topic: check if key and value exist in array of key:values Topic is solved
Replies: 3
Views: 336

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
}
by Odlanir
21 Apr 2020, 03:05
Forum: Ask For Help
Topic: Send random phrase out of pre-defined list?
Replies: 9
Views: 592

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...
by Odlanir
20 Apr 2020, 08:57
Forum: Ask For Help
Topic: StrSplit and RegExReplace Topic is solved
Replies: 2
Views: 197

Re: StrSplit and RegExReplace Topic is solved

Code: Select all

Title := "AUYIuyt896ytT1 (404) Error"
MsgBox % RegExReplace(Title, ".*\((.*)\).*", "$1")
by Odlanir
20 Apr 2020, 03:06
Forum: Ask For Help
Topic: Lines on GUI's Topic is solved
Replies: 4
Views: 379

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, ...
by Odlanir
19 Apr 2020, 06:23
Forum: Ask For Help
Topic: Send random phrase out of pre-defined list?
Replies: 9
Views: 592

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
by Odlanir
19 Apr 2020, 03:11
Forum: Ask For Help
Topic: I would be very grateful
Replies: 4
Views: 372

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...
by Odlanir
16 Apr 2020, 04:53
Forum: Ask For Help
Topic: simple 2D-array: use variable with removeat() method Topic is solved
Replies: 2
Views: 244

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
by Odlanir
10 Apr 2020, 06:50
Forum: Ask For Help
Topic: Find folder created recently
Replies: 3
Views: 186

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
by Odlanir
08 Apr 2020, 09:07
Forum: Ask For Help
Topic: Autohotkey for Dummies, the most simple tricks
Replies: 6
Views: 437

Re: Autohotkey for Dummies, the most simple tricks

@sholzers Ti ho inviato un Personal Message.
by Odlanir
08 Apr 2020, 03:03
Forum: Ask For Help
Topic: Splitting strings and data read from file
Replies: 8
Views: 389

Re: Splitting strings and data read from file

You can find it here: https://www.autohotkey.com/docs/Objects.htm#Usage_Simple_Arrays
Remove the last item:
RemovedValue := Array.Pop()
EDIT : Too late, gregster already answered.

Go to advanced search