I need help
I need a script that sends "..." every 40 seconds forever of a web client in the background
F3::
send ...{enter}
Running a script on a browser in the 'background'
-
- Posts: 5
- Joined: 13 May 2016, 05:55
Re: Running a script on a browser in the 'background'
Try this.
Code: Select all
SetTitleMatchMode, 2
SetTimer, F3, 40000
F3::ControlSend, , {. 3}{Enter}, HoloRP
Please excuse my spelling I am dyslexic.
-
- Posts: 5
- Joined: 13 May 2016, 05:55
Re: Running a script on a browser in the 'background'
It didn't work .. it only works when im active at that tab...Capn Odin wrote:Try this.Code: Select all
SetTitleMatchMode, 2 SetTimer, F3, 40000 F3::ControlSend, , {. 3}{Enter}, HoloRP
Re: Running a script on a browser in the 'background'
Code: Select all
SetTitleMatchMode, 2
WinGet, pid, PID, HoloRP
SetTimer, F3, 40000
return
F3:
IfWinNotExist, %pid%
return
postmsg("...", pid)
return
postmsg(text, pid)
{
Loop, Parse, text
{
char:= A_LoopField
char_number := asc(char)
char_hex := char_number
; Convert a decimal integer to hexadecimal:
SetFormat, IntegerFast, hex
char_hex += 0 ; Sets char_number to its hex value.
char_hex .= "" ; Necessary due to the "fast" mode.
SetFormat, IntegerFast, d
wParam := char_hex
PostMessage, 0x0102, %wParam%,,, ahk_pid %pid% ; "0x0102 `;WM_CHAR"
}
ControlSend, , {enter}, ahk_pid %pid%
return
}
-
- Posts: 5
- Joined: 13 May 2016, 05:55
Re: Running a script on a browser in the 'background'
It wont open. i dont see it in system trayameyrick wrote:Code: Select all
SetTitleMatchMode, 2 WinGet, pid, PID, HoloRP SetTimer, F3, 40000 return F3: IfWinNotExist, %pid% return postmsg("...", pid) return postmsg(text, pid) { Loop, Parse, text { char:= A_LoopField char_number := asc(char) char_hex := char_number ; Convert a decimal integer to hexadecimal: SetFormat, IntegerFast, hex char_hex += 0 ; Sets char_number to its hex value. char_hex .= "" ; Necessary due to the "fast" mode. SetFormat, IntegerFast, d wParam := char_hex PostMessage, 0x0102, %wParam%,,, ahk_pid %pid% ; "0x0102 `;WM_CHAR" } ControlSend, , {enter}, ahk_pid %pid% return }
Re: Running a script on a browser in the 'background'
scottmenace wrote:It wont open. i dont see it in system trayameyrick wrote:Code: Select all
SetTitleMatchMode, 2 WinGet, pid, PID, HoloRP SetTimer, F3, 40000 return F3: IfWinNotExist, %pid% return postmsg("...", pid) return postmsg(text, pid) { Loop, Parse, text { char:= A_LoopField char_number := asc(char) char_hex := char_number ; Convert a decimal integer to hexadecimal: SetFormat, IntegerFast, hex char_hex += 0 ; Sets char_number to its hex value. char_hex .= "" ; Necessary due to the "fast" mode. SetFormat, IntegerFast, d wParam := char_hex PostMessage, 0x0102, %wParam%,,, ahk_pid %pid% ; "0x0102 `;WM_CHAR" } ControlSend, , {enter}, ahk_pid %pid% return }
Code: Select all
#Persistent
Re: Running a script on a browser in the 'background'
Here a simple script with "enter":
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTimer, Button_Pressed, 1
return
Button_Pressed:
GetKeyState, state, enter
if state = D
{
loop
{
Send {enter}
Sleep, 10
Send {.}
Sleep, 10
Send {.}
Sleep, 10
Send {.}
Sleep, 10
Send {enter}
Sleep, 10
Sleep, 40000
}
}
else
{
}
return
My shared scripts
Who is online
Users browsing this forum: NexusP and 72 guests