Posted: 09 Feb 2012 0:09 Post subject: Auto Host Script
Hi guys.
Just in case more of your would like to do your own autohosting.
Here is my latest AutoHotKey script which is running my two servers.
I've been running this with no faults (at least from what I know) for more than a month now.
Go download AutoHotKey: http://www.autohotkey.com/download/
Pick the "Installer for AutoHotKey Basic" (then you get the AutoScriptWriter as well)
Copy this (see below) into notepad - and save it as "AutoHost.ahk".
Create some maps that can be finished within 15 minutes - even by the relatively slow of skippers...
Go to the lobby and press "Windows Key + A"..
Now you're autohosting... (Oh btw... you might have to modify the script slightly to make it work with your screen resolution - read the comments I made in the script - or send me an email if you have any questions)
outspan ¤ live , com
SetKeyDelay 4,4
#a:: ; Shortcut WindowsKey + A
Loop ; Loop
{
; START A RACE
Sleep, 200
MouseClick, left, 10, 450
Sleep, 1500
Send {ESC}
Sleep, 200 ; Sleep 0.2 second
Send {Down} ; Send a key DOWNARROW
Sleep, 200 ; Sleep 0.2 second
Send {Down} ; Send a key DOWNARROW
Sleep, 200 ; Sleep 0.2 second
Send {Down} ; Send a key DOWNARROW
Sleep, 200 ; Sleep 0.2 second
Send {Down} ; Send a key DOWNARROW
Sleep, 200 ; Sleep 0.2 second
Send {Enter} ; Send Enter
Sleep, 200 ; Sleep 0.2 second
Send {Enter} ; Send Enter
Sleep, 25000
Send {Enter}
Sleep, 200
Send -->$f80$sThis is the start. Good wind. Play fair.
Sleep, 200
Send {Enter}
Sleep, 157000 ; Sleep until -2:00 minutes
Sleep, 829000 ; Sleep 10 minutes (+5 for the start) minutes
Send {Enter} ; Tell that we end this game in 3 minutes
Sleep, 200
Send -->$sMore races coming - Loading new map in $f803 $fffminutes
Sleep, 200
Send {Enter}
Sleep, 200
Send {Enter}
Sleep, 200
Send -->$s$f80Find your ranking at $fffhttp:// WWW. OUTSPAN . DK
Sleep, 200
Send {Enter}
Sleep, 200
Send {Enter}
Sleep, 200
Send -->$s$f80Ranking site is updated as soon as ladder points are given
Sleep, 200
Send {Enter}
Sleep, 51000 ; Sleep a minute
Send {Enter}
Send -->$f80$sBE KIND ENOUGH TO GO SPECTATOR NOW
Send {Enter}
Sleep, 1000
Send {Enter}
Send -->$f80$sIF YOU CANT FINISH IN THESE TWO MINUTES
Sleep, 1000
Send {Enter}
Sleep, 51000 ; Sleep a minute
Send {Enter}
Sleep, 200
Send $s$f88In $fff60 seconds $f88you will all be $fffKICKED
Sleep, 200
Send {Enter}
Sleep, 200
Send {Enter}
Sleep, 200
Send $s$f88You can come back in $fff90 seconds
Sleep, 200
Send {Enter}
Sleep, 200
Send {Enter}
Sleep, 200
Send $s$f88This is done to make sure you always collect points!
Sleep, 200
Send {Enter}
Sleep, 25600
Send {Enter}
Sleep, 200
Send $w$sCheck $f00'WWW.OUTSPAN.DK' $ffffor more information
Sleep, 200
Send {Enter}
Sleep, 22000
Send {Enter} ; 15 minutes has passed... lets kick some boats
Sleep, 200
Send $w$s$ff3KICKING PROCESS STARTS - RUNS FOR $f0030 SECONDS
Sleep, 200
Send $w$s$ff3 See you then...
Sleep, 200
Send {Enter}
Sleep, 3000
Send, {ESC}
Sleep, 100
; Here I check to see if ladder points have been given - GOOGLE "PixelSearch AutoHotKey" to find out more
PixelSearch, Px, Py, 571, 205, 630, 547, 0x66A5A8, 3, Fast
if Errorlevel
{
;KICKS 25 times - Be sure to make these fit your screen resolution - use AutoScriptWriter (recorder) to find out where to Click
Loop 25
{
Sleep, 150
MouseMove, 745, 453, 5 ; Move to the "Kick button"
MouseClick ; Click
MouseMove, 598, 250, 5 ; Move to the top most player on the list
MouseClick ; Click
Sleep, 100
Send, {ESC}
}
Posted: 21 Jun 2012 16:28 Post subject: info please :(
hi outspan, thx very much for your autohost key. i have tried but there is a problem when need start and change map. the resolution is 1366x768, i don't understad the problem : ( but don't start a new race.
Posted: 13 Aug 2012 10:29 Post subject: Re: info please :(
spinnaker wrote:
hi outspan, thx very much for your autohost key. i have tried but there is a problem when need start and change map. the resolution is 1366x768, i don't understad the problem : ( but don't start a new race.
Well the problem is you have to determine where the mouse should click when it kicks the users (also where the top - right X - is located)
if you look at:
MouseMove, 745, 453, 5 ; Move to the "Kick button"
MouseClick ; Click
MouseMove, 598, 250, 5 ; Move to the top most player on the list
MouseClick ; Click
The first line should move the cursor to the position of your 'kick button'.
Since you use a different resolution you need to change these numbers to fit your screen res.
You can determine this by using MouseGetPos:
You build this little script... Open the game - go to the "Kick Button" - click it... Alt+Tab to jump out of the game... Here you have an AutoHotKey-window that shows you where you clicked. Then you change the 745, 453 numbers - to what you just found out.
I spend quite some time getting this to work - and every now and then the script dies on me... It varies - sometimes it runs for a month with no problems and then all of a sudden I have it clicking around with VSK minimized and a notepad open and a bunch of other programs... (since the autohotkey scripts continues)
Other times this happens after just a few days of resetting it.
I haven't been able to determine why it does that - so it's something I'll just live with.
Well - I did manage to host well over 17,000 races over the past 10 months - this way. So I guess it isn't all that bad.
Hope you figure out how to hosts this - Perhaps you have a "computer-friend" who can help you do the AutoHotKey script if it's too complicated to figure out.
Posted: 03 Mar 2013 15:23 Post subject: auto-host script for TR and no screen resolution dependance
;
CoordMode Pixel ; Interprets the coordinates below as relative to the screen rather than the active window.
; ----------------------------------------------HELP----------------------------------------------------------
; 1. Download the autohotkey application from the autohotkey official site and install it in your system
; 2. Copy this file in note pad or any text editor; save it with an "ahk" extension in an add hoc repertory
; 3. Doucle-click on the the ahk file to activate it, a green letter "H" would appear in the task bar
; You may right-click on this "H" icon to manage the script, for instance to stop it or to edit it, ...
; 4. After having started VSK, load yours maps in the game
; 5. In the present script, the maps must have 3 minutes prestart and the races last about 10 minutes (1.5 NM)
; 6. You MUST go spectator because the menu composition depends on if you are spectator or not.
; In this last case, the script will not do his job properly
; 7. When in the lobby (waiting the start click of the Host), press "WindowsKey + a" which is launching the script
;
; that is all
;
; the times "nnn" below in the script (sleep nnn) are given in milliseconds
;
; if you want to sail, just host manually, dont use the script ...
;
; jiel, 2013, written from an OUTSPAN original script :
; http://www.virtualskipper.com/forum/viewtopic.php?t=6569&highlight=autohost&sid=000b570b1222fcb2d3b962799a49d87c
;----------------------------------------------End of HELP----------------------------------------------------
#a:: ; Shortcut WindowsKey + a
Loop ; Loop
{
;-----------------------------------------------START A RACE--------------------------------------------------
sleep 10000 ; wait 10 seconds before to start
send {ESC} ; click to get the menu unrolled
sleep 1000
loop, 4
{
send {Down} ; descend the menu items until to light "START"
sleep 200
}
send {Enter} ; click "START"
sleep 1000
send {Enter} ; click "YES"
sleep 10000 ; sleep 10 sec to load the new map
;
;------------------------------------------------The MESSAGES---------------------------------------------------
loop 3
{
sleep 1000
Sleep, 500
Send {Enter}
Sleep 500
Send -->$f80$spress ESC to change the teams: 3 REDS & 3 BLUES
Sleep 500
Send {Enter}
sleep 10000
}
;-------------------------------------------------End of the MESSAGES------------------------------
Sleep 860000 ; sleep 12 minutes
;-------------------------------------------------START A NEW RACE---------------------------------
sleep 1000
Send {ESC}
sleep 1000
loop, 7
{
send {Down} ; descent in the menu until to light the "NEXT MAP" item
sleep 200
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum