Auto type in chat
Auto type in chat
Could someone help me and make me a hotkey that is typing /forage in chat every 5 minutes, I have no clue how this thing works hahaha. Chat is opening on letter T. Thanks.
Re: Auto type in chat
Code: Select all
Loop {
Send {Text}/forage
Sleep, 300000
}
Re: Auto type in chat
Thanks but its not working, nothing is happening when the script is running.
Re: Auto type in chat
This sends to the window that is active at the time. Does it work in Notepad?
Re: Auto type in chat
Yes it works in notepad, but I need it to press T so it opens chat in game, and then type in /forage and press enter.
Re: Auto type in chat
You can add new Send commands wherever you need them, inside or before the loop.
Re: Auto type in chat
Thats why I asked someone to make it for me, because I have no clue how this thing works and how commands work
Re: Auto type in chat
It's easy to learn. See the link that I sent for examples. Another is below. Send sends text to the active window.
Code: Select all
Send {Text}t
Sleep, 900
Loop {
Send /forage{Enter}
Sleep, 300000
}
Re: Auto type in chat
Now its working, thank you alot ill make sure to check it out, got some more hotkeys to make
Re: Auto type in chat
The script is acting weird, its opening other programs and its not putting in the correct command after 1st use, i dont know why is that, ill follow your guide and try to make another one.
Re: Auto type in chat
If a different window is active, then it will send to that window.
This script does what you can also replicate manually (or vice-versa). It is just sending the text to the active window, waiting, and repeating.
It assumes that your target window will remain active. To send to a different (inactive) window, see ControlSend.
The script itself does not open anything, but if you change the active window, it could unexpectedly trigger any number of actions in those other windows.
This script does what you can also replicate manually (or vice-versa). It is just sending the text to the active window, waiting, and repeating.
It assumes that your target window will remain active. To send to a different (inactive) window, see ControlSend.
The script itself does not open anything, but if you change the active window, it could unexpectedly trigger any number of actions in those other windows.
Re: Auto type in chat
I dont know I know how to type in text and enter it but i dont know a command that opens chat, i dont know how to make it press letter T.
-
- Posts: 6
- Joined: 31 Mar 2021, 19:34
Re: Auto type in chat
hey @mikeyww , sorry if it is not ok to @ you but you seem to be the man here.
I am trying to do basically what you are referring to in the above discussion I think but seem to be confusing my self. if possible I would like to start my script, have it select a specific program then type specific keystrokes in that program, press enter, then repeat once a minute. if possible to set a stop time for X Mins later that would be ever better.
here is the coding I was trying but was getting errors due to me not knowing what im doing
[Mod edit: [code][/code] tags added.]
I appreciate any time and effort you spending reading this and or replying, thank you so much in advance <3
I am trying to do basically what you are referring to in the above discussion I think but seem to be confusing my self. if possible I would like to start my script, have it select a specific program then type specific keystrokes in that program, press enter, then repeat once a minute. if possible to set a stop time for X Mins later that would be ever better.
here is the coding I was trying but was getting errors due to me not knowing what im doing
Code: Select all
^`::
if not Discord ("ahk_class Discord")
return
; Otherwise,
ControlSend, ahk_parent, TEXT ;
Loop {ControlSend, ahk_parent, TEXT
Sleep, 60112}
I appreciate any time and effort you spending reading this and or replying, thank you so much in advance <3
Re: Auto type in chat
Code: Select all
wTitle := "ahk_class Discord", control := "ahk_parent"
^`::
If !WinExist(wTitle) {
MsgBox, 48, Error, Window was not found.`n`n%wTitle%
Return
} Else SoundBeep, 1500, 120
ControlSend, %control%, TEXT
Sleep, 900
SetTimer, Go, 60000
SetTimer, Stop, -180000
Go:
ControlSend, %control%, /forage{Enter}, %wTitle%
Return
Stop:
SetTimer, Go, Off
Return
-
- Posts: 6
- Joined: 31 Mar 2021, 19:34
Re: Auto type in chat
thank you so much for that, I was way off!
when I run the script, windows is not finding the discord program. An error pops up saying "window not found. ahk_discord" I'm not too sure how to find the correct file name, I just put ahk_discord in my example because that's what the winamp tutorial said and I don't know better.
.
when I run the script, windows is not finding the discord program. An error pops up saying "window not found. ahk_discord" I'm not too sure how to find the correct file name, I just put ahk_discord in my example because that's what the winamp tutorial said and I don't know better.
.
- Attachments
-
- image.png (4.28 KiB) Viewed 5587 times
Re: Auto type in chat
Window Spy shows the complete window information including the window class. You could try the following, with this control value (ahk_parent), or setting it to null.
Explained: WinTitle
You can also look for a specific control, and use that control name in ControlSend. I found, for example, that a message control had a control name of Intermediate D3D Window1.
Code: Select all
wTitle := "ahk_class Chrome_WidgetWin_1 ahk_exe Discord.exe", control := "ahk_parent"
^`::
If !WinExist(wTitle) {
MsgBox, 48, Error, Window was not found.`n`n%wTitle%
Return
} Else SoundBeep, 1500, 120
ControlSend, %control%, TEXT
Sleep, 900
SetTimer, Go, 60112
SetTimer, Stop, -180000
Go:
ControlSend, %control%, /forage{Enter}, %wTitle%
Return
Stop:
SetTimer, Go, Off
Return
You can also look for a specific control, and use that control name in ControlSend. I found, for example, that a message control had a control name of Intermediate D3D Window1.
-
- Posts: 6
- Joined: 31 Mar 2021, 19:34
Re: Auto type in chat
I didn't think this would be an issue and I feel bad asking so much but...
the text I want to type is :-b but when I run the script it types out ;_b two times and nothing I'm doing is fixing either issue.
the text I want to type is :-b but when I run the script it types out ;_b two times and nothing I'm doing is fixing either issue.
-
- Posts: 6
- Joined: 31 Mar 2021, 19:34
Re: Auto type in chat
Code: Select all
wTitle := "ahk_class Chrome_WidgetWin_1 ahk_exe Discord.exe", control := "ahk_parent"
^`::
If !WinExist(wTitle) {
MsgBox, 48, Error, Window was not found.`n`n%wTitle%
Return
} Else SoundBeep, 1500, 120
ControlSend, %control%, :-b
Sleep, 900
SetTimer, Go, 60112
SetTimer, Stop, -180000
Go:
ControlSend, %control%, ::-b{Enter}, %wTitle%
Return
Stop:
SetTimer, Go, Off
Return
Last edited by gregster on 01 Apr 2021, 12:53, edited 1 time in total.
Reason: [code] tags added. Please use them yourself. Thank you!
Reason: [code] tags added. Please use them yourself. Thank you!
Re: Auto type in chat
Interesting issue-- as Shift is somehow being inserted, presumably as AHK manages that key in sending :. Using {Text} might help you.
Code: Select all
ControlSend, %control%, {Text}::-b, %wTitle%
ControlSend, %control%, {Enter} , %wTitle%