Code AutoHotKeys to set an AutoHost

Suggestions for the next VSK version (and VSK bug reports)

Code AutoHotKeys to set an AutoHost

Postby jiel » 04 Mar 2020 18:19

#NoEnv
#Warn
#WinActivateForce
SendMode Input
SetWorkingDir %A_ScriptDir%
CoordMode Pixel
; These 6 above lines are advised
; auto-TeamRace 12 minutes

#a:: ; IMPORTANT this comand says that you must press the WindowsKey + a
; on your keyboard to make the program starting.
; PRACTICE :
; Launch VSK, load maps with around 3+12 minutes durations without introduction, go in spectator mode,
; press WindowsKey + a, watch what happens. When AutoHotKeys is working on the VSK menu, you must
; stop to manipulate mouse and keyboard to not interfere during these few seconds (maybe 30 sec).
; Then, you will see the VSK window minimizing so you may work now with mouse and keybord on other affairs.
; Few seconds before the race ends, the VSK windows will maximize. Again, You must let the program working.

; Beware of not being player when the program loads and starts a race in using the VSK menu.
; This is because, unfortunatly, the menu items are not the same when you are playing and when you are spectator.
; Because, you may want to do other things, this program is made with a menu where the host is spectator.
; However, you may manually maximize the VSK window and join the race. Being the host, go spec before t=12 min.
; To end, of course you may modify this program for instance to allow the use of maps with introduction or longer maps ...

;********************************* MAIN LOOP ***********************************************************
Loop ; Its the main "never-ending" Loop
{
sleep, 2000 ; This comand says the system to wait 2000 milliseconds
; You will find many "sleep" in thes program to let the comand to be executed properly
; You may change the waiting among by trial and error
WinActivate, Vsk5 ; put the VSK window in front
sleep, 2000
WinMaximize, Vsk5 ; put the VSK window larger
Sleep, 2000
MouseMove, 0, 100 ; to put the mouse far from the VSK menu? The coordinates x=0 and y=100 work for me
sleep, 2000
;-----------------------------------------------START the RACE-------------------------
send {ESC} ; type ESC to get the menu unrolled
sleep 1000
loop, 4 ; The loop will be done 4 times to reach the "Start" menu item
{
send {Down} ; descend the menu items until to light "START"
sleep 500
}
send {Enter} ; click "START"
sleep 1000
send {Enter} ; click "YES"
sleep,10000 ; 10 sec supposed to let VSK start the race
WinMinimize, Vsk5 ; put the VSK window smaller, so I can work on other buisness
sleep, 2000
;======================
;======================
loop,10
{
; ********************
sleep 88500 ; here the 10 loops make a time for the race be 885 sec, 3 min + prestarting 12 min racing
MouseMove, 0, 100 ; The mouse move is to prevent the screen to go to sleep
; ********************
}
; ====================
;======================
;------------------------------------------------- LOAD A NEW RACE---------------
WinActivate, Vsk5 ; put the VSK window in front
sleep, 2000
WinActivate, Vsk5 ; put the VSK window in front
sleep, 2000
WinMaximize, Vsk5 ; put the VSK window larger
Sleep, 2000
MouseMove, 0, 100 ; to put the mouse far from the menu
Sleep, 1000
Send {Enter} ; Activate the chat box
sleep, 1000 ; Use of the chat box needs these 5 lines
Send $f80 Next race will load now ; Chat in the VSK box. After a while, I noticed that the skippers prefer few chat
Sleep, 1000 ; Moreover, its easier to code and less errors in the run.
Send {Enter} ; Send the sentence and let the chat box going free
sleep, 1000
Send {Enter} ;
sleep, 1000 ;
Send $f80 https://team.vsk-match.com/ ;
Sleep, 1000 ;
Send {Enter} ;
sleep, 1000

Send {ESC} ; Go again in the menu to load the next map
sleep 2000
loop 7
{
send {Down} ; Descent in the menu until to focus the "NEXT MAP" item
sleep 500
}
send {Enter} ; click the "NEXT MAP" item
sleep 1000
send {Enter} ; click "YES"
sleep 4000 ; sleep to load the new map
send {Enter} ; click "OK"
sleep,10000 ; sleep again a little

}
;********************************* End of MAIN LOOP ***********************************************************
jiel
 
Posts: 151
Joined: 10 Mar 2010 17:17

Return to Virtual Skipper Future

Who is online

Users browsing this forum: No registered users and 2 guests

cron