Idea: get info then print-to-screen, not the other way round, silly!
Code: Select all
{
ControlGet, hButton, hwnd,, %BtnName%, ahk_pid %progPID%
ListVars
Sleep, 15 ; limit to ~60 checks per second
}
Code: Select all
{
ControlGet, hButton, hwnd,, %BtnName%, ahk_pid %progPID%
ListVars
Sleep, 15 ; limit to ~60 checks per second
}
Code: Select all
/*
1. Script should wait till a program(notepad editor of windows) opens
2. Script should close notepad window or ending the process (whatever is easier)
3. make sure program has stopped before starting it
4. Script should start a program
5. and there ...
6. it should click "start"
*/
;-------------------------------------------------------------------------------
; variable ; hex value ( use/meaning )
;-------------------------------------------------------------------------------
progPID := 0 ; will hold PID of the program with the wanted button
hButton := 0 ; will toggle between 0 and the handle of the button
;-------------------------------------------------------------------------------
; configure
;-------------------------------------------------------------------------------
progName := "RoS-BoT-714"
program := "C:\Users\D3\Desktop\okok\" progName ".exe"
BtnName := "Start botting !"
;-------------------------------------------------------------------------------
Loop { ; forever
;-------------------------------------------------------------------------------
WinWait, ahk_exe notepad.exe ; (1)
WinClose ; (2)
; make sure program has stopped ; (3)
Process, Exist, %progName%
if ErrorLevel ; there is a problem
{
MsgBox,, Alert!, %ErrorLevel% is the handle of %progName%.exe
ExitApp
}
Run, %program%,,, progPID ; (4)
; where is the button ; (5)
hButton := False ; reset each time
While not hButton ; waiting for button to appear
{
ControlGet, hButton, hwnd,, %BtnName%, ahk_pid %progPID%
ListVars
Sleep, 15 ; limit to ~60 checks per second
}
ControlClick, %hButton% ; (6)
}
;-------------------------------------------------------------------------------
F5:: ExitApp ; emergency hotkey {F5}
;-------------------------------------------------------------------------------
Code: Select all
Start botting!
Code: Select all
Start botting !
Code: Select all
/*
1. Script should wait till a program(notepad editor of windows) opens
2. Script should close notepad window or ending the process (whatever is easier)
3. make sure program has stopped before starting it
4. Script should start a program
5. and there ...
6. it should click "start"
*/
;-------------------------------------------------------------------------------
; variable ; hex value ( use/meaning )
;-------------------------------------------------------------------------------
progPID := 0 ; will hold PID of the program with the wanted button
hButton := 0 ; will toggle between 0 and the handle of the button
;-------------------------------------------------------------------------------
; configure
;-------------------------------------------------------------------------------
program := "charmap.exe"
pathToProgram := "C:\Windows\System32\"
BtnName := "&Select"
;-------------------------------------------------------------------------------
Loop { ; forever
;-------------------------------------------------------------------------------
;~ WinWait, ahk_exe notepad.exe ; (1)
;~ WinClose ; (2)
; make sure program has stopped ; (3)
Process, Exist, %program%
if ErrorLevel ; there is a problem
{
MsgBox,, Alert!, %ErrorLevel% is the handle of %program%
ExitApp
}
Run, %program%, %pathToProgram%,, progPID ; (4)
; where is the button ; (5)
hButton := False ; reset each time
While not hButton ; waiting for button to appear
{
ControlGet, hButton, hwnd,, %BtnName%, ahk_pid %progPID%
Sleep, 15 ; limit to ~60 checks per second
ListVars
}
ControlClick, %hButton% ; (6)
}
;-------------------------------------------------------------------------------
F5:: ExitApp ; emergency hotkey {F5}
;-------------------------------------------------------------------------------
Well I get the same window with the last changeswolf_II wrote:Perfect, same here, make sure you got the last change also. ...
be back with ideas when they come ... classNN ... hmm
that was meant to still work the same.Carl wrote:Well I get the same window with the last changes
Code: Select all
/*
1. Script should wait till a program(notepad editor of windows) opens
2. Script should close notepad window or ending the process (whatever is easier)
3. make sure program has stopped before starting it
4. Script should start a program
5. and there ...
6. it should click "start"
*/
;-------------------------------------------------------------------------------
; variable ; decimal/hex value ( use/meaning )
;-------------------------------------------------------------------------------
progPID := 0 ; will hold PID of the program with the wanted button | decimal
hButton := 0 ; will toggle between 0 and the handle of the button | hex
;-------------------------------------------------------------------------------
; configure
;-------------------------------------------------------------------------------
Program := "charmap.exe"
PathToProgram := "C:\Windows\System32\"
BtnName := "&Select"
;-------------------------------------------------------------------------------
Loop { ; forever
;-------------------------------------------------------------------------------
WinWait, ahk_exe notepad.exe ; (1)
WinClose ; (2)
; make sure program has stopped ; (3)
Process, Exist, %Program%
if ErrorLevel ; there is a problem
{
MsgBox,, Alert!, %ErrorLevel% is the PID of %Program%, 1
WinClose, ahk_pid %ErrorLevel%
Sleep, 1000 ; add a li'l time to look
}
Run, %Program%, %PathToProgram%,, progPID ; (4)
; where is the button ; (5)
hButton := False ; reset each time
while not hButton ; waiting for button to appear
{
ControlGet, hButton, hwnd,, %BtnName%, ahk_pid %progPID%
Sleep, 15 ; limit to ~60 checks per second
}
Sleep, 1000 ; add a li'l time to look
ControlClick,, ahk_id %hButton% ; (6)
}
;-------------------------------------------------------------------------------
F5:: ExitApp ; emergency hotkey {F5}
;-------------------------------------------------------------------------------
Code: Select all
WinKill, ahk_pid %ErrorLevel%
wolf_II wrote:You can try to replace WinClose with WinKill here:Read the Remarks section on the respective commands in the help to see how they differ.Code: Select all
WinKill, ahk_pid %ErrorLevel%
I can't tell what whatever.exe will do and how fast that will happen, so you may have to tweak the sleep or put that whole section (3) of the script in the body of a loop.
Do I get this right? The "original" script is the one where I claim that it works for me ?
Code: Select all
/*
1. Script should wait till a program(notepad editor of windows) opens
2. Script should close notepad window or ending the process (whatever is easier)
3. make sure program has stopped before starting it
4. Script should start a program
5. and there ...
6. it should click "start"
*/
;-------------------------------------------------------------------------------
; variable ; decimal/hex value ( use/meaning )
;-------------------------------------------------------------------------------
progPID := 0 ; will hold PID of the program with the wanted button | decimal
hButton := 0 ; will toggle between 0 and the handle of the button | hex
;-------------------------------------------------------------------------------
; configure
;-------------------------------------------------------------------------------
Program := "RoS-BoT.exe"
PathToProgram := "C:\Users\D3\Desktop\okok"
BtnName := "Start botting !"
;-------------------------------------------------------------------------------
Loop { ; forever
;-------------------------------------------------------------------------------
WinWait, ahk_exe notepad.exe ; (1)
WinClose ; (2)
; make sure program has stopped ; (3)
Process, Exist, %Program%
if ErrorLevel ; there is a problem
{
MsgBox,, Alert!, %ErrorLevel% is the PID of %Program%, 1
WinClose, ahk_pid %ErrorLevel%
Sleep, 1000 ; add a li'l time to look
}
Run, %Program%, %PathToProgram%,, progPID ; (4)
; where is the button ; (5)
hButton := False ; reset each time
while not hButton ; waiting for button to appear
{
ControlGet, hButton, hwnd,, %BtnName%, ahk_pid %progPID%
Sleep, 15 ; limit to ~60 checks per second
}
Sleep, 1000 ; add a li'l time to look
ControlClick,, ahk_id %hButton% ; (6)
}
;-------------------------------------------------------------------------------
F5:: ExitApp ; emergency hotkey {F5}
;-------------------------------------------------------------------------------
Users browsing this forum: No registered users and 118 guests