add GT7-AHKv1.00.13_testGT7-AHKv1.00.13_test - modyfied matrix PanAm
@@ -0,0 +1,493 @@
|
|||||||
|
#NoEnv
|
||||||
|
#MaxHotkeysPerInterval 99000000
|
||||||
|
#HotkeyInterval 99000000
|
||||||
|
#KeyHistory 0
|
||||||
|
#Include Lib\Gdip.ahk
|
||||||
|
#Include Lib\AHK-ViGEm-Bus.ahk
|
||||||
|
#Include Lib\__utility__.ahk
|
||||||
|
#Include Lib\__controller_functions__.ahk
|
||||||
|
#Include Mod\Mods.ahk
|
||||||
|
#Include Race.ahk
|
||||||
|
#Include Menu.ahk
|
||||||
|
|
||||||
|
hModule := DllCall("LoadLibrary", "Str", A_LineFile "\..\Lib\SuperSleep.dll", "Ptr")
|
||||||
|
SuperSleep := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandle", "Str", A_LineFile "\..\Lib\SuperSleep.dll", "Ptr"), "AStr", "super_sleep", "Ptr")
|
||||||
|
|
||||||
|
ListLines Off
|
||||||
|
Process, Priority, , A
|
||||||
|
SetBatchLines, -1
|
||||||
|
SetKeyDelay, -1, -1
|
||||||
|
SetMouseDelay, -1
|
||||||
|
SetDefaultMouseSpeed, 0
|
||||||
|
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||||
|
|
||||||
|
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||||
|
DetectHiddenWindows, On
|
||||||
|
#Persistent
|
||||||
|
|
||||||
|
; --------- Constants
|
||||||
|
; Time at turn in seconds and Stablizing control
|
||||||
|
Global t := 210000
|
||||||
|
Global debug_mode := 0
|
||||||
|
Global remote_play_offsetY := 0
|
||||||
|
Global MenuSelection := 0
|
||||||
|
race_start_delay := 0
|
||||||
|
|
||||||
|
MenuDirect := "Right"
|
||||||
|
Menu_loops := 6
|
||||||
|
menu_s := 1
|
||||||
|
Global color_check1 := 0xBBE044
|
||||||
|
color_check2 := 0xBBE044
|
||||||
|
color_2_delay := 400
|
||||||
|
|
||||||
|
Global box_size := 2
|
||||||
|
Global tolerance := 20
|
||||||
|
|
||||||
|
; resolution parameters and pixel search locations
|
||||||
|
ps_win_width := 640
|
||||||
|
ps_win_height := 360
|
||||||
|
Global pix1x := 458
|
||||||
|
Global pix1y := 114
|
||||||
|
Global pix2x := 607
|
||||||
|
Global pix2y := 319
|
||||||
|
|
||||||
|
bm_delay := 100
|
||||||
|
box_size := 2
|
||||||
|
|
||||||
|
Global ps_load_time1 := 12000
|
||||||
|
Global ps_load_time2 := 6000
|
||||||
|
Global ps_load_time3 := 8400
|
||||||
|
Global SysCheck := 1
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; Variable Save Settings ;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
; Race selection from dropdown list
|
||||||
|
IniRead, RaceChoice, config.ini, Race, RaceChoice
|
||||||
|
; Console Selection in radio group
|
||||||
|
loop, 3{
|
||||||
|
IniRead, SysCheck%A_Index%, config.ini, Vars, SysCheck%A_Index%, 0
|
||||||
|
|
||||||
|
if (SysCheck%A_Index% = 1){
|
||||||
|
|
||||||
|
SysCheck = %A_Index%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gosub, PSystem
|
||||||
|
; Menu color Checks
|
||||||
|
IniRead, color_check1, config.ini, Vars, color_check1, 0xBBE044
|
||||||
|
IniRead, color_check2, config.ini, Vars, color_check2, 0xBBE044
|
||||||
|
IniRead, race_start_delay, config.ini, Vars, race_start_delay, 0
|
||||||
|
IniRead, debug_mode, config.ini, Vars, debug_mode, 0
|
||||||
|
IniRead, color_2_delay, config.ini, Vars, color_2_delay, 300
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; Actual Script Starts Here ;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; Create a new controller controller
|
||||||
|
Global controller := new ViGEmDS4()
|
||||||
|
controller.SubscribeFeedback(Func("OnFeedback"))
|
||||||
|
|
||||||
|
OnFeedback(largeMotor, smallMotor, lightbarColor){
|
||||||
|
;OutputDebug % "AHK| Feedback received - LargeMotor: " largeMotor ", SmallMotor: " smallMotor ", LightBarColor: " lightbarColor
|
||||||
|
}
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; GUI Setups ;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
guicolor1:="000000" ; border
|
||||||
|
guicolor2:="ffffff" ; Title
|
||||||
|
guicolor3:="c282a36" ; body background
|
||||||
|
guicolor4:="c6272a4" ; control color
|
||||||
|
guicolor5:="ce8dfe3" ; body text
|
||||||
|
|
||||||
|
; ---------- Gui 1 Setup -------------
|
||||||
|
; Starting Gui
|
||||||
|
;
|
||||||
|
; -----------------------------------
|
||||||
|
|
||||||
|
Menu, Tray, Icon, Src\gt.ico
|
||||||
|
Menu, Tray, Standard
|
||||||
|
|
||||||
|
Gui, -MaximizeBox
|
||||||
|
Gui, 2: -MaximizeBox
|
||||||
|
Gui, 2: -MinimizeBox
|
||||||
|
Gui, Color, c282a36, c6272a4
|
||||||
|
Gui, Font, Q5 %guicolor4% s8 w550
|
||||||
|
Gui, Add, Button, x15 y10 w70 default, Start
|
||||||
|
Gui, Add, Button, x15 y40 w70 default gVariableWindow, Variables
|
||||||
|
|
||||||
|
Gui, Add, Button, x110 y10 w75 default gModWindow, Mods
|
||||||
|
Gui, Add, DropDownList, w50 Choose1 vMenuDirect, Right|Left
|
||||||
|
Gui, Font, Q5 %guicolor3% s8 w550 Bold
|
||||||
|
Gui, Add, Edit, vMenu_loops w20 x165 y39, 6
|
||||||
|
|
||||||
|
Gui, Font, ce8dfe3 s9 w550 Bold
|
||||||
|
Gui, Add, Radio, Group x15 y75 altsubmit Checked%SysCheck1% gPSystem vSysCheck, PS5
|
||||||
|
Gui, Add, Radio, x70 y75 altsubmit Checked%SysCheck2% gPSystem, PS4
|
||||||
|
Gui, Add, Radio, x125 y75 altsubmit Checked%SysCheck3% gPSystem, PS4 Pro
|
||||||
|
|
||||||
|
|
||||||
|
Gui, Font, Q5 %guicolor4% s8 w550
|
||||||
|
Gui, Add, Button, x15 y100 w70 default gReset, Reset
|
||||||
|
Gui, Add, Button, x110 y100 w75 default gMouseColor, Color Picker
|
||||||
|
Gui, Font, ce8dfe3 s9 w550 Bold
|
||||||
|
loop, Files, % A_ScriptDir "\Races\*.ahk*"
|
||||||
|
{
|
||||||
|
SplitPath, A_LoopFileName,,,, FileName
|
||||||
|
List .= FileName "|"
|
||||||
|
}
|
||||||
|
List := RTrim(List, "|")
|
||||||
|
List := StrReplace(List, RaceChoice "|", RaceChoice "||",, 1) ; make first item default
|
||||||
|
|
||||||
|
Gui, Font, Q5 %guicolor5% s8 w550 Bold
|
||||||
|
Gui, Add, Text, x10 y135, Race :
|
||||||
|
Gui, Add, DropDownList, x65 y130 w120 gSaveRace vRaceChoice, % List
|
||||||
|
Gui, Font, Q5 %guicolor4% s8 w550
|
||||||
|
Gui, Add, Button, default gSettingsSheet, Settings / Tune
|
||||||
|
Gui, Show, w220, GT7 AFK
|
||||||
|
|
||||||
|
;--------- Gui 2 Setup --------------
|
||||||
|
; Variables Gui
|
||||||
|
;
|
||||||
|
; -----------------------------------
|
||||||
|
Gui, 2: Color, c535770, c6272a4
|
||||||
|
Gui, 2: Font, c11f s9
|
||||||
|
|
||||||
|
Gui, 2: Font, Q5 %guicolor5% s8 w550 Bold
|
||||||
|
Gui, 2: Add, Text,, Turn Length (time miliseconds)
|
||||||
|
Gui, 2: Add, Edit, w70 vA, %t%
|
||||||
|
|
||||||
|
Gui, 2: Add, Text,, Race Start Delay
|
||||||
|
Gui, 2: Add, Edit, w40 vB, %race_start_delay%
|
||||||
|
|
||||||
|
Gui, 2: Add, Text,, Color Check 1
|
||||||
|
Gui, 2: Font, Q5 c%color_check1% s8 w550 Bold
|
||||||
|
Gui, 2: Add, Edit, vC, %color_check1%
|
||||||
|
|
||||||
|
Gui, 2: Font, Q5 %guicolor5% s8 w550 Bold
|
||||||
|
Gui, 2: Add, Text,, Color Check 2
|
||||||
|
Gui, 2: Font, Q5 c%color_check2% s8 w550 Bold
|
||||||
|
Gui, 2: Add, Edit, vD, %color_check2%
|
||||||
|
|
||||||
|
Gui, 2: Font, Q5 %guicolor5% s8 w550 Bold
|
||||||
|
Gui, 2: Add, Text, x100 y100, Color 2 Delay
|
||||||
|
Gui, 2: Add, Edit, x100 y120 w40 vE, %color_2_delay%
|
||||||
|
|
||||||
|
Gui, 2: Add, Button, x20 y200 gSaveVars Default, Save
|
||||||
|
Gui, 2: Add, Button, x100 y200 gVarDef, Defaults
|
||||||
|
Gui, 2: Add, Checkbox, x100 y160 Checked%debug_mode% vdebug_mode gDebugging, Debug Mode
|
||||||
|
Gui, 2: Font, c11f s9
|
||||||
|
|
||||||
|
; --------- Gui 3 Setup --------------
|
||||||
|
; Mods Gui
|
||||||
|
;
|
||||||
|
; -----------------------------------
|
||||||
|
|
||||||
|
Gui, 3: -MaximizeBox
|
||||||
|
Gui, 3: -MinimizeBox
|
||||||
|
Gui, 3: Color, c535770, c6272a4
|
||||||
|
Gui, 3: Font, c11f s9
|
||||||
|
Gui, 3: Font, Q5 %guicolor5% s8 w550 Bold
|
||||||
|
; Load mod settings
|
||||||
|
Loop, Parse, _mod_vars, |
|
||||||
|
{
|
||||||
|
IniRead, %A_LoopField%, config.ini, Mods, %A_LoopField%, 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Loop, Parse, _mod_vars, |
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( %A_LoopField% = 1){
|
||||||
|
Gui, 3: Add, Checkbox, Checked v%A_LoopField%, % _mod_names[A_Index]
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Gui, 3: Add, Checkbox, v%A_LoopField%, % _mod_names[A_Index]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Gui, 3: Add, Button, gSaveMods, Save
|
||||||
|
Gui, 3: Font, c11f s9
|
||||||
|
|
||||||
|
; End of Gui Setup
|
||||||
|
;--------- Gui 4 Setup --------------
|
||||||
|
; Settings/Tunings Gui
|
||||||
|
;
|
||||||
|
; -----------------------------------
|
||||||
|
|
||||||
|
Gui, 4: -dpiscale
|
||||||
|
Gui, 4: +resize
|
||||||
|
Gui, 4: Font, Q5 %guicolor4% s8 w550 Bold
|
||||||
|
Gui, 4: Add, Button, x10 y10 gAssists1, Assists 1
|
||||||
|
Gui, 4: Add, Button, x85 y10 gAssists2, Assists 2
|
||||||
|
Gui, 4: Add, Button, x155 y10 gTune1, Tuning
|
||||||
|
Gui, 4: Add, Button, x215 y10 gTune2, Gears
|
||||||
|
Gui, 4: Add, Button, x270 y10 gControllerSetting, Controller
|
||||||
|
Gui, 4: Add, Picture, w800 h-1 vCurrentPic
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; GUI Functions ;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
/*
|
||||||
|
These are subroutines used by the interaction with GUIs
|
||||||
|
|
||||||
|
Some functions may be located in Mod files
|
||||||
|
*/
|
||||||
|
|
||||||
|
MenuTest:
|
||||||
|
gosub, GrabRemotePlay
|
||||||
|
Gui, Submit, NoHide
|
||||||
|
loop, %menu_loops% {
|
||||||
|
controller.Dpad.SetState(MenuDirect)
|
||||||
|
Sleep, 125
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
GetColo_p:
|
||||||
|
gosub, GrabRemotePlay
|
||||||
|
color_check1 := PixelColorSimple(pix1x, pix1y)
|
||||||
|
return
|
||||||
|
|
||||||
|
GetColo_g:
|
||||||
|
gosub, GrabRemotePlay
|
||||||
|
color_check2 := PixelColorSimple(pix2x, pix2y)
|
||||||
|
return
|
||||||
|
|
||||||
|
Debugging:
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
VariableWindow:
|
||||||
|
Gui, 2: Show, AutoSize, Variables
|
||||||
|
return
|
||||||
|
|
||||||
|
ModWindow:
|
||||||
|
Gui, 3: Show, AutoSize, Mod List
|
||||||
|
return
|
||||||
|
|
||||||
|
SaveRace:
|
||||||
|
Gui, Submit, NoHide
|
||||||
|
IniWrite, %RaceChoice%, config.ini, Race, RaceChoice
|
||||||
|
return
|
||||||
|
|
||||||
|
SaveVars:
|
||||||
|
Gui, 2:Submit, NoHide
|
||||||
|
GuiControlGet, t, 2:, A
|
||||||
|
GuiControlGet, race_start_delay, 2:, B
|
||||||
|
GuiControlGet, color_check1, 2:, C
|
||||||
|
GuiControlGet, color_check2, 2:, D
|
||||||
|
GuiControlGet, color_2_delay, 2:, E
|
||||||
|
|
||||||
|
Gui, 2: Font, Q5 c%color_check1% s8 w550 Bold
|
||||||
|
GuiControl, 2: Font, C
|
||||||
|
Gui, 2: Font, Q5 c%color_check2% s8 w550 Bold
|
||||||
|
GuiControl, 2: Font, D
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
SaveToIni:
|
||||||
|
; System
|
||||||
|
loop, 3{
|
||||||
|
|
||||||
|
if( SysCheck = A_Index){
|
||||||
|
IniWrite, 1, config.ini, Vars, SysCheck%A_Index%
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
IniWrite, 0, config.ini, Vars, SysCheck%A_Index%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
; Color Check
|
||||||
|
; Can't find a way to change colors
|
||||||
|
IniWrite %color_check1%, config.ini, Vars, color_check1
|
||||||
|
IniWrite %color_check2%, config.ini, Vars, color_check2
|
||||||
|
IniWrite %race_start_delay%, config.ini, Vars, race_start_delay
|
||||||
|
IniWrite, %debug_mode%, config.ini, Vars, debug_mode
|
||||||
|
IniWrite, %color_2_delay%, config.ini, Vars, color_2_delay
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
VarDef:
|
||||||
|
t := 210000
|
||||||
|
race_start_delay := 0
|
||||||
|
color_2_delay := 400
|
||||||
|
GuiControl, 2:, A, %t%
|
||||||
|
GuiControl, 2:, B, %race_start_delay%
|
||||||
|
GuiControl, 2:, C, 0xBBE044
|
||||||
|
GuiControl, 2:, D, 0xBBE044
|
||||||
|
GuiControl, 2:, E, 300
|
||||||
|
return
|
||||||
|
|
||||||
|
ButtonStart:
|
||||||
|
Gui, Submit, NoHide
|
||||||
|
id := ""
|
||||||
|
SetKeyDelay, 10
|
||||||
|
Process, priority, , High
|
||||||
|
gosub, GrabRemotePlay
|
||||||
|
if (id = "")
|
||||||
|
return
|
||||||
|
gosub, PauseLoop
|
||||||
|
CoordMode, Pixel, Screen
|
||||||
|
CoordMode, ToolTip, Screen
|
||||||
|
sleep 1000
|
||||||
|
gosub, AFKLoop
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
; ---------- Gui Setup End-------------
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; Actual Race Loop ;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
AFKLoop:
|
||||||
|
loop{
|
||||||
|
Press_X()
|
||||||
|
Sleep(race_start_delay)
|
||||||
|
gosub, Race
|
||||||
|
gosub, Menu
|
||||||
|
SetFormat, IntegerFast, d
|
||||||
|
ToolTip, %A_Index% Races completed ٩(^ ᴗ ^)۶, 100, 100, Screen
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
;; General Functions for AHK
|
||||||
|
|
||||||
|
PixelTuning:
|
||||||
|
x_ratio := ps_win_width/640
|
||||||
|
y_ratio := ps_win_height/360
|
||||||
|
; pix1x := Floor(pix1x*x_ratio)
|
||||||
|
; pix1y := Floor(pix1y*y_ratio)
|
||||||
|
; pix2x := Floor(pix2x*x_ratio)
|
||||||
|
; pix2y := Floor(pix2y*y_ratio)
|
||||||
|
; tyreX := Floor(tyreX*x_ratio)
|
||||||
|
; tyreY := Floor(tyreY*y_ratio)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
GrabRemotePlay:
|
||||||
|
WinGet, remotePlay_id, List, ahk_exe RemotePlay.exe
|
||||||
|
if (remotePlay_id = 0)
|
||||||
|
{
|
||||||
|
MsgBox, PS4 Remote Play not found
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Loop, %remotePlay_id%
|
||||||
|
{
|
||||||
|
id := remotePlay_id%A_Index%
|
||||||
|
WinGetTitle, title, % "ahk_id " id
|
||||||
|
If InStr(title, "PS Remote Play")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
WinGetClass, remotePlay_class, ahk_id %id%
|
||||||
|
if(__enableRemotePlaySizer_mod__ = 1){
|
||||||
|
gosub, RemotePlay_ChangeSize
|
||||||
|
WinMove, ahk_id %id%,, 0, 0, 640, 540
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
WinMove, ahk_id %id%,, 0, 0, 640, 360
|
||||||
|
}
|
||||||
|
ControlFocus,, ahk_class %remotePlay_class%
|
||||||
|
WinActivate, ahk_id %id%
|
||||||
|
GetClientSize(remotePlay_id5, ps_win_width, ps_win_height)
|
||||||
|
gosub, PixelTuning
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
PSystem:
|
||||||
|
Gui, Submit, NoHide
|
||||||
|
if (SysCheck = 1){
|
||||||
|
ps_load_time1 := 12000
|
||||||
|
ps_load_time2 := 6000
|
||||||
|
ps_load_time3 := 8400
|
||||||
|
}
|
||||||
|
if (SysCheck = 2){
|
||||||
|
ps_load_time1 := 44000
|
||||||
|
ps_load_time2 := 12000
|
||||||
|
ps_load_time3 := 37000
|
||||||
|
}
|
||||||
|
if (SysCheck = 3){
|
||||||
|
ps_load_time1 := 37000
|
||||||
|
ps_load_time2 := 12000
|
||||||
|
ps_load_time3 := 32000
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
Reset:
|
||||||
|
gosub, PauseLoop
|
||||||
|
gosub, SaveToIni
|
||||||
|
Reload
|
||||||
|
Sleep 1000
|
||||||
|
return
|
||||||
|
|
||||||
|
PauseLoop:
|
||||||
|
controller.Buttons.Cross.SetState(false)
|
||||||
|
controller.Buttons.Square.SetState(false)
|
||||||
|
controller.Buttons.Triangle.SetState(false)
|
||||||
|
controller.Buttons.Circle.SetState(false)
|
||||||
|
|
||||||
|
controller.Buttons.L1.SetState(false)
|
||||||
|
controller.Buttons.L2.SetState(false)
|
||||||
|
controller.Axes.L2.SetState(0)
|
||||||
|
controller.Buttons.R1.SetState(false)
|
||||||
|
controller.Buttons.R2.SetState(false)
|
||||||
|
controller.Axes.R2.SetState(0)
|
||||||
|
|
||||||
|
controller.Buttons.RS.SetState(false)
|
||||||
|
controller.Axes.RX.SetState(50)
|
||||||
|
controller.Axes.RY.SetState(50)
|
||||||
|
|
||||||
|
controller.Buttons.LS.SetState(false)
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
controller.Axes.LY.SetState(50)
|
||||||
|
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
MouseHelp:
|
||||||
|
|
||||||
|
coord=relative
|
||||||
|
sleep, 1000
|
||||||
|
CoordMode, ToolTip, %coord%
|
||||||
|
CoordMode, Pixel, %coord%
|
||||||
|
CoordMode, Mouse, %coord%
|
||||||
|
CoordMode, Caret, %coord%
|
||||||
|
CoordMode, Menu, %coord%
|
||||||
|
return
|
||||||
|
|
||||||
|
Refresh:
|
||||||
|
MouseGetPos, x, y
|
||||||
|
PixelGetColor, cBGR, %x%, %y%,, Alt RGB
|
||||||
|
WinGetPos,,, w, h, A
|
||||||
|
ToolTip,Location: %x% x %y%`nRGB: %cBGR%`nWindow Size: %w% x %h%
|
||||||
|
return
|
||||||
|
|
||||||
|
MouseColor:
|
||||||
|
gosub, MouseHelp
|
||||||
|
SetTimer, Refresh, 75
|
||||||
|
return
|
||||||
|
|
||||||
|
GuiClose:
|
||||||
|
gosub, PauseLoop
|
||||||
|
gosub, SaveToIni
|
||||||
|
ExitApp
|
||||||
|
^Esc::ExitApp
|
||||||
|
|
||||||
|
/*
|
||||||
|
Pink RUF color"
|
||||||
|
which is the standart first one to buy if you want to buy car manufactur color (for me german GT7 i think its same for everyone)
|
||||||
|
0xFA559F
|
||||||
|
|
||||||
|
i have put that into Color check 1 and 2 works since 5 cycles - so maybe put them in with like (not tested)
|
||||||
|
(i think the first option that gets shown to buy a new color is the easiest to explain for people to buy except for colors the car exists in anyways (venom green)
|
||||||
|
here is the Hex Code for Porsche "Sternrubin" Ruby or Starruby depending on language:
|
||||||
|
0xBA3A64
|
||||||
|
*/
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
#include %A_LineFile%\..\CLR.ahk
|
||||||
|
|
||||||
|
; Static class, holds ViGEm Client instance
|
||||||
|
class ViGEmWrapper {
|
||||||
|
static asm := 0
|
||||||
|
static client := 0
|
||||||
|
|
||||||
|
Init(){
|
||||||
|
if (this.client == 0){
|
||||||
|
this.asm := CLR_LoadLibrary(A_LineFile "\..\ViGEmWrapper.dll")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateInstance(cls){
|
||||||
|
return this.asm.CreateInstance(cls)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; Base class for ViGEm "Targets" (Controller types - eg xb360 / ds4) to inherit from
|
||||||
|
class ViGEmTarget {
|
||||||
|
target := 0
|
||||||
|
helperClass := ""
|
||||||
|
controllerClass := ""
|
||||||
|
|
||||||
|
__New(){
|
||||||
|
;~ this.asm := CLR_LoadLibrary(A_LineFile "\..\ViGEmWrapper.dll")
|
||||||
|
ViGEmWrapper.Init()
|
||||||
|
this.Instance := ViGEmWrapper.CreateInstance(this.helperClass)
|
||||||
|
|
||||||
|
if (this.Instance.OkCheck() != "OK"){
|
||||||
|
msgbox ViGEmWrapper.dll failed to load!
|
||||||
|
ExitApp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SendReport(){
|
||||||
|
this.Instance.SendReport()
|
||||||
|
}
|
||||||
|
|
||||||
|
SubscribeFeedback(callback){
|
||||||
|
this.Instance.SubscribeFeedback(callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
; DS4 (DualShock 4 for Playstation 4)
|
||||||
|
class ViGEmDS4 extends ViGEmTarget {
|
||||||
|
helperClass := "ViGEmWrapper.Ds4"
|
||||||
|
__New(){
|
||||||
|
static buttons := {Square: 16, Cross: 32, Circle: 64, Triangle: 128, L1: 256, R1: 512, L2: 1024, R2: 2048
|
||||||
|
, Share: 4096, Options: 8192, LS: 16384, RS: 32768 }
|
||||||
|
static specialButtons := {Ps: 1, TouchPad: 2}
|
||||||
|
static axes := {LX: 2, LY: 3, RX: 4, RY: 5, LT: 0, RT: 1}
|
||||||
|
|
||||||
|
this.Buttons := {}
|
||||||
|
for name, id in buttons {
|
||||||
|
this.Buttons[name] := new this._ButtonHelper(this, id)
|
||||||
|
}
|
||||||
|
for name, id in specialButtons {
|
||||||
|
this.Buttons[name] := new this._SpecialButtonHelper(this, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Axes := {}
|
||||||
|
for name, id in axes {
|
||||||
|
this.Axes[name] := new this._AxisHelper(this, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Dpad := new this._DpadHelper(this)
|
||||||
|
base.__New()
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ButtonHelper {
|
||||||
|
__New(parent, id){
|
||||||
|
this._Parent := parent
|
||||||
|
this._Id := id
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
this._Parent.Instance.SetButtonState(this._Id, state)
|
||||||
|
this._Parent.Instance.SendReport()
|
||||||
|
return this._Parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SpecialButtonHelper {
|
||||||
|
__New(parent, id){
|
||||||
|
this._Parent := parent
|
||||||
|
this._Id := id
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
this._Parent.Instance.SetSpecialButtonState(this._Id, state)
|
||||||
|
this._Parent.Instance.SendReport()
|
||||||
|
return this._Parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AxisHelper {
|
||||||
|
__New(parent, id){
|
||||||
|
this._Parent := parent
|
||||||
|
this._Id := id
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
this._Parent.Instance.SetAxisState(this._Id, this.ConvertAxis(state))
|
||||||
|
this._Parent.Instance.SendReport()
|
||||||
|
return this._Parent
|
||||||
|
}
|
||||||
|
|
||||||
|
ConvertAxis(state){
|
||||||
|
return round(state * 2.55)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DpadHelper {
|
||||||
|
__New(parent){
|
||||||
|
this._Parent := parent
|
||||||
|
this._Id := id
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
static dPadDirections := {Up: 0, UpRight: 1, Right: 2, DownRight: 3, Down: 4, DownLeft: 5, Left: 6, UpLeft: 7, None: 8}
|
||||||
|
this._Parent.Instance.SetDpadState(dPadDirections[state])
|
||||||
|
this._Parent.Instance.SendReport()
|
||||||
|
return this._Parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
; Xb360
|
||||||
|
class ViGEmXb360 extends ViGEmTarget {
|
||||||
|
helperClass := "ViGEmWrapper.Xb360"
|
||||||
|
__New(){
|
||||||
|
static buttons := {A: 4096, B: 8192, X: 16384, Y: 32768, LB: 256, RB: 512, LS: 64, RS: 128, Back: 32, Start: 16, Xbox: 1024}
|
||||||
|
static axes := {LX: 2, LY: 3, RX: 4, RY: 5, LT: 0, RT: 1}
|
||||||
|
|
||||||
|
this.Buttons := {}
|
||||||
|
for name, id in buttons {
|
||||||
|
this.Buttons[name] := new this._ButtonHelper(this, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Axes := {}
|
||||||
|
for name, id in axes {
|
||||||
|
this.Axes[name] := new this._AxisHelper(this, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Dpad := new this._DpadHelper(this)
|
||||||
|
|
||||||
|
base.__New()
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ButtonHelper {
|
||||||
|
__New(parent, id){
|
||||||
|
this._Parent := parent
|
||||||
|
this._Id := id
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
this._Parent.Instance.SetButtonState(this._Id, state)
|
||||||
|
this._Parent.Instance.SendReport()
|
||||||
|
return this._Parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AxisHelper {
|
||||||
|
__New(parent, id){
|
||||||
|
this._Parent := parent
|
||||||
|
this._id := id
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
this._Parent.Instance.SetAxisState(this._Id, this.ConvertAxis(state))
|
||||||
|
this._Parent.Instance.SendReport()
|
||||||
|
}
|
||||||
|
|
||||||
|
ConvertAxis(state){
|
||||||
|
value := round((state * 655.36) - 32768)
|
||||||
|
if (value == 32768)
|
||||||
|
return 32767
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DpadHelper {
|
||||||
|
_DpadStates := {1:0, 8:0, 2:0, 4:0} ; Up, Right, Down, Left
|
||||||
|
__New(parent){
|
||||||
|
this._Parent := parent
|
||||||
|
}
|
||||||
|
|
||||||
|
SetState(state){
|
||||||
|
static dpadDirections := { None: {1:0, 8:0, 2:0, 4:0}
|
||||||
|
, Up: {1:1, 8:0, 2:0, 4:0}
|
||||||
|
, UpRight: {1:1, 8:1, 2:0, 4:0}
|
||||||
|
, Right: {1:0, 8:1, 2:0, 4:0}
|
||||||
|
, DownRight: {1:0, 8:1, 2:1, 4:0}
|
||||||
|
, Down: {1:0, 8:0, 2:1, 4:0}
|
||||||
|
, DownLeft: {1:0, 8:0, 2:1, 4:1}
|
||||||
|
, Left: {1:0, 8:0, 2:0, 4:1}
|
||||||
|
, UpLeft: {1:1, 8:0, 2:0, 4:1}}
|
||||||
|
newStates := dpadDirections[state]
|
||||||
|
for id, newState in newStates {
|
||||||
|
oldState := this._DpadStates[id]
|
||||||
|
if (oldState != newState){
|
||||||
|
this._DpadStates[id] := newState
|
||||||
|
this._Parent.Instance.SetButtonState(id, newState)
|
||||||
|
}
|
||||||
|
this._Parent.SendReport()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
; ==========================================================
|
||||||
|
; .NET Framework Interop
|
||||||
|
; https://autohotkey.com/boards/viewtopic.php?t=4633
|
||||||
|
; ==========================================================
|
||||||
|
;
|
||||||
|
; Author: Lexikos
|
||||||
|
; Version: 1.2
|
||||||
|
; Requires: AutoHotkey_L v1.0.96+
|
||||||
|
;
|
||||||
|
|
||||||
|
CLR_LoadLibrary(AssemblyName, AppDomain=0)
|
||||||
|
{
|
||||||
|
if !AppDomain
|
||||||
|
AppDomain := CLR_GetDefaultDomain()
|
||||||
|
e := ComObjError(0)
|
||||||
|
Loop 1 {
|
||||||
|
if assembly := AppDomain.Load_2(AssemblyName)
|
||||||
|
break
|
||||||
|
static null := ComObject(13,0)
|
||||||
|
args := ComObjArray(0xC, 1), args[0] := AssemblyName
|
||||||
|
typeofAssembly := AppDomain.GetType().Assembly.GetType()
|
||||||
|
if assembly := typeofAssembly.InvokeMember_3("LoadWithPartialName", 0x158, null, null, args)
|
||||||
|
break
|
||||||
|
if assembly := typeofAssembly.InvokeMember_3("LoadFrom", 0x158, null, null, args)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
ComObjError(e)
|
||||||
|
return assembly
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_CreateObject(Assembly, TypeName, Args*)
|
||||||
|
{
|
||||||
|
if !(argCount := Args.MaxIndex())
|
||||||
|
return Assembly.CreateInstance_2(TypeName, true)
|
||||||
|
|
||||||
|
vargs := ComObjArray(0xC, argCount)
|
||||||
|
Loop % argCount
|
||||||
|
vargs[A_Index-1] := Args[A_Index]
|
||||||
|
|
||||||
|
static Array_Empty := ComObjArray(0xC,0), null := ComObject(13,0)
|
||||||
|
|
||||||
|
return Assembly.CreateInstance_3(TypeName, true, 0, null, vargs, null, Array_Empty)
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_CompileC#(Code, References="", AppDomain=0, FileName="", CompilerOptions="")
|
||||||
|
{
|
||||||
|
return CLR_CompileAssembly(Code, References, "System", "Microsoft.CSharp.CSharpCodeProvider", AppDomain, FileName, CompilerOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_CompileVB(Code, References="", AppDomain=0, FileName="", CompilerOptions="")
|
||||||
|
{
|
||||||
|
return CLR_CompileAssembly(Code, References, "System", "Microsoft.VisualBasic.VBCodeProvider", AppDomain, FileName, CompilerOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_StartDomain(ByRef AppDomain, BaseDirectory="")
|
||||||
|
{
|
||||||
|
static null := ComObject(13,0)
|
||||||
|
args := ComObjArray(0xC, 5), args[0] := "", args[2] := BaseDirectory, args[4] := ComObject(0xB,false)
|
||||||
|
AppDomain := CLR_GetDefaultDomain().GetType().InvokeMember_3("CreateDomain", 0x158, null, null, args)
|
||||||
|
return A_LastError >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_StopDomain(ByRef AppDomain)
|
||||||
|
{ ; ICorRuntimeHost::UnloadDomain
|
||||||
|
DllCall("SetLastError", "uint", hr := DllCall(NumGet(NumGet(0+RtHst:=CLR_Start())+20*A_PtrSize), "ptr", RtHst, "ptr", ComObjValue(AppDomain))), AppDomain := ""
|
||||||
|
return hr >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
; NOTE: IT IS NOT NECESSARY TO CALL THIS FUNCTION unless you need to load a specific version.
|
||||||
|
CLR_Start(Version="") ; returns ICorRuntimeHost*
|
||||||
|
{
|
||||||
|
static RtHst := 0
|
||||||
|
; The simple method gives no control over versioning, and seems to load .NET v2 even when v4 is present:
|
||||||
|
; return RtHst ? RtHst : (RtHst:=COM_CreateObject("CLRMetaData.CorRuntimeHost","{CB2F6722-AB3A-11D2-9C40-00C04FA30A3E}"), DllCall(NumGet(NumGet(RtHst+0)+40),"uint",RtHst))
|
||||||
|
if RtHst
|
||||||
|
return RtHst
|
||||||
|
EnvGet SystemRoot, SystemRoot
|
||||||
|
if Version =
|
||||||
|
Loop % SystemRoot "\Microsoft.NET\Framework" (A_PtrSize=8?"64":"") "\*", 2
|
||||||
|
if (FileExist(A_LoopFileFullPath "\mscorlib.dll") && A_LoopFileName > Version)
|
||||||
|
Version := A_LoopFileName
|
||||||
|
if DllCall("mscoree\CorBindToRuntimeEx", "wstr", Version, "ptr", 0, "uint", 0
|
||||||
|
, "ptr", CLR_GUID(CLSID_CorRuntimeHost, "{CB2F6723-AB3A-11D2-9C40-00C04FA30A3E}")
|
||||||
|
, "ptr", CLR_GUID(IID_ICorRuntimeHost, "{CB2F6722-AB3A-11D2-9C40-00C04FA30A3E}")
|
||||||
|
, "ptr*", RtHst) >= 0
|
||||||
|
DllCall(NumGet(NumGet(RtHst+0)+10*A_PtrSize), "ptr", RtHst) ; Start
|
||||||
|
return RtHst
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
; INTERNAL FUNCTIONS
|
||||||
|
;
|
||||||
|
|
||||||
|
CLR_GetDefaultDomain()
|
||||||
|
{
|
||||||
|
static defaultDomain := 0
|
||||||
|
if !defaultDomain
|
||||||
|
{ ; ICorRuntimeHost::GetDefaultDomain
|
||||||
|
if DllCall(NumGet(NumGet(0+RtHst:=CLR_Start())+13*A_PtrSize), "ptr", RtHst, "ptr*", p:=0) >= 0
|
||||||
|
defaultDomain := ComObject(p), ObjRelease(p)
|
||||||
|
}
|
||||||
|
return defaultDomain
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_CompileAssembly(Code, References, ProviderAssembly, ProviderType, AppDomain=0, FileName="", CompilerOptions="")
|
||||||
|
{
|
||||||
|
if !AppDomain
|
||||||
|
AppDomain := CLR_GetDefaultDomain()
|
||||||
|
|
||||||
|
if !(asmProvider := CLR_LoadLibrary(ProviderAssembly, AppDomain))
|
||||||
|
|| !(codeProvider := asmProvider.CreateInstance(ProviderType))
|
||||||
|
|| !(codeCompiler := codeProvider.CreateCompiler())
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if !(asmSystem := (ProviderAssembly="System") ? asmProvider : CLR_LoadLibrary("System", AppDomain))
|
||||||
|
return 0
|
||||||
|
|
||||||
|
; Convert | delimited list of references into an array.
|
||||||
|
StringSplit, Refs, References, |, %A_Space%%A_Tab%
|
||||||
|
aRefs := ComObjArray(8, Refs0)
|
||||||
|
Loop % Refs0
|
||||||
|
aRefs[A_Index-1] := Refs%A_Index%
|
||||||
|
|
||||||
|
; Set parameters for compiler.
|
||||||
|
prms := CLR_CreateObject(asmSystem, "System.CodeDom.Compiler.CompilerParameters", aRefs)
|
||||||
|
, prms.OutputAssembly := FileName
|
||||||
|
, prms.GenerateInMemory := FileName=""
|
||||||
|
, prms.GenerateExecutable := SubStr(FileName,-3)=".exe"
|
||||||
|
, prms.CompilerOptions := CompilerOptions
|
||||||
|
, prms.IncludeDebugInformation := true
|
||||||
|
|
||||||
|
; Compile!
|
||||||
|
compilerRes := codeCompiler.CompileAssemblyFromSource(prms, Code)
|
||||||
|
|
||||||
|
if error_count := (errors := compilerRes.Errors).Count
|
||||||
|
{
|
||||||
|
error_text := ""
|
||||||
|
Loop % error_count
|
||||||
|
error_text .= ((e := errors.Item[A_Index-1]).IsWarning ? "Warning " : "Error ") . e.ErrorNumber " on line " e.Line ": " e.ErrorText "`n`n"
|
||||||
|
MsgBox, 16, Compilation Failed, %error_text%
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
; Success. Return Assembly object or path.
|
||||||
|
return compilerRes[FileName="" ? "CompiledAssembly" : "PathToAssembly"]
|
||||||
|
}
|
||||||
|
|
||||||
|
CLR_GUID(ByRef GUID, sGUID)
|
||||||
|
{
|
||||||
|
VarSetCapacity(GUID, 16, 0)
|
||||||
|
return DllCall("ole32\CLSIDFromString", "wstr", sGUID, "ptr", &GUID) >= 0 ? &GUID : ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
/**********************************************
|
||||||
|
* Controller methods for simplicity *
|
||||||
|
***********************************************/
|
||||||
|
*/
|
||||||
|
|
||||||
|
GoTo EndControllerFunctionsDef
|
||||||
|
|
||||||
|
;;;;;;;;;;;; Turning functions
|
||||||
|
;;;;;;;;;;;; For holding the stick in a specific position for a period of time
|
||||||
|
;;;;;;;;;;;; Note no other button may be pressed or released when these functions are ran
|
||||||
|
|
||||||
|
; Set the time you want to turn for in miliseconds and how hard (50, 100), 100 being the most, 50 being neutral
|
||||||
|
Turn_Right(sleept, inten){
|
||||||
|
t := sleept
|
||||||
|
controller.Axes.LX.SetState(inten)
|
||||||
|
gosub, Turn
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
}
|
||||||
|
|
||||||
|
; Set the time you want to turn for in miliseconds and how hard (0, 50), 0 being the most
|
||||||
|
Turn_Left(sleept, inten){
|
||||||
|
t := sleept
|
||||||
|
controller.Axes.LX.SetState(inten)
|
||||||
|
gosub, Turn
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
}
|
||||||
|
|
||||||
|
;;;;;;;;;;;; Simple button press functions
|
||||||
|
;;;;;;;;;;;; You can pass a delay amount or leave it blank
|
||||||
|
;;;;;;;;;;;; Longer delays hold the button longer
|
||||||
|
|
||||||
|
; Press X button
|
||||||
|
Press_X(delay:=200){
|
||||||
|
controller.Buttons.Cross.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Buttons.Cross.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press O button
|
||||||
|
Press_O(delay:=200){
|
||||||
|
controller.Buttons.Circle.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Buttons.Circle.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press Triangle button
|
||||||
|
Press_Triangle(delay:=200){
|
||||||
|
controller.Buttons.Triangle.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Buttons.Triangle.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press Square button
|
||||||
|
Press_Square(delay:=200){
|
||||||
|
controller.Buttons.Square.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Buttons.Square.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press R1 button
|
||||||
|
Press_L1(delay:=200){
|
||||||
|
controller.Buttons.L1.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Buttons.L1.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press R1 button
|
||||||
|
Press_R1(delay:=200){
|
||||||
|
controller.Buttons.R1.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Buttons.R1.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press Right on D-pad
|
||||||
|
Press_Right(delay:=200){
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press Left on D-pad
|
||||||
|
Press_Left(delay:=200){
|
||||||
|
controller.Dpad.SetState("Left")
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press Up on D-pad
|
||||||
|
Press_Up(delay:=200){
|
||||||
|
controller.Dpad.SetState("Up")
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Press Down on D-pad
|
||||||
|
Press_Down(delay:=200){
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
DllCall("Sleep", "UInt", delay)
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
;;;;;;;;;;; Other functions specific to GT7
|
||||||
|
|
||||||
|
; Turn on nitrous
|
||||||
|
Nitrous_On(){
|
||||||
|
controller.Buttons.RS.SetState(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
; Turn off nitrous
|
||||||
|
Nitrous_Off(){
|
||||||
|
controller.Buttons.RS.SetState(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
Accel_On(control:=100){
|
||||||
|
controller.Buttons.R2.SetState(true)
|
||||||
|
controller.Axes.RT.SetState(control)
|
||||||
|
}
|
||||||
|
|
||||||
|
Accel_Off(){
|
||||||
|
controller.Buttons.R2.SetState(false)
|
||||||
|
controller.Axes.RT.SetState(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
Brake_On(control:=100){
|
||||||
|
controller.Buttons.L2.SetState(true)
|
||||||
|
controller.Axes.LT.SetState(control)
|
||||||
|
}
|
||||||
|
|
||||||
|
Brake_Off(){
|
||||||
|
controller.Buttons.L2.SetState(false)
|
||||||
|
controller.Axes.LT.SetState(0)
|
||||||
|
}
|
||||||
|
; given time t in miliseconds, turn right for that long, with intensity being how much the turn button is held for
|
||||||
|
Turn:
|
||||||
|
t0 := A_TickCount
|
||||||
|
tf := t0+t
|
||||||
|
loop {
|
||||||
|
Sleep(100)
|
||||||
|
} until A_TickCount > tf
|
||||||
|
return
|
||||||
|
|
||||||
|
PressX:
|
||||||
|
; Just for menuing, does not hold X down
|
||||||
|
controller.Buttons.Cross.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", 200)
|
||||||
|
controller.Buttons.Cross.SetState(false)
|
||||||
|
return
|
||||||
|
|
||||||
|
PressO:
|
||||||
|
; Just for menuing, does not hold O down
|
||||||
|
controller.Buttons.Circle.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", 200)
|
||||||
|
controller.Buttons.Circle.SetState(false)
|
||||||
|
return
|
||||||
|
|
||||||
|
PressRight:
|
||||||
|
; For turning
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
Sleep, 50
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
EndControllerFunctionsDef:
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
/**********************************************
|
||||||
|
* Only place functions here, no sub routines *
|
||||||
|
***********************************************/
|
||||||
|
|
||||||
|
|
||||||
|
; Grabs the colors of the pixels (x-b, y-b) to (x+b, y+b)
|
||||||
|
; returns the array of colors
|
||||||
|
*/
|
||||||
|
|
||||||
|
BitGrab(x, y, b)
|
||||||
|
{
|
||||||
|
HWND := WinExist("PS Remote Play")
|
||||||
|
pToken := Gdip_Startup()
|
||||||
|
pBitmap := Gdip_BitmapFromHWND2(hwnd)
|
||||||
|
|
||||||
|
pixs := []
|
||||||
|
for i in range(-1*b, b+1){
|
||||||
|
for j in range(-1*b, b+1){
|
||||||
|
pixel := Gdip_GetPixel(pBitmap,x+i,y+j)
|
||||||
|
rgb := ConvertARGB( pixel )
|
||||||
|
pixs.Push(rgb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Gdip_DisposeImage(pBitmap)
|
||||||
|
Gdip_Shutdown(pToken)
|
||||||
|
return pixs
|
||||||
|
}
|
||||||
|
|
||||||
|
Gdip_BitmapFromHWND2(hwnd)
|
||||||
|
{
|
||||||
|
WinGetPos,,, Width, Height, ahk_id %hwnd%
|
||||||
|
hbm := CreateDIBSection(Width, Height), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)
|
||||||
|
RegExMatch(A_OsVersion, "\d+", Version)
|
||||||
|
PrintWindow(hwnd, hdc, Version >= 8 ? 2 : 0)
|
||||||
|
pBitmap := Gdip_CreateBitmapFromHBITMAP(hbm)
|
||||||
|
SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc)
|
||||||
|
return pBitmap
|
||||||
|
}
|
||||||
|
|
||||||
|
range(start, stop:="", step:=1) {
|
||||||
|
static range := { _NewEnum: Func("_RangeNewEnum") }
|
||||||
|
if !step
|
||||||
|
throw "range(): Parameter 'step' must not be 0 or blank"
|
||||||
|
if (stop == "")
|
||||||
|
stop := start, start := 0
|
||||||
|
; Formula: r[i] := start + step*i ; r = range object, i = 0-based index
|
||||||
|
; For a postive 'step', the constraints are i >= 0 and r[i] < stop
|
||||||
|
; For a negative 'step', the constraints are i >= 0 and r[i] > stop
|
||||||
|
; No result is returned if r[0] does not meet the value constraint
|
||||||
|
if (step > 0 ? start < stop : start > stop) ;// start == start + step*0
|
||||||
|
return { base: range, start: start, stop: stop, step: step }
|
||||||
|
}
|
||||||
|
|
||||||
|
_RangeNewEnum(r) {
|
||||||
|
static enum := { "Next": Func("_RangeEnumNext") }
|
||||||
|
return { base: enum, r: r, i: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
_RangeEnumNext(enum, ByRef k, ByRef v:="") {
|
||||||
|
stop := enum.r.stop, step := enum.r.step
|
||||||
|
, k := enum.r.start + step*enum.i
|
||||||
|
if (ret := step > 0 ? k < stop : k > stop)
|
||||||
|
enum.i += 1
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Sleep(ms=1)
|
||||||
|
{
|
||||||
|
global timeBeginPeriodHasAlreadyBeenCalled
|
||||||
|
if (timeBeginPeriodHasAlreadyBeenCalled != 1)
|
||||||
|
{
|
||||||
|
DllCall("Winmm.dll\timeBeginPeriod", UInt, 1)
|
||||||
|
timeBeginPeriodHasAlreadyBeenCalled := 1
|
||||||
|
}
|
||||||
|
|
||||||
|
DllCall("Sleep", UInt, ms)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PixelColorSimple(pc_x, pc_y)
|
||||||
|
{
|
||||||
|
WinGet, remotePlay_id, List, ahk_exe RemotePlay.exe
|
||||||
|
if (remotePlay_id = 0)
|
||||||
|
{
|
||||||
|
MsgBox, PS4 Remote Play not found
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if remotePlay_id
|
||||||
|
{
|
||||||
|
pc_wID := remotePlay_id[0]
|
||||||
|
pc_hDC := DllCall("GetDC", "UInt", pc_wID)
|
||||||
|
pc_fmtI := A_FormatInteger
|
||||||
|
SetFormat, IntegerFast, Hex
|
||||||
|
pc_c := DllCall("GetPixel", "UInt", pc_hDC, "Int", pc_x, "Int", pc_y, "UInt")
|
||||||
|
pc_c := pc_c >> 16 & 0xff | pc_c & 0xff00 | (pc_c & 0xff) << 16
|
||||||
|
pc_c .= ""
|
||||||
|
SetFormat, IntegerFast, %pc_fmtI%
|
||||||
|
DllCall("ReleaseDC", "UInt", pc_wID, "UInt", pc_hDC)
|
||||||
|
return pc_c
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GetClientSize(hWnd, ByRef w := "", ByRef h := "")
|
||||||
|
{
|
||||||
|
VarSetCapacity(rect, 16)
|
||||||
|
DllCall("GetClientRect", "ptr", hWnd, "ptr", &rect)
|
||||||
|
w := NumGet(rect, 8, "int")
|
||||||
|
h := NumGet(rect, 12, "int")
|
||||||
|
}
|
||||||
|
|
||||||
|
Distance(c1, c2)
|
||||||
|
{ ; function by [VxE], return value range = [0, 441.67295593006372]
|
||||||
|
return Sqrt((((c1>>16)-(c2>>16))**2)+(((c1>>8&255)-(c2>>8&255))**2)+(((c1&255)-(c1&255))**2))
|
||||||
|
}
|
||||||
|
|
||||||
|
ConvertARGB(ARGB, Convert := 0)
|
||||||
|
{
|
||||||
|
SetFormat, IntegerFast, Hex
|
||||||
|
RGB += ARGB
|
||||||
|
RGB := RGB & 0x00FFFFFF
|
||||||
|
if (Convert)
|
||||||
|
RGB := (RGB & 0xFF000000) | ((RGB & 0xFF0000) >> 16) | (RGB & 0x00FF00) | ((RGB & 0x0000FF) << 16)
|
||||||
|
|
||||||
|
return RGB
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolTipper(msg, x := 100, y := 100)
|
||||||
|
{
|
||||||
|
if (debug_mode = 1)
|
||||||
|
ToolTip, %msg%, x, y, Screen
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#Include Menus\ChampionshipMenuing.ahk
|
||||||
|
#Include Menus\NormalMenuing.ahk
|
||||||
|
|
||||||
|
GoTo EndMenuDef
|
||||||
|
|
||||||
|
Menu:
|
||||||
|
Switch MenuSelection
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
gosub, ChampionshipMenu
|
||||||
|
return
|
||||||
|
case 1:
|
||||||
|
gosub, NormalMenu
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
EndMenuDef:
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
GoTo EndChampionshipMenuingDef
|
||||||
|
|
||||||
|
ChampionshipMenu:
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
break_point := false
|
||||||
|
c2 := BitGrab(pix2x, pix2y+remote_play_offsetY, box_size)
|
||||||
|
for i, c in c2
|
||||||
|
{
|
||||||
|
d2 := Distance(c, color_check2)
|
||||||
|
if (d2 < tolerance )
|
||||||
|
{
|
||||||
|
break_point := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (break_point)
|
||||||
|
break
|
||||||
|
Press_X()
|
||||||
|
sleep, %color_2_delay%
|
||||||
|
sleep, %bm_delay%
|
||||||
|
}
|
||||||
|
;ToolTip, Found color 2, 100, 100, Screen
|
||||||
|
Sleep, 100
|
||||||
|
Press_O()
|
||||||
|
Sleep, 100
|
||||||
|
Press_Right()
|
||||||
|
Sleep, 100
|
||||||
|
Press_X()
|
||||||
|
Sleep, %ps_load_time1%
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1000
|
||||||
|
Press_O()
|
||||||
|
loop, 2
|
||||||
|
{
|
||||||
|
Press_X()
|
||||||
|
Sleep, 100
|
||||||
|
}
|
||||||
|
Sleep, %ps_load_time2%
|
||||||
|
|
||||||
|
;Conduct Maintenance here.
|
||||||
|
CheckForOilChange := Mod(A_Index, 87)
|
||||||
|
CheckForMaintenance := Mod(A_Index, 257)
|
||||||
|
|
||||||
|
;ToolTipper("CheckForOilChange " CheckForOilChange "`nCheckForMaintenance " CheckForMaintenance, 300, 100)
|
||||||
|
|
||||||
|
ifEqual, CheckForOilChange, 0
|
||||||
|
{
|
||||||
|
gosub, DoOilChange
|
||||||
|
}
|
||||||
|
|
||||||
|
ifEqual, CheckForMaintenance, 0
|
||||||
|
{
|
||||||
|
gosub, DoMaintenance
|
||||||
|
}
|
||||||
|
Press_Down()
|
||||||
|
Sleep, 100
|
||||||
|
loop, %menu_loops%
|
||||||
|
{
|
||||||
|
controller.Dpad.SetState(MenuDirect)
|
||||||
|
Sleep, 100
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 100
|
||||||
|
}
|
||||||
|
loop, 2
|
||||||
|
{
|
||||||
|
Press_X()
|
||||||
|
Sleep, 500
|
||||||
|
}
|
||||||
|
Sleep, %ps_load_time3%
|
||||||
|
loop, 2{
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
EndChampionshipMenuingDef:
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
GoTo EndNormalMenuingDef
|
||||||
|
|
||||||
|
NormalMenu:
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
break_point := false
|
||||||
|
c2 := BitGrab(pix2x, pix2y+remote_play_offsetY, box_size)
|
||||||
|
for i, c in c2
|
||||||
|
{
|
||||||
|
d2 := Distance(c, color_check2)
|
||||||
|
if (d2 < tolerance )
|
||||||
|
{
|
||||||
|
break_point := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (break_point)
|
||||||
|
break
|
||||||
|
Press_X()
|
||||||
|
sleep, %color_2_delay%
|
||||||
|
sleep, %bm_delay%
|
||||||
|
}
|
||||||
|
|
||||||
|
;ToolTip, Found color 2, 100, 100, Screen
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
Sleep, 100
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 500
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 2000
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
EndNormalMenuingDef:
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
__enableCheckStuck_mod__ := 0
|
||||||
|
|
||||||
|
GoTo EndCheckStuckDef
|
||||||
|
|
||||||
|
CheckStuck:
|
||||||
|
|
||||||
|
if (__enableCheckStuck_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
tc := BitGrab(tyreX, tyreY, box_size)
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_tyre_overheat)
|
||||||
|
if (td < tolerance ){
|
||||||
|
tyres_overheating := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
Unstuck:
|
||||||
|
|
||||||
|
if (__enableCheckStuck_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
controller.Buttons.RS.SetState(false)
|
||||||
|
Sleep 200
|
||||||
|
Turn_Left(4000, 0)
|
||||||
|
tyres_overheating := false
|
||||||
|
controller.Buttons.RS.SetState(true)
|
||||||
|
ToolTip, Unstuck done - hope it worked., 100, 100, Screen
|
||||||
|
return
|
||||||
|
|
||||||
|
EndCheckStuckDef:
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
__enableTurn_mod__ := 0
|
||||||
|
|
||||||
|
;Color: C95A51 (Red=C9 Green=5A Blue=51)
|
||||||
|
|
||||||
|
; Class TurnContainer
|
||||||
|
; Simple container for constants
|
||||||
|
; Store the starting points to look for a turn on the minimap
|
||||||
|
; You can also store the end points
|
||||||
|
class TurnContainer
|
||||||
|
{
|
||||||
|
__New(startX, startY, endX := 0, endY := 0)
|
||||||
|
{
|
||||||
|
this.startX := startX
|
||||||
|
this.startY := startY
|
||||||
|
this.endX := endX
|
||||||
|
this.endY := endY
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
; below isn't used yet
|
||||||
|
TurnTolerance := 10
|
||||||
|
|
||||||
|
GoTo EndTurnDef
|
||||||
|
|
||||||
|
|
||||||
|
CheckTurn(x,y, b_size := 2)
|
||||||
|
{
|
||||||
|
color_player := 0xDE6E70
|
||||||
|
if (__enableTurn_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
turn_complete := false
|
||||||
|
|
||||||
|
loop {
|
||||||
|
tc := BitGrab(x, y, b_size)
|
||||||
|
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_player)
|
||||||
|
ToolTipper("Turn" td)
|
||||||
|
if (td < 20 ){
|
||||||
|
turn_complete := true
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} until turn_complete = true
|
||||||
|
ToolTipper("Turn Found")
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ResetTurn:
|
||||||
|
turn_complete := false
|
||||||
|
return
|
||||||
|
|
||||||
|
EndTurnDef:
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
__enableCheckTyres_mod__ := 0
|
||||||
|
|
||||||
|
color_tyre_overheat := 0xD42304
|
||||||
|
tyres_overheating := false
|
||||||
|
tyreX := 166
|
||||||
|
tyreY := 364
|
||||||
|
|
||||||
|
GoTo EndCheckTyresDef
|
||||||
|
|
||||||
|
CheckTyresOverheating:
|
||||||
|
|
||||||
|
|
||||||
|
if (__enableCheckTyres_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
tc := BitGrab(tyreX, tyreY, box_size)
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_tyre_overheat)
|
||||||
|
if (td < tolerance ){
|
||||||
|
tyres_overheating := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
RetryRace:
|
||||||
|
|
||||||
|
if (__enableCheckTyres_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Gosub, PauseLoop
|
||||||
|
Sleep 500
|
||||||
|
tyres_overheating := false
|
||||||
|
controller.Buttons.Options.SetState(true)
|
||||||
|
Sleep 200
|
||||||
|
controller.Buttons.Options.SetState(false)
|
||||||
|
Sleep, 500
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Goto, AFKLoop
|
||||||
|
return
|
||||||
|
|
||||||
|
EndCheckTyresDef:
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
__enableHairpin_mod__ := 0
|
||||||
|
|
||||||
|
;Screen: 506, 69 (less often used)
|
||||||
|
;Color: C95A51 (Red=C9 Green=5A Blue=51)
|
||||||
|
|
||||||
|
;Screen: 588, 88 (less often used)
|
||||||
|
|
||||||
|
|
||||||
|
color_player := 0xDE6E70
|
||||||
|
hairpin_complete := false
|
||||||
|
hairpinX := 506
|
||||||
|
hairpinY := 72
|
||||||
|
hairpinCount := 0
|
||||||
|
hairpinTolerance := 10
|
||||||
|
|
||||||
|
GoTo EndHairpinDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CheckHairpin:
|
||||||
|
|
||||||
|
|
||||||
|
if (__enableHairpin_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tc := BitGrab(hairpinX, hairpinY,3)
|
||||||
|
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_player)
|
||||||
|
if (td < 20 ){
|
||||||
|
hairpin_complete := true
|
||||||
|
hairpinCount += 1
|
||||||
|
ToolTip, Hairpin Found current state: %hairpinCount%, 100, 100, Screen
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
ResetHairpin:
|
||||||
|
hairpinCount := 0
|
||||||
|
return
|
||||||
|
|
||||||
|
EndHairpinDef:
|
||||||
@@ -0,0 +1,275 @@
|
|||||||
|
__enableMaintenance_mod__ := 0
|
||||||
|
|
||||||
|
GoTo EndMaintenceDef
|
||||||
|
|
||||||
|
;This will do only an oil change. will leave user at race menu to resume.
|
||||||
|
GtAutoNav:
|
||||||
|
return
|
||||||
|
|
||||||
|
DoOilChange:
|
||||||
|
|
||||||
|
if (__enableMaintenance_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SysCheck = 1) {
|
||||||
|
Sleep, 1000
|
||||||
|
Press_O()
|
||||||
|
Sleep, 2800
|
||||||
|
loop, 2 {
|
||||||
|
Press_Right(140)
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
Press_Down()
|
||||||
|
Sleep, 200
|
||||||
|
|
||||||
|
loop, 2 {
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep, 2000
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
Press_X()
|
||||||
|
Sleep, 500
|
||||||
|
}
|
||||||
|
Sleep, 7000
|
||||||
|
Press_X()
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
Press_O()
|
||||||
|
Sleep, 200
|
||||||
|
Sleep, 3000
|
||||||
|
Press_Up(140)
|
||||||
|
Sleep, 200
|
||||||
|
Press_Left()
|
||||||
|
Sleep, 500
|
||||||
|
Press_Left()
|
||||||
|
Sleep, 500
|
||||||
|
Press_X()
|
||||||
|
Sleep, 4800
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SysCheck = 2 or SysCheck = 3) {
|
||||||
|
Sleep, 1000
|
||||||
|
Press_O()
|
||||||
|
Sleep, 8800
|
||||||
|
loop, 2 {
|
||||||
|
Press_Right(140)
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
Press_Down()
|
||||||
|
Sleep, 200
|
||||||
|
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1000
|
||||||
|
loop, 2 { ; Makes sure it gets into the oil menu regardless the cursor starting point
|
||||||
|
Press_Left(140)
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1000
|
||||||
|
|
||||||
|
Sleep, 4000
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1500
|
||||||
|
}
|
||||||
|
Sleep, 7000
|
||||||
|
Press_X()
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
Press_O()
|
||||||
|
Sleep, 200
|
||||||
|
Sleep, 7000
|
||||||
|
Press_Up(140)
|
||||||
|
Sleep, 200
|
||||||
|
Press_Left()
|
||||||
|
Sleep, 500
|
||||||
|
Press_Left()
|
||||||
|
Sleep, 500
|
||||||
|
Press_X()
|
||||||
|
Sleep, 11800
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
;This will do complete maintenance on the car including oil, engine and body. will leave user at race menu to resume.
|
||||||
|
DoMaintenance:
|
||||||
|
|
||||||
|
if (__enableCheckTyres_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SysCheck = 1) { ; PS5
|
||||||
|
Sleep, 1000
|
||||||
|
controller.Buttons.Circle.SetState(true)
|
||||||
|
Sleep, 200
|
||||||
|
controller.Buttons.Circle.SetState(false)
|
||||||
|
Sleep, 2800
|
||||||
|
loop, 2 {
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
|
||||||
|
loop, 2 {
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep, 2000
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
}
|
||||||
|
Sleep, 7000
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
}
|
||||||
|
Sleep, 7000
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("Down")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
}
|
||||||
|
Sleep, 8500
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
controller.Buttons.Circle.SetState(true)
|
||||||
|
Sleep, 200
|
||||||
|
controller.Buttons.Circle.SetState(false)
|
||||||
|
Sleep, 200
|
||||||
|
Sleep, 3000
|
||||||
|
controller.Dpad.SetState("Up")
|
||||||
|
Sleep, 140
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("Left")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 500
|
||||||
|
controller.Dpad.SetState("Left")
|
||||||
|
Sleep, 200
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 500
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 4800
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SysCheck = 2 or SysCheck = 3) { ; PS4 and PS4 Pro
|
||||||
|
Sleep, 1000
|
||||||
|
Press_O()
|
||||||
|
Sleep, 8800
|
||||||
|
loop, 2 {
|
||||||
|
Press_Right(140)
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
Press_Down()
|
||||||
|
Sleep, 200
|
||||||
|
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1000
|
||||||
|
loop, 2 { ; Makes sure it gets into the oil menu regardless the cursor starting point
|
||||||
|
Press_Left(140)
|
||||||
|
Sleep, 200
|
||||||
|
}
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1000
|
||||||
|
|
||||||
|
Sleep, 4000
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1500
|
||||||
|
}
|
||||||
|
Sleep, 7000
|
||||||
|
Press_X()
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1500
|
||||||
|
}
|
||||||
|
Sleep, 7000
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1500
|
||||||
|
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
Press_Down(140)
|
||||||
|
Sleep, 200
|
||||||
|
loop, 2 {
|
||||||
|
Press_X()
|
||||||
|
Sleep, 1500
|
||||||
|
}
|
||||||
|
Sleep, 8500
|
||||||
|
gosub, PressX
|
||||||
|
Sleep, 500
|
||||||
|
|
||||||
|
Press_O()
|
||||||
|
Sleep, 200
|
||||||
|
Sleep, 7000
|
||||||
|
Press_Up(140)
|
||||||
|
Sleep, 200
|
||||||
|
Press_Left()
|
||||||
|
Sleep, 500
|
||||||
|
Press_Left()
|
||||||
|
Sleep, 500
|
||||||
|
Press_X()
|
||||||
|
Sleep, 11800
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
EndMaintenceDef:
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/************************************************
|
||||||
|
Rules for adding a mod
|
||||||
|
|
||||||
|
Your mod file should only be included here
|
||||||
|
In your mod file, make a flag variable such as
|
||||||
|
|
||||||
|
__enable<modName>_mod__ := 0
|
||||||
|
|
||||||
|
and put the following at the beggining of each subroutine of your mod file
|
||||||
|
|
||||||
|
if (__enable<modName>_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
This will allow users to disable and enable the mod
|
||||||
|
|
||||||
|
If your mod is dependent on another mod and there is an error while running,
|
||||||
|
try switching the order around on the #Include
|
||||||
|
|
||||||
|
Add the mod's name and variable name to the _mod objects below
|
||||||
|
*************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#Include Mod\Maintenance.ahk
|
||||||
|
#Include Mod\CheckTyres.ahk
|
||||||
|
#Include Mod\CheckStuck.ahk
|
||||||
|
#Include Mod\Hairpin.ahk
|
||||||
|
#Include Mod\CheckTurn.ahk
|
||||||
|
#Include Mod\RemotePlaySizer.ahk
|
||||||
|
|
||||||
|
_mod_names :=
|
||||||
|
( LTrim Join
|
||||||
|
[
|
||||||
|
"Check Tyres",
|
||||||
|
"Maintenance",
|
||||||
|
"Check Stuck",
|
||||||
|
"Check Hairpin",
|
||||||
|
"Check Turns",
|
||||||
|
"Remote Play Enlarge",
|
||||||
|
"Debug Mode"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
_mod_vars =
|
||||||
|
( LTrim Join|
|
||||||
|
__enableCheckTyres_mod__
|
||||||
|
__enableMaintenance_mod__
|
||||||
|
__enableCheckStuck_mod__
|
||||||
|
__enableHairpin_mod__
|
||||||
|
__enableTurn_mod__
|
||||||
|
__enableRemotePlaySizer_mod__
|
||||||
|
debug_mode
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
GoTo EndModsDef
|
||||||
|
|
||||||
|
SaveMods:
|
||||||
|
Gui, 3:Submit
|
||||||
|
Loop, Parse, _mod_vars, |
|
||||||
|
{
|
||||||
|
IniWrite, % %A_LoopField%, config.ini, Mods, % A_LoopField
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
EndModsDef:
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
__enableRemotePlaySizer_mod__ := 0
|
||||||
|
|
||||||
|
; For when you change the size of remote play
|
||||||
|
; Necessary because multiple scripts have different settings for the checks
|
||||||
|
|
||||||
|
GoTo EndRemotePlaySizerDef
|
||||||
|
|
||||||
|
RemotePlay_ChangeSize:
|
||||||
|
|
||||||
|
|
||||||
|
if (__enableRemotePlaySizer_mod__ = 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
remote_play_offsetY := 71
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
EndRemotePlaySizerDef:
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
#Include Races\PanAm.ahk
|
||||||
|
#Include Races\Tokyo.ahk
|
||||||
|
#Include Races\DaytonaSundayCup600.ahk
|
||||||
|
|
||||||
|
|
||||||
|
GoTo EndRaceDef
|
||||||
|
|
||||||
|
Race:
|
||||||
|
|
||||||
|
Switch RaceChoice
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
case "DaytonaSundayCup600":
|
||||||
|
t := 135000
|
||||||
|
MenuSelection := 1
|
||||||
|
Race_DAYTONASUNDAYCUP600()
|
||||||
|
return
|
||||||
|
case "PanAm":
|
||||||
|
t := 210000
|
||||||
|
MenuSelection := 0
|
||||||
|
Race_PANAM()
|
||||||
|
return
|
||||||
|
case "Tokyo":
|
||||||
|
MenuSelection := 1
|
||||||
|
Race_Tokyo()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
SettingsSheet:
|
||||||
|
|
||||||
|
Gui, 4: Show, AutoSize, Settings Sheet
|
||||||
|
;/////////////////////////////////////////////////////////
|
||||||
|
; Add images to your setup here and in the Src folder
|
||||||
|
;
|
||||||
|
;/////////////////////////////////////////////////////////
|
||||||
|
Switch RaceChoice
|
||||||
|
{
|
||||||
|
case "DaytonaSundayCup600":
|
||||||
|
assist_1 = %A_ScriptDir%\Setups\PanAm\Assist1.jpg
|
||||||
|
assist_2 = %A_ScriptDir%\Setups\PanAm\Assist2.jpg
|
||||||
|
tune_1 = %A_ScriptDir%\Setups\PanAm\CarSetup.jpg
|
||||||
|
tune_2 = %A_ScriptDir%\Setups\PanAm\CarGearRatio.jpg
|
||||||
|
controls = %A_ScriptDir%\Setups\PanAm\Controller.jpg
|
||||||
|
return
|
||||||
|
|
||||||
|
case "PanAm":
|
||||||
|
|
||||||
|
assist_1 = %A_ScriptDir%\Setups\PanAm\Assist1.jpg
|
||||||
|
assist_2 = %A_ScriptDir%\Setups\PanAm\Assist2.jpg
|
||||||
|
tune_1 = %A_ScriptDir%\Setups\PanAm\CarSetup.jpg
|
||||||
|
tune_2 = %A_ScriptDir%\Setups\PanAm\CarGearRatio.jpg
|
||||||
|
controls = %A_ScriptDir%\Setups\PanAm\Controller.jpg
|
||||||
|
return
|
||||||
|
Case "Tokyo":
|
||||||
|
|
||||||
|
assist_1 = %A_ScriptDir%\Setups\Tokyo\tokyo_assists_1.JPG
|
||||||
|
assist_2 = %A_ScriptDir%\Setups\Tokyo\tokyo_assists_2.jpg
|
||||||
|
tune_1 = %A_ScriptDir%\Setups\Tokyo\tokyo_tune_1.jpg
|
||||||
|
tune_2 = %A_ScriptDir%\Setups\Tokyo\tokyo_tune_2.jpg
|
||||||
|
controls = %A_ScriptDir%\Setups\Tokyo\tokyo_controls.jpg
|
||||||
|
;FileInstall, tokyo_assists_1.jpg, %assist_1%, 1
|
||||||
|
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
Assists1:
|
||||||
|
GuiControl, 4:, CurrentPic, %assist_1%
|
||||||
|
gosub, Guisizer
|
||||||
|
return
|
||||||
|
|
||||||
|
Assists2:
|
||||||
|
GuiControl, 4:, CurrentPic, %assist_2%
|
||||||
|
gosub, Guisizer
|
||||||
|
return
|
||||||
|
|
||||||
|
Tune1:
|
||||||
|
GuiControl, 4:, CurrentPic, %tune_1%
|
||||||
|
gosub, Guisizer
|
||||||
|
return
|
||||||
|
|
||||||
|
Tune2:
|
||||||
|
GuiControl, 4:, CurrentPic, %tune_2%
|
||||||
|
gosub, Guisizer
|
||||||
|
return
|
||||||
|
|
||||||
|
ControllerSetting:
|
||||||
|
GuiControl, 4:, CurrentPic, %controls%
|
||||||
|
gosub, Guisizer
|
||||||
|
return
|
||||||
|
|
||||||
|
Guisizer:
|
||||||
|
GuiControl, 4: Move, CurrentPic, % "x" 10 "y" 40 "w" 1200 . " h" . 800
|
||||||
|
Gui, 4: Show, AutoSize, Settings Sheet
|
||||||
|
return
|
||||||
|
|
||||||
|
EndRaceDef:
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
GoTo EndRace_DAYTONASUNDAYCUP600_Def
|
||||||
|
|
||||||
|
Race_DAYTONASUNDAYCUP600()
|
||||||
|
{
|
||||||
|
controller.Buttons.Cross.SetState(true)
|
||||||
|
controller.Buttons.RS.SetState(true)
|
||||||
|
DllCall("Sleep", "UInt", 8200)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
t0 := A_TickCount
|
||||||
|
tf := t0+t
|
||||||
|
loop {
|
||||||
|
DllCall("Sleep", "UInt", 500)
|
||||||
|
;timeleft := Format("{:d}", (tf-A_TickCount)/1000)
|
||||||
|
;timeref := Format("{:d}", 20000101000000)
|
||||||
|
;timeref += timeleft, seconds
|
||||||
|
;progress := Format("{:d}", (((t/1000)-(tf-A_TickCount)/1000))/(t/100000))
|
||||||
|
;progress := Format("{:d}", (t-(tf-A_TickCount)))
|
||||||
|
;FormatTime, timeleftfull, %timeref%, H:mm.ss
|
||||||
|
; GuiControl,, ST, Time Left : %timeleftfull%
|
||||||
|
; GuiControl,, MyProgress, %progress%
|
||||||
|
} until A_TickCount >= tf
|
||||||
|
|
||||||
|
;GuiControl,, MyProgress, 0
|
||||||
|
controller.Buttons.Cross.SetState(false)
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
controller.Buttons.RS.SetState(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
EndRace_DAYTONASUNDAYCUP600_Def:
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
GoTo EndRace_PANAM_Def
|
||||||
|
|
||||||
|
Race_PANAM()
|
||||||
|
{
|
||||||
|
|
||||||
|
turn1 := new TurnContainer(619, 112+remote_play_offsetY, 630, 95+remote_play_offsetY)
|
||||||
|
turn2 := new TurnContainer(544, 45+remote_play_offsetY, 511, 52+remote_play_offsetY)
|
||||||
|
turn3 := new TurnContainer(492, 84+remote_play_offsetY, 506, 111+remote_play_offsetY)
|
||||||
|
lap_marker := new TurnContainer(560, 112+remote_play_offsetY)
|
||||||
|
|
||||||
|
; race_start_delay := 17400 ; this is for PS5. It may vary for PS4.
|
||||||
|
Switch SysCheck {
|
||||||
|
Case 1:
|
||||||
|
race_start_delay := 19200
|
||||||
|
Case 2:
|
||||||
|
race_start_delay := 18200
|
||||||
|
Case 3:
|
||||||
|
race_start_delay := 18200
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckForOilChange := Mod(30 - A_Index, 30)
|
||||||
|
SetFormat, IntegerFast, d
|
||||||
|
CheckForMaintenance := Mod(180 - A_Index, 180)
|
||||||
|
SetFormat, IntegerFast, d
|
||||||
|
|
||||||
|
if (__enableMaintenance_mod__ != 0){
|
||||||
|
ToolTipper("Oil: " CheckForOilChange " race(s) remaining`nEngine: " CheckForMaintenance " race(s) remaining", 250, 45)
|
||||||
|
}
|
||||||
|
|
||||||
|
t_ExpectedRaceTime := 195000
|
||||||
|
t_RaceStartTime := A_TickCount
|
||||||
|
t_RaceFinishTime := t_RaceStartTime + t_ExpectedRaceTime
|
||||||
|
;ToolTipper("t_ExpectedRaceTime = " t_ExpectedRaceTime "`nt_RaceStartTime = " t_RaceStartTime "`nt_RaceFinishTime = " t_RaceFinishTime)
|
||||||
|
|
||||||
|
race_complete := false
|
||||||
|
|
||||||
|
; Press X to start the race
|
||||||
|
;Tooltip
|
||||||
|
Press_X()
|
||||||
|
|
||||||
|
; Hold Acceleration and manage turning
|
||||||
|
Nitrous_On()
|
||||||
|
Accel_On(100)
|
||||||
|
;SetTimer, CheckTyresOverheating, 1000
|
||||||
|
|
||||||
|
; Retry race if time is taking more than 5.5 mins
|
||||||
|
; (assume something went wrong with race)
|
||||||
|
;SetTimer, RetryRace, 330000
|
||||||
|
|
||||||
|
Sleep (race_start_delay)
|
||||||
|
controller.Axes.LX.SetState(62) /* before turn 1, to avoid queue of cars */
|
||||||
|
|
||||||
|
Loop {
|
||||||
|
; Turn 1
|
||||||
|
; Tooltip
|
||||||
|
CheckTurn(turn1.startX, turn1.startY)
|
||||||
|
ToolTipper("Turn 1 start found")
|
||||||
|
/*
|
||||||
|
if( A_Index != 1){
|
||||||
|
Nitrous_Off()
|
||||||
|
Accel_On(75)
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
controller.Axes.LX.SetState(18-3*%A_Index%)
|
||||||
|
;Sleep(500)
|
||||||
|
Accel_On(100)
|
||||||
|
CheckTurn(turn1.endX, turn1.endY)
|
||||||
|
ToolTipper("Turn 1 end found")
|
||||||
|
Nitrous_On()
|
||||||
|
controller.Axes.LX.SetState(75)
|
||||||
|
sleep(2000)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
sleep(2500)
|
||||||
|
controller.Axes.LX.SetState(62)
|
||||||
|
sleep(2000)
|
||||||
|
|
||||||
|
; Turn 2
|
||||||
|
if( A_Index = 1 || A_Index = 6){
|
||||||
|
CheckTurn(turn2.startX, turn2.startY)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
CheckTurn(545, turn2.startY)
|
||||||
|
}
|
||||||
|
ToolTipper("Turn 2 start found")
|
||||||
|
controller.Axes.LX.SetState(21.5)
|
||||||
|
CheckTurn(turn2.endX, turn2.endY)
|
||||||
|
ToolTipper("Turn 2 end found")
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
if( A_Index = 1 || A_Index = 6){
|
||||||
|
controller.Axes.LX.SetState(75)
|
||||||
|
sleep(2000)
|
||||||
|
|
||||||
|
controller.Axes.LX.SetState(63)
|
||||||
|
sleep(500)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Turn_Left(500, 32)
|
||||||
|
}
|
||||||
|
|
||||||
|
; Turn 3
|
||||||
|
CheckTurn(turn3.startX, turn3.startY)
|
||||||
|
Nitrous_Off()
|
||||||
|
ToolTipper("Turn 3 start found")
|
||||||
|
controller.Axes.LX.SetState(13)
|
||||||
|
CheckTurn(turn3.endX, turn3.endY)
|
||||||
|
Nitrous_On()
|
||||||
|
ToolTipper("Turn 3 end found")
|
||||||
|
controller.Axes.LX.SetState(42)
|
||||||
|
sleep(500)
|
||||||
|
controller.Axes.LX.SetState(58)
|
||||||
|
sleep(2000)
|
||||||
|
controller.Axes.LX.SetState(63)
|
||||||
|
sleep(2000)
|
||||||
|
CheckTurn(lap_marker.startX, lap_marker.startY)
|
||||||
|
ToolTipper("Lap Complete")
|
||||||
|
|
||||||
|
sleep(4000)
|
||||||
|
} until A_TickCount > t_racefinishtime
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
; ToolTip, Out of Loop, 100, 100, screen
|
||||||
|
|
||||||
|
loop {
|
||||||
|
;ToolTip, Racing, 100, 100, Screen
|
||||||
|
break_point := false
|
||||||
|
c1 := BitGrab(pix1x, pix1y+remote_play_offsetY, box_size)
|
||||||
|
for i, c in c1
|
||||||
|
{
|
||||||
|
d1 := Distance(c, color_check1)
|
||||||
|
;ToolTipper( d1 " " pix1y+remote_play_offsetY " " pix1x " " c)
|
||||||
|
if (d1 < tolerance ){
|
||||||
|
break_point := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (break_point)
|
||||||
|
break
|
||||||
|
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
Sleep, 50
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
|
||||||
|
Sleep, 100
|
||||||
|
}
|
||||||
|
ToolTipper("Race End")
|
||||||
|
gosub, PauseLoop
|
||||||
|
Sleep, 500
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Race_PANAM_Complete() {
|
||||||
|
race_complete := true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
EndRace_PANAM_Def:
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
GoTo EndRace_PANAM_Def
|
||||||
|
|
||||||
|
Race_PANAM()
|
||||||
|
{
|
||||||
|
turn1 := new TurnContainer(619, 112+remote_play_offsetY, 630, 95+remote_play_offsetY)
|
||||||
|
turn2 := new TurnContainer(544, 45+remote_play_offsetY, 511, 52+remote_play_offsetY)
|
||||||
|
;turn3 := new TurnContainer(492, 84+remote_play_offsetY, 506, 111+remote_play_offsetY)
|
||||||
|
turn3 := new TurnContainer(495, 151, 506, 111+remote_play_offsetY)
|
||||||
|
lap_marker := new TurnContainer(560, 112+remote_play_offsetY)
|
||||||
|
|
||||||
|
Switch SysCheck {
|
||||||
|
Case 1:
|
||||||
|
race_start_delay := 19200
|
||||||
|
Case 2:
|
||||||
|
race_start_delay := 18200
|
||||||
|
Case 3:
|
||||||
|
race_start_delay := 18200
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckForOilChange := Mod(30 - A_Index, 30)
|
||||||
|
SetFormat, IntegerFast, d
|
||||||
|
CheckForMaintenance := Mod(180 - A_Index, 180)
|
||||||
|
SetFormat, IntegerFast, d
|
||||||
|
|
||||||
|
if (__enableMaintenance_mod__ != 0){
|
||||||
|
ToolTipper("Oil: " CheckForOilChange " race(s) remaining`nEngine: " CheckForMaintenance " race(s) remaining", 250, 45)
|
||||||
|
}
|
||||||
|
|
||||||
|
t_ExpectedRaceTime := 195000
|
||||||
|
t_RaceStartTime := A_TickCount
|
||||||
|
t_RaceFinishTime := t_RaceStartTime + t_ExpectedRaceTime
|
||||||
|
;ToolTipper("t_ExpectedRaceTime = " t_ExpectedRaceTime "`nt_RaceStartTime = " t_RaceStartTime "`nt_RaceFinishTime = " t_RaceFinishTime)
|
||||||
|
|
||||||
|
race_complete := false
|
||||||
|
|
||||||
|
; Press X to start the race
|
||||||
|
;Tooltip
|
||||||
|
Press_X()
|
||||||
|
|
||||||
|
; Hold Acceleration and manage turning
|
||||||
|
Nitrous_On()
|
||||||
|
Accel_On(100)
|
||||||
|
;SetTimer, CheckTyresOverheating, 1000
|
||||||
|
|
||||||
|
; Retry race if time is taking more than 5.5 mins
|
||||||
|
; (assume something went wrong with race)
|
||||||
|
;SetTimer, RetryRace, 330000
|
||||||
|
|
||||||
|
Tooltip, New Logic, 100, 100, screen
|
||||||
|
|
||||||
|
Sleep(race_start_delay)
|
||||||
|
controller.Axes.LX.SetState(62) /* before turn 1, to avoid queue of cars */
|
||||||
|
|
||||||
|
Loop {
|
||||||
|
t1start := CheckTurnQuick(turn1.startX, turn1.startY, 0xDE6E70)
|
||||||
|
if( A_Index = 1 || A_Index = 6)
|
||||||
|
{
|
||||||
|
t2start := CheckTurnQuick(turn2.startX, turn2.startY, 0xDE6E70)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
t2start := CheckTurnQuick(545, turn2.startY, 0xDE6E70)
|
||||||
|
}
|
||||||
|
t3start := CheckTurnQuick(turn3.startX, turn3.startY, 0xDE6E70)
|
||||||
|
lap_start_end := CheckTurnQuick(lap_marker.startX, lap_marker.startY, 0xDE6E70)
|
||||||
|
race_running1 := CheckTurnQuick(320, 110, 0x000000)
|
||||||
|
race_running2 := CheckTurnQuick(45, 453, 0x000000)
|
||||||
|
race_running3 := CheckTurnQuick(635, 455, 0x000000)
|
||||||
|
|
||||||
|
;Tooltip, T1s = %t1start%`nT2s = %t2start%`nT3s = %t3start%`nLap Start-End = %lap_start_end%`nRace running = %race_running%, 100, 100, screen
|
||||||
|
|
||||||
|
if t1start
|
||||||
|
{
|
||||||
|
;Tooltip, Turn 1 start, 100, 100, screen
|
||||||
|
controller.Axes.LX.SetState(18-3*%A_Index%)
|
||||||
|
Accel_On(85)
|
||||||
|
Nitrous_Off()
|
||||||
|
sleep(2500)
|
||||||
|
Accel_On(100)
|
||||||
|
Nitrous_On()
|
||||||
|
controller.Axes.LX.SetState(75)
|
||||||
|
sleep(2000)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
sleep(2500)
|
||||||
|
controller.Axes.LX.SetState(63)
|
||||||
|
Accel_On(100)
|
||||||
|
Nitrous_On()
|
||||||
|
}
|
||||||
|
|
||||||
|
if t2start
|
||||||
|
{
|
||||||
|
;Tooltip, Turn 2 start, 100, 100, screen
|
||||||
|
controller.Axes.LX.SetState(16.5)
|
||||||
|
sleep(2800)
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
if (A_Index = 1 || A_Index = 6) {
|
||||||
|
controller.Axes.LX.SetState(75)
|
||||||
|
sleep(2000)
|
||||||
|
controller.Axes.LX.SetState(63)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Turn_Left(1000, 30)
|
||||||
|
sleep (2500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if t3start
|
||||||
|
{
|
||||||
|
;Tooltip, Turn 3 start, 100, 100, screen
|
||||||
|
;Nitrous_Off()
|
||||||
|
controller.Axes.LX.SetState(14)
|
||||||
|
sleep(2250)
|
||||||
|
Nitrous_On()
|
||||||
|
controller.Axes.LX.SetState(42)
|
||||||
|
sleep(500)
|
||||||
|
controller.Axes.LX.SetState(58)
|
||||||
|
sleep(2000)
|
||||||
|
controller.Axes.LX.SetState(63)
|
||||||
|
Accel_On(100)
|
||||||
|
Nitrous_On()
|
||||||
|
}
|
||||||
|
|
||||||
|
If lap_start_end {
|
||||||
|
ToolTipper("Lap Complete")
|
||||||
|
;Tooltip, Lap start-end, 100, 100, screen
|
||||||
|
controller.Axes.LX.SetState(63)
|
||||||
|
Accel_On(100)
|
||||||
|
Nitrous_On()
|
||||||
|
}
|
||||||
|
|
||||||
|
If race_running1 = 0 && race_running2 = 0 && race_running3 = 0
|
||||||
|
{
|
||||||
|
;Tooltip, Out of loop, 100, 100, screen
|
||||||
|
goto RaceComplete
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
RaceComplete:
|
||||||
|
gosub, PauseLoop
|
||||||
|
Press_X()
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
;ToolTip, Racing, 100, 100, Screen
|
||||||
|
break_point := false
|
||||||
|
c1 := BitGrab(pix1x, pix1y+remote_play_offsetY, box_size)
|
||||||
|
for i, c in c1
|
||||||
|
{
|
||||||
|
d1 := Distance(c, color_check1)
|
||||||
|
;ToolTipper( d1 " " pix1y+remote_play_offsetY " " pix1x " " c)
|
||||||
|
if (d1 < tolerance )
|
||||||
|
{
|
||||||
|
break_point := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (break_point)
|
||||||
|
break
|
||||||
|
|
||||||
|
controller.Dpad.SetState("Right")
|
||||||
|
Sleep, 50
|
||||||
|
controller.Dpad.SetState("None")
|
||||||
|
Sleep, 100
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolTipper("Race End")
|
||||||
|
Sleep, 500
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
;Race_PANAM_Complete() {
|
||||||
|
; race_complete := true
|
||||||
|
; return
|
||||||
|
;}
|
||||||
|
|
||||||
|
|
||||||
|
EndRace_PANAM_Def:
|
||||||
@@ -0,0 +1,485 @@
|
|||||||
|
;----------------------------------------------------------------------
|
||||||
|
; // START TOKYO RACE SCRIPT
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
GoTo EndRace_Tokyo_Def
|
||||||
|
Race_Tokyo()
|
||||||
|
{
|
||||||
|
|
||||||
|
; // PIT STOP MANAGER
|
||||||
|
|
||||||
|
; PIT IN LAP (index 0 - Example: Lapping in Lap 5 is VALUE 4)
|
||||||
|
pitlap := 5
|
||||||
|
|
||||||
|
; CHANGE TIRES TO:
|
||||||
|
; 0 = RACING HARD
|
||||||
|
; 1 = INTERMEDIATES
|
||||||
|
tires := 1
|
||||||
|
|
||||||
|
; VARIABLES
|
||||||
|
lapcounter := 0
|
||||||
|
pitstop := 0
|
||||||
|
outlap := 0
|
||||||
|
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
;---------------------------- // LAP 01 -------------------------------
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 01 // CHANGE FUEL MAP TO (LEAN 5) BEFORE RACE STARTS
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Sleep(1000)
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 01 // Changing to Lean (5), 25, 250, Screen
|
||||||
|
loop 4 {
|
||||||
|
Press_Up(delay:=200)
|
||||||
|
sleep, 200
|
||||||
|
}
|
||||||
|
Sleep(6000)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 02 // ACTIVATE ACCELERATION (100%) AND SHIFT TO 7TH GEAR
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 02 // Acceleration ON & Shifting to 7th gear, 25, 250, Screen
|
||||||
|
Accel_On(100)
|
||||||
|
;Nitrous_On()
|
||||||
|
loop 3 {
|
||||||
|
Press_X(delay:=200)
|
||||||
|
sleep, 200
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 03 // TRIGGER FORCED 5 SECOND PENALTY
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 03 // Triggering 5 sec. penalty, 25, 250, Screen
|
||||||
|
Sleep(1000)
|
||||||
|
Turn_Left(1000,10)
|
||||||
|
|
||||||
|
Turn_Left(13000,36)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
;---------------------------- // LAP 02-12 ----------------------------
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 04 // START THE BIG LOOP
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 05 // TRIGGER FORCED 5 SECOND PENALTY AND HUG WALLS UNTIL HAIRPIN
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
; // FIRST LAP
|
||||||
|
if (lapcounter = 0){
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 05.1 // Hugging left wall from straight to turn 1, 25, 250, Screen
|
||||||
|
Turn_Left(25000,36)
|
||||||
|
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 05.2 // Hugging right wall from chicane to hairpin, 25, 250, Screen
|
||||||
|
Turn_Right(20000,72)
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 02+ UNTIL WE DID A PITSTOP
|
||||||
|
if (lapcounter > 0) and (pitstop = 0){
|
||||||
|
ToolTip, [LAP: 02+][PITSTOPS: 0] 05.3 // Hugging left wall from straight to turn 1, 25, 250, Screen
|
||||||
|
Turn_Left(28000,36)
|
||||||
|
|
||||||
|
ToolTip, [LAP: 02+][PITSTOPS: 0] 05.4 // Hugging right wall from chicane to hairpin, 25, 250, Screen
|
||||||
|
Turn_Right(25000,72)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; // OUTLAP AFTER PITSTOP
|
||||||
|
if (outlap = 1){
|
||||||
|
ToolTip, [OUTLAP][LAP: 02+][PITSTOPS: 1] 05.5 // Hugging left wall from straight to turn 1, 25, 250, Screen
|
||||||
|
Turn_Left(34000,36)
|
||||||
|
|
||||||
|
ToolTip, [OUTLAP][LAP: 02+][PITSTOPS: 1] 05.6 // Hugging right wall from chicane to hairpin, 25, 250, Screen
|
||||||
|
Turn_Right(35000,72)
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAPS AFTER PITSTOP AND OUTLAP
|
||||||
|
if (lapcounter > 0) and (pitstop = 1) and (outlap = 0) {
|
||||||
|
ToolTip, [LAP: 02+][PITSTOPS: 1] 05.7 // Hugging left wall from straight to turn 1, 25, 250, Screen
|
||||||
|
Turn_Left(30000,36)
|
||||||
|
|
||||||
|
ToolTip, [LAP: 02+][PITSTOPS: 1] 05.8 // Hugging right wall from chicane to hairpin, 25, 250, Screen
|
||||||
|
Turn_Right(24000,72)
|
||||||
|
|
||||||
|
}
|
||||||
|
outlap := 0
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 06 // LOOKING FOR HAIRPIN -1-
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, // 06 Looking for hairpin -1-, 25, 250, Screen
|
||||||
|
|
||||||
|
color_player := 0xDE6E70
|
||||||
|
hairpin_complete := false
|
||||||
|
hairpinX := 506
|
||||||
|
hairpinY := 72
|
||||||
|
hairpinCount := 0
|
||||||
|
hairpinTolerance := 10
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
|
||||||
|
tc := BitGrab(hairpinX, hairpinY,2)
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_player)
|
||||||
|
if (td < 9 ){
|
||||||
|
hairpin_complete := true
|
||||||
|
hairpinCount += 1
|
||||||
|
ToolTip, 06 // Hairpin -1- found, 25, 250, Screen
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;Turn_Left(300, 30)
|
||||||
|
if( hairpinCount = 1 )
|
||||||
|
break
|
||||||
|
Sleep(100)
|
||||||
|
}
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 07 // IF HAIRPIN -1- FOUND:
|
||||||
|
; 07 // WAIT, THEN:
|
||||||
|
; 07 // HUG LEFT WALL THEN RIGHT UNTIL PEN LINE
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
; // LAP 01 TIMINGS
|
||||||
|
if (lapcounter = 0) {
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 07.1 // Hairpin - turn right 5700 70, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
ToolTip, [LAP: 01][PITSTOPS: 0] 07.2 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 02 TIMINGS
|
||||||
|
if (lapcounter = 1) and (pitstop = 0) {
|
||||||
|
ToolTip, [LAP: 02][PITSTOPS: 0] 07.3 // Hairpin - turn right 5700 70, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
ToolTip, [LAP: 02][PITSTOPS: 0] 07.4 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 03 TIMINGS
|
||||||
|
if (lapcounter = 2) and (pitstop = 0) {
|
||||||
|
ToolTip, [LAP: 03][PITSTOPS: 0] 07.5 // Hairpin - turn right 5700 70 - SLEEP 800, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
|
||||||
|
;Sleep(800)
|
||||||
|
ToolTip, [LAP: 03][PITSTOPS: 0] 07.6 // Hairpin - turn right 12000 65 , 25, 250, Screen
|
||||||
|
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; // LAP 04 TIMINGS
|
||||||
|
if (lapcounter = 3) and (pitstop = 0) {
|
||||||
|
ToolTip, [LAP: 04][PITSTOPS: 0] 07.7 // Hairpin - turn right 5700 70 - SLEEP 1500, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
;Sleep(1500)
|
||||||
|
ToolTip, [LAP: 04][PITSTOPS: 0] 07.8 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
|
||||||
|
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 05 TIMINGS
|
||||||
|
if (lapcounter = 4) and (pitstop = 0) {
|
||||||
|
ToolTip, [LAP: 05][PITSTOPS: 0] 07.9 // Hairpin - turn right 5700 70 - SLEEP 2000, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
;Sleep(2000)
|
||||||
|
ToolTip, [LAP: 05][PITSTOPS: 0] 07.10 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 06 TIMINGS
|
||||||
|
if (lapcounter = 5)
|
||||||
|
|
||||||
|
{
|
||||||
|
ToolTip, [LAP: 06][PITSTOPS: 0] 07.11 // Hairpin - turn right 5700 70 - SLEEP 2400, 25, 250, Screen
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
;Sleep(2400)
|
||||||
|
ToolTip, [LAP: 06][PITSTOPS: 0] 07.12 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 07 TIMINGS
|
||||||
|
if (lapcounter = 6) {
|
||||||
|
ToolTip, [LAP: 07][PITSTOPS: 1] 07.13 // Hairpin - turn right 5700 70, 25, 250, Screen
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
ToolTip, [LAP: 07][PITSTOPS: 1] 07.14 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 08 TIMINGS
|
||||||
|
if (lapcounter = 7) {
|
||||||
|
ToolTip, [LAP: 08][PITSTOPS: 1] 07.15 // Hairpin - turn right 5700 70, 25, 250, Screen
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
ToolTip, [LAP: 08][PITSTOPS: 1] 07.16 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
; // LAP 09 TIMINGS
|
||||||
|
if (lapcounter = 8) {
|
||||||
|
ToolTip, [LAP: 09][PITSTOPS: 1] 07.17 // Hairpin - turn right 5700 70 - SLEEP 800, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
ToolTip, [LAP: 09][PITSTOPS: 1] 07.18 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
;Sleep(800)
|
||||||
|
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 10 TIMINGS
|
||||||
|
if (lapcounter = 9) {
|
||||||
|
ToolTip, [LAP: 10][PITSTOPS: 1] 07.19 // Hairpin - turn right 5700 70 - SLEEP 1500, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
;Sleep(1500)
|
||||||
|
ToolTip, [LAP: 10][PITSTOPS: 1] 07.20 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 11 TIMINGS
|
||||||
|
if (lapcounter = 10) {
|
||||||
|
ToolTip, [LAP: 11][PITSTOPS: 1] 07.21 // Hairpin - turn right 5700 70 - SLEEP 2000, 25, 250, Screen
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
;Sleep(2000)
|
||||||
|
ToolTip, [LAP: 11][PITSTOPS: 1] 07.22 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
; // LAP 12 TIMINGS
|
||||||
|
if (lapcounter = 11) {
|
||||||
|
ToolTip, [LAP: 12][PITSTOPS: 1] 07.23 // Hairpin - turn right 5700 70 - SLEEP 2400, 25, 250, Screen
|
||||||
|
Accel_On(55)
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
;Sleep(2400)
|
||||||
|
ToolTip, [LAP: 12][PITSTOPS: 1] 07.24 // Hairpin - turn right 12000 65, 25, 250, Screen
|
||||||
|
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
Turn_Right(6000,65)
|
||||||
|
|
||||||
|
;OLD
|
||||||
|
;Turn_Right(12000,65)
|
||||||
|
|
||||||
|
; // DRIVE IT HOME BABY
|
||||||
|
Turn_Right(30000,65)
|
||||||
|
}
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 08 // LOOKING FOR HAIRPIN -2-
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, 08.1 // Looking for hairpin -2-, 25, 250, Screen
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
|
||||||
|
tc := BitGrab(hairpinX, hairpinY,2)
|
||||||
|
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_player)
|
||||||
|
if (td < 20 ){
|
||||||
|
hairpin_complete := true
|
||||||
|
hairpinCount += 1
|
||||||
|
ToolTip, 08.2 // Hairpin Found, 25, 250, Screen
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
;Turn_Left(300, 30)
|
||||||
|
if( hairpinCount = 2 )
|
||||||
|
break
|
||||||
|
Sleep(100)
|
||||||
|
}
|
||||||
|
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
hairpinCount := 0
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 09 // IF HAIRPIN -2- FOUND:
|
||||||
|
; 09 // START CHECK FOR LAPCOUNTER FOR PIT, IF TRUE START PIT ROUTINE
|
||||||
|
; 09 // ELSE SETUP FORCED PEN TRIGGER
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Turn_Left(1000, 40)
|
||||||
|
;Turn_Right(300,65)
|
||||||
|
|
||||||
|
if (pitlap = lapcounter){
|
||||||
|
controller.Axes.LX.SetState(35)
|
||||||
|
|
||||||
|
ToolTip, [LAP: 02+][PITSTOPS: 0] 09.1 // Pitstop starting, 25, 250, Screen
|
||||||
|
Turn_Right(1000, 60)
|
||||||
|
controller.Axes.LX.SetState(40)
|
||||||
|
Sleep (5000)
|
||||||
|
controller.Axes.LX.SetState(0)
|
||||||
|
Sleep (20000)
|
||||||
|
Press_Up()
|
||||||
|
Sleep (100)
|
||||||
|
|
||||||
|
if (tires = 0) {
|
||||||
|
; // RACING HARD
|
||||||
|
ToolTip, 09.2 // CHANGING TO RACING HARD, 25, 250, Screen
|
||||||
|
loop, 5{
|
||||||
|
Press_Left()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tires = 1) {
|
||||||
|
; // INTERMEDIATES
|
||||||
|
ToolTip, 09.3 // CHANGING TO INTERMEDIATES, 25, 250, Screen
|
||||||
|
Press_Right()
|
||||||
|
}
|
||||||
|
|
||||||
|
Press_X()
|
||||||
|
|
||||||
|
|
||||||
|
; REFILL
|
||||||
|
;Press_Down()
|
||||||
|
;Press_X()
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
|
||||||
|
Sleep, 18000
|
||||||
|
ToolTip, [LAP: 02+][PITSTOPS: 0] 09.4 // // LEAVING PIT - TRIGGER PEN & SHIFTING TO 7TH GEAR, 25, 250, Screen
|
||||||
|
Turn_Left(3000,0)
|
||||||
|
controller.Axes.LX.SetState(20)
|
||||||
|
loop 4 {
|
||||||
|
Press_X(delay:=200)
|
||||||
|
sleep, 200
|
||||||
|
}
|
||||||
|
|
||||||
|
pitstop := 1
|
||||||
|
outlap := 1
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
/*
|
||||||
|
; //NEW PEN TRIGGER LOGIC, NEEDS TESTING/TIMINGS
|
||||||
|
Turn_Left(2000,30)
|
||||||
|
controller.Axes.LX.SetState(0)
|
||||||
|
|
||||||
|
ToolTip, 09.4 // Triggering 5 sec. penalty, 25, 250, Screen
|
||||||
|
Sleep, 3000
|
||||||
|
controller.Axes.LX.SetState(59)
|
||||||
|
Sleep, 15000
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
; // PEN TRIGGER LOGIC (UNSTABLE)
|
||||||
|
|
||||||
|
Sleep(5000)
|
||||||
|
Turn_Left(1000, 40)
|
||||||
|
Brake_on(100)
|
||||||
|
Accel_Off()
|
||||||
|
Sleep(3000)
|
||||||
|
|
||||||
|
ToolTip, 09.5 // Triggering 5 sec. penalty, 25, 250, Screen
|
||||||
|
controller.Axes.LX.SetState(70)
|
||||||
|
Brake_off()
|
||||||
|
Nitrous_On()
|
||||||
|
Accel_On(100)
|
||||||
|
Sleep(3000)
|
||||||
|
Turn_Right(2000, 90)
|
||||||
|
Turn_Right(11000, 65)
|
||||||
|
Sleep(3000)
|
||||||
|
Nitrous_Off()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 55 // CLOSE LOOP LAP 1-12
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
lapcounter++
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; 99 // CLOSE RACE SCRIPT
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
}
|
||||||
|
EndRace_Tokyo_Def:
|
||||||
@@ -0,0 +1,296 @@
|
|||||||
|
;----------------------------------------------------------------------
|
||||||
|
; // START TOKYO RACE SCRIPT
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
GoTo EndRace_Tokyo_Def
|
||||||
|
Race_Tokyo()
|
||||||
|
{
|
||||||
|
; VARIABLES
|
||||||
|
lapcounter := 0
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
;---------------------------- // LAP 01 -------------------------------
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /1/ CHANGE FUEL MAP TO (LEAN 5) BEFORE RACE STARTS
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Sleep(1000)
|
||||||
|
ToolTip, /1/ Changing to Lean (5) //, 22, 70, Screen
|
||||||
|
loop 4 {
|
||||||
|
Press_Up(delay:=200)
|
||||||
|
sleep, 200
|
||||||
|
}
|
||||||
|
Sleep(6000)
|
||||||
|
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /2/ ACTIVATE ACCELERATION (100%) AND SHIFT TO 7TH GEAR
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, /2/ Acceleration ON & Shifting to 7th gear //, 22, 70, Screen
|
||||||
|
Accel_On(100)
|
||||||
|
;Nitrous_On()
|
||||||
|
loop 3 {
|
||||||
|
Press_X(delay:=200)
|
||||||
|
sleep, 200
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /3/ TRIGGER FORCED 5 SECOND PENALTY
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, /3/ Triggering 5 sec. penalty //, 22, 70, Screen
|
||||||
|
Sleep(1000)
|
||||||
|
Turn_Left(1000,10)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /4/ CHECK IF WE GOT THE 5 SEC PENALTY
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
/*
|
||||||
|
loop {
|
||||||
|
gosub, CheckPenalty
|
||||||
|
|
||||||
|
if( Penalty_triggered = true)
|
||||||
|
break
|
||||||
|
Sleep(100)
|
||||||
|
}
|
||||||
|
ToolTip, /4/ PENALTY RECEIVED //, 22, 70, Screen
|
||||||
|
Sleep(5000)
|
||||||
|
*/
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /5/ WAIT, THEN STEERING TO THE LEFT SIDE TO:
|
||||||
|
; /5/ OVERTAKE CARS LEFT, GRIND WALL, TAKE T1 FROM LEFT
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
;---------------------------- // LAP 02-12 ----------------------------
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /6/ START THE BIG LOOP
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
Turn_Left(12000,36)
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /7/ TRIGGER FORCED 5 SECOND PENALTY
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
if (lapcounter > 0)
|
||||||
|
{
|
||||||
|
ToolTip, /7.1/ Triggering 5 sec. penalty after tunnel //, 22, 70, Screen
|
||||||
|
ToolTip, /7.2/ HALF Acceleration for 3 sec //, 22, 70, Screen
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolTip, 5.1 // Hugging left wall from straight to chicane //, 22, 70, Screen
|
||||||
|
Turn_Left(26000,36)
|
||||||
|
|
||||||
|
ToolTip, 5.2 // Hugging right wall from chicane to hairpin //, 22, 70, Screen
|
||||||
|
Turn_Right(33000,72)
|
||||||
|
|
||||||
|
/*
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /9/ START THE CHICANE SEARCH LOOP
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
ToolTip, /9/ Turn right through chicane //, 22, 70, Screen
|
||||||
|
Turn_Right(15000,75)
|
||||||
|
ToolTip, /9/ Looking for Chicane //, 22, 70, Screen
|
||||||
|
loop {
|
||||||
|
gosub, CheckChicane
|
||||||
|
|
||||||
|
if( Chicane_complete = true)
|
||||||
|
break
|
||||||
|
Sleep(100)
|
||||||
|
}
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /10/ IF CHICANE FOUND:
|
||||||
|
; /10/ WAIT, THEN:
|
||||||
|
; /10/ ACCELERATION & NITRO OFF, TURN RIGHT, ACCELERATION & NITRO ON, WAIT
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Sleep(1550)
|
||||||
|
ToolTip, /10/ Acceleration & Nitro OFF //, 22, 70, Screen
|
||||||
|
Nitrous_Off()
|
||||||
|
Accel_Off()
|
||||||
|
ToolTip, /10/ Turning left //, 22, 70, Screen
|
||||||
|
Turn_Left(1500,15)
|
||||||
|
ToolTip, /10/ Acceleration & Nitro ON //, 22, 70, Screen
|
||||||
|
Accel_On(100)
|
||||||
|
Nitrous_On()
|
||||||
|
gosub, ResetChicane
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /11/ START THE HAIRPIN SEARCH LOOP
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, /11/ Looking for hairpin, 22, 70, Screen
|
||||||
|
|
||||||
|
color_player := 0xDE6E70
|
||||||
|
hairpin_complete := false
|
||||||
|
hairpinX := 506
|
||||||
|
hairpinY := 72
|
||||||
|
hairpinCount := 0
|
||||||
|
hairpinTolerance := 10
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
|
||||||
|
tc := BitGrab(hairpinX, hairpinY,2)
|
||||||
|
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_player)
|
||||||
|
if (td < 9 ){
|
||||||
|
hairpin_complete := true
|
||||||
|
hairpinCount += 1
|
||||||
|
ToolTip, /11/ Hairpin Found, 22, 70, Screen
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;Turn_Left(300, 30)
|
||||||
|
if( hairpinCount = 1 )
|
||||||
|
break
|
||||||
|
Sleep(100)
|
||||||
|
}
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /12/ IF HAIRPIN (1) FOUND:
|
||||||
|
; /12/ WAIT, THEN:
|
||||||
|
; /12/ HUG THE LEFT WALL TO GET 90° BUMPS
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
;ToolTip, /12/ Turning left for corner bumps //, 22, 70, Screen
|
||||||
|
;Turn_Left(20000, 25)
|
||||||
|
|
||||||
|
|
||||||
|
ToolTip, /12/ Hairpin - turn right 5700 70 //, 100, 100, Screen
|
||||||
|
|
||||||
|
Turn_Right(5700,70)
|
||||||
|
Accel_On(75)
|
||||||
|
ToolTip, /12/ Hairpin - turn right 12000 60 //, 100, 100, Screen
|
||||||
|
Turn_Right(5000,70 + lapcounter)
|
||||||
|
Sleep(1000)
|
||||||
|
Turn_Right(5000,65)
|
||||||
|
Accel_On(100)
|
||||||
|
ToolTip, /12/ Sleep //, 100, 100, Screen
|
||||||
|
Sleep(3000)
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
|
||||||
|
tc := BitGrab(hairpinX, hairpinY,2)
|
||||||
|
|
||||||
|
for i, c in tc
|
||||||
|
{
|
||||||
|
td := Distance(c, color_player)
|
||||||
|
if (td < 20 ){
|
||||||
|
hairpin_complete := true
|
||||||
|
hairpinCount += 1
|
||||||
|
ToolTip, /11/ Hairpin Found, 100, 100, Screen
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;Turn_Left(300, 30)
|
||||||
|
if( hairpinCount = 2 )
|
||||||
|
break
|
||||||
|
Sleep(100)
|
||||||
|
}
|
||||||
|
ToolTip, LX 65, 22, 70, Screen
|
||||||
|
|
||||||
|
if (lapcounter = 4){
|
||||||
|
controller.Axes.LX.SetState(35)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
controller.Axes.LX.SetState(65)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Sleep(4650)
|
||||||
|
|
||||||
|
hairpinCount := 0
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /13/ HUG THE RIGHT WALL TO AVOID THE PIT ENTRANCE
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
ToolTip, Left 300 - Right 300, 100, 100, Screen
|
||||||
|
|
||||||
|
|
||||||
|
;Turn_Right(300,65)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /7/ TRIGGER FORCED 5 SECOND PENALTY
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
if (lapcounter = 4){
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /20/ MAKE PIT STOP CHANGE TIRES
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
ToolTip, Heading to pit, 100, 100, Screen
|
||||||
|
;Turn_Right(800, 60)
|
||||||
|
controller.Axes.LX.SetState(0)
|
||||||
|
Accel_On()
|
||||||
|
Brake_off()
|
||||||
|
Sleep, 17000
|
||||||
|
Turn_Left(5000, 20)
|
||||||
|
ToolTip, Changing tires, 100, 100, Screen
|
||||||
|
Press_Up()
|
||||||
|
loop, 5{
|
||||||
|
Press_Left()
|
||||||
|
}
|
||||||
|
Press_X()
|
||||||
|
Press_Down()
|
||||||
|
Press_X()
|
||||||
|
controller.Axes.LX.SetState(50)
|
||||||
|
Sleep, 12000
|
||||||
|
ToolTip, Leaving Pit, 100, 100, Screen
|
||||||
|
loop 4 {
|
||||||
|
Press_X(delay:=200)
|
||||||
|
sleep, 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Accel_Off()
|
||||||
|
Brake_on(100)
|
||||||
|
Turn_Left(950, 40)
|
||||||
|
Sleep(3000)
|
||||||
|
|
||||||
|
controller.Axes.LX.SetState(70)
|
||||||
|
Brake_off()
|
||||||
|
Nitrous_On()
|
||||||
|
Accel_On(100)
|
||||||
|
Sleep(3000)
|
||||||
|
Turn_Right(2000, 90)
|
||||||
|
Turn_Right(11000, 65)
|
||||||
|
Sleep(3000)
|
||||||
|
|
||||||
|
Nitrous_Off()
|
||||||
|
}
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /55/ CLOSE LOOP LAP 1-12
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
lapcounter++
|
||||||
|
ToolTip, /55/ LAP %lapcounter%, 100, 100, Screen
|
||||||
|
}
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
; /99/ CLOSE RACE SCRIPT
|
||||||
|
;----------------------------------------------------------------------
|
||||||
|
|
||||||
|
}
|
||||||
|
EndRace_Tokyo_Def:
|
||||||
|
After Width: | Height: | Size: 261 KiB |
|
After Width: | Height: | Size: 267 KiB |
|
After Width: | Height: | Size: 272 KiB |
|
After Width: | Height: | Size: 314 KiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 61 KiB |