Old-Forggen assistance (List of random words/phrases)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dahlete
Posts: 2
Joined: 21 Jun 2021, 16:36

Old-Forggen assistance (List of random words/phrases)

21 Jun 2021, 16:52

Excuse me,

I've been trying to tinker around AHK and its been far to many years ago since i last used this.
I recall making #persistent ForceInstances of sending certain texts every X millisecond, however, I am now trying to assist my kid who has slight reading/memorization problems.

What i am basically looking for, is assistance/pointers in where to look for my troubles due to me wanting to learn this again.

I've made few simple autosend text on a notepad
Like, opening the AHK script, and opening a notepad, and every 1min it writes a new word.

Code: Select all

#Persistant, SendKey, ForceIntance

SendKey:
SetTimer, Send_1, 30.000
SetTimer, Send_2, 60.000
Return

Send_1:
Send, I need assistance in memorization{^a delete}
Return

Send_2:
Send, Could you assist me?{^a delete}
Return

Esc::ExitApp
[Mod edit: [code][/code] tags added.]

Now this is a very basic script i do know. Basically just writing this text, then deletes it before a new text appears.

What is janky, is that I would like to for instance make a list of 900-1500 different lines, and for the script to send a random text of these, so what comes forth is never the same message.
Iknow it sounds weird, but as i said, I am quite interested in learning this to assist my kid, and hopefully he can also learn scripting as a memorization technique after that to learn a system of sorts.

But with this text, i suddenly get the same text over and over every minute and 30 second, which isnt what i want. I sorta want 1 message sent every 2 minutes, but the text changes everytime, and then deletes itself.
I hope someone could point me in the right direction if this makes sense at all.

Yours Sincerely Dahl.
Sally2Q
Posts: 43
Joined: 16 Jun 2021, 10:18

Re: Old-Forggen assistance (List of random words/phrases)

21 Jun 2021, 18:05

Code: Select all

f1::
 FileRead , clipboard, filename ;have all the lines in  file "filename" 
 LinesArray:=Object()
 Loop, parse, clipboard, `n, `r
 LinesArray.push(A_LoopField)
 SetTimer, 120000, RandomLineSend 
 return 
 RandomLineSend :
 WinActivate, Notepad  
 WinWaitActive, Notepad  
 random WhichLine ,1, LinesArray.MaxIndex()
 send % LinesArray[WhichLine] 
 sleep 10000
 send ^a {delete}
 return
[Mod edit: [code][/code] tags added.]
Last edited by gregster on 21 Jun 2021, 19:58, edited 1 time in total.
Reason: Please use [code] tags. Thank you!
Sally2Q
Posts: 43
Joined: 16 Jun 2021, 10:18

Re: Old-Forggen assistance (List of random words/phrases)

21 Jun 2021, 18:11

That's a basic version of what you want. It can certainly be improved on and expanded.
Also, if all you want to do is have the text be seen and read I'd suggest a msgbox or splashtext.
dahlete
Posts: 2
Joined: 21 Jun 2021, 16:36

Re: Old-Forggen assistance (List of random words/phrases)

21 Jun 2021, 18:15

Sally2Q wrote:
21 Jun 2021, 18:05

Code: Select all

f1::
 FileRead , clipboard, filename ;have all the lines in  file "filename" 
 LinesArray:=Object()
 Loop, parse, clipboard, `n, `r
 LinesArray.push(A_LoopField)
 SetTimer, 120000, RandomLineSend 
 return 
 RandomLineSend :
 WinActivate, Notepad  
 WinWaitActive, Notepad  
 random WhichLine ,1, LinesArray.MaxIndex()
 send % LinesArray[WhichLine] 
 sleep 10000
 send ^a {delete}
 return


I really enjoy the assistance with this. So basically its a array i gotta look up then. Much appreciated.
Lets see if i cant get it to work with msg box instead, would simplify it instead of having it run on a notepad.

Also, is there a place in the help file for autohotkey i could also read upon this, to make my knowledge wider?
Sally2Q
Posts: 43
Joined: 16 Jun 2021, 10:18

Re: Old-Forggen assistance (List of random words/phrases)

21 Jun 2021, 20:55

My code as a few different things in it, so for example if it's arrays you want to learn about just google arrays autohotkey. The help files for AHK are very good. Also there are many tutorials on youtube if you need extra help.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, RussF and 375 guests