Virtual Skipper Forum Index Virtual Skipper
Virtual Skipper - Official Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto Host Script

 
Post new topic   Reply to topic    Virtual Skipper Forum Index -> Main Forum
View previous topic :: View next topic  
Author Message
Outspan
Matelot


Joined: 26 May 2011
Posts: 61
Location: Denmark

PostPosted: 09 Feb 2012 0:09    Post subject: Auto Host Script Reply with quote

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

Send {Enter}
Sleep, 200
Send {space}
Sleep, 200
Send {Enter}
Sleep, 200

Send {Enter}
Sleep, 200
Send -->$sPenalty cancellation is allowed (FPC)!
Sleep, 200
Send {Enter}
Sleep, 200

Send {Enter}
Sleep, 200
Send -->$sPRESS $f80C $fffto ask for cancel of penalty!
Sleep, 200
Send {Enter}
Sleep, 200

Send {Enter}
Sleep, 200
Send -->$sPRESS $f80Z $fffto accept cancel. PRESS $f80X $fffto deny cancel
Sleep, 200
Send {Enter}
Sleep, 200

Send {Enter}
Sleep, 200
Send -->$s$f80Please cancel $fffONLY $f80wrong penalties!
Sleep, 200
Send {Enter}

Send {Enter}
Sleep, 200
Send {space}
Sleep, 200
Send {Enter}
Sleep, 200

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}
Sleep, 200
Send -->$sMore races coming - Loading new map in $f802 $fffminutes
Sleep, 1000
Send {Enter}
Sleep, 1000


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... Sourire
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}
}

}

Sleep, 300
MouseMove, 1273, 5, 50
Sleep, 300
MouseClick

;END THE GAME

Sleep, 500
MouseMove, 802, 396, 50 ; Click the NEXT RACE button
Sleep, 500
MouseClick
Sleep, 500
Send {ENTER}
Sleep, 10000 ; Sleep 1 second
Send {Enter} ; Send Enter
Sleep, 25000 ; Sleep 30 second

MouseClick, left, 10, 450
Sleep, 100

Send {Enter}
Sleep, 1000
Send -->$s$f80Find your ranking at $fffhttp://WWW.OUTSPAN.DK
Sleep, 1000
Send {Enter}
}
Back to top
View user's profile Send private message
spinnaker
mousse


Joined: 07 Jan 2010
Posts: 2

PostPosted: 21 Jun 2012 16:28    Post subject: info please :( Reply with quote

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.
Back to top
View user's profile Send private message
Outspan
Matelot


Joined: 26 May 2011
Posts: 61
Location: Denmark

PostPosted: 13 Aug 2012 10:29    Post subject: Re: info please :( Reply with quote

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:

http://www.autohotkey.com/docs/commands/MouseGetPos.htm

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.

Good luck
Back to top
View user's profile Send private message
Jean-Luc
Capitaine


Joined: 18 Nov 2006
Posts: 175

PostPosted: 03 Mar 2013 15:23    Post subject: auto-host script for TR and no screen resolution dependance Reply with quote

;
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, 500
Send {Enter}
Sleep 500
Send -->$f80$s3 minutes prestart, around 12 minutes race
Sleep 500
Send {Enter}


Sleep, 500
Send {Enter}
Sleep 500
Send -->$f80$sregister ww.vsk-team.org and submit yours xml result files
Sleep 500
Send {Enter}

sleep 500
Send {Enter}
sleep 500
Send ---
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
}


send {Enter} ; click "NEXT MAP"
sleep 1000
send {Enter} ; click "YES"
sleep 10000 ; gives time to load the map
send {Enter} ; click "OK"
sleep 1000
}
_________________
Jean-Luc
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Virtual Skipper Forum Index -> Main Forum All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

Anti Bot Question MOD - phpBB MOD against Spam Bots
Blocked registrations / posts: 267935 / 0