mirror of
https://github.com/bnowakow/GT7-Scripts.git
synced 2025-12-19 10:37:03 +00:00
adjust timmings, add debug code to simulate constant timeouts
This commit is contained in:
@@ -22,10 +22,25 @@ TurnTolerance := 10
|
|||||||
|
|
||||||
GoTo EndTurnDef
|
GoTo EndTurnDef
|
||||||
|
|
||||||
CheckTurn(x,y, timeout := 3500, b_size := 2)
|
CheckTurn(x,y, timeout := 3400, b_size := 2)
|
||||||
{
|
{
|
||||||
check_turn_start_tick_count := A_TickCount
|
check_turn_start_tick_count := A_TickCount
|
||||||
;ToolTipper("A_TickCount at the begining of CheckTurn " A_TickCount, 100, 150)
|
;ToolTipper("A_TickCount at the begining of CheckTurn " A_TickCount, 100, 150)
|
||||||
|
|
||||||
|
; below is only to simulate constant timeouts
|
||||||
|
; debug start
|
||||||
|
/*
|
||||||
|
loop {
|
||||||
|
check_turn_now_tick_count := A_TickCount
|
||||||
|
check_turn_tick_count_from_start_to_now := check_turn_now_tick_count - check_turn_start_tick_count
|
||||||
|
if (check_turn_tick_count_from_start_to_now > timeout) {
|
||||||
|
ToolTipper("DEBUG Turn Check Timeout exceeded " A_TickCount, 100, 200)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
sleep(500)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
; debug end
|
||||||
|
|
||||||
color_player := 0xDE6E70
|
color_player := 0xDE6E70
|
||||||
if (__enableTurn_mod__ = 0){
|
if (__enableTurn_mod__ = 0){
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Race_PANAM()
|
|||||||
|
|
||||||
; Retry race if time is taking more than 5.5 mins
|
; Retry race if time is taking more than 5.5 mins
|
||||||
; (assume something went wrong with race)
|
; (assume something went wrong with race)
|
||||||
;SetTimer, RetryRace, 330000
|
SetTimer, RetryRace, 330000
|
||||||
|
|
||||||
Sleep (race_start_delay)
|
Sleep (race_start_delay)
|
||||||
controller.Axes.LX.SetState(62) /* before turn 1, to avoid queue of cars */
|
controller.Axes.LX.SetState(62) /* before turn 1, to avoid queue of cars */
|
||||||
@@ -55,11 +55,11 @@ Race_PANAM()
|
|||||||
; Tooltip
|
; Tooltip
|
||||||
|
|
||||||
turn_one_end_found := false
|
turn_one_end_found := false
|
||||||
if (CheckTurn(turn1.startX, turn1.startY))
|
if (CheckTurn(turn1.startX, turn1.startY, 3100))
|
||||||
{
|
{
|
||||||
turn_one_end_found := true
|
turn_one_end_found := true
|
||||||
ToolTipper("Turn 1 start found")
|
ToolTipper("Turn 1 start found")
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
if( A_Index != 1){
|
if( A_Index != 1){
|
||||||
Nitrous_Off()
|
Nitrous_Off()
|
||||||
@@ -67,15 +67,15 @@ Race_PANAM()
|
|||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
controller.Axes.LX.SetState(18-3*%A_Index%)
|
||||||
controller.Axes.LX.SetState(18-3*%A_Index%)
|
}
|
||||||
;Sleep(500)
|
;Sleep(500)
|
||||||
Accel_On(100)
|
Accel_On(100)
|
||||||
|
|
||||||
|
|
||||||
turn_one_end_found := false
|
turn_one_end_found := false
|
||||||
turn_one_end_found := true ; debug TODO check if wheels are curved
|
turn_one_end_found := true ; debug TODO check if wheels are curved
|
||||||
if (CheckTurn(turn1.endX, turn1.endY))
|
if (CheckTurn(turn1.endX, turn1.endY, 2300))
|
||||||
{
|
{
|
||||||
turn_one_end_found := true
|
turn_one_end_found := true
|
||||||
ToolTipper("Turn 1 end found")
|
ToolTipper("Turn 1 end found")
|
||||||
@@ -98,7 +98,7 @@ Race_PANAM()
|
|||||||
turn_two_start_found := false
|
turn_two_start_found := false
|
||||||
; Turn 2
|
; Turn 2
|
||||||
if( A_Index = 1 || A_Index = 6){
|
if( A_Index = 1 || A_Index = 6){
|
||||||
if (CheckTurn(turn2.startX, turn2.startY, 5000))
|
if (CheckTurn(turn2.startX, turn2.startY, 3900))
|
||||||
{
|
{
|
||||||
turn_two_start_found := true
|
turn_two_start_found := true
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ Race_PANAM()
|
|||||||
|
|
||||||
turn_two_end_found := false
|
turn_two_end_found := false
|
||||||
turn_two_end_found := true ; debug TODO check if wheels are curved
|
turn_two_end_found := true ; debug TODO check if wheels are curved
|
||||||
if (CheckTurn(turn2.endX, turn2.endY))
|
if (CheckTurn(turn2.endX, turn2.endY, 2500))
|
||||||
{
|
{
|
||||||
turn_two_end_found := true
|
turn_two_end_found := true
|
||||||
ToolTipper("Turn 2 end found")
|
ToolTipper("Turn 2 end found")
|
||||||
|
|||||||
Reference in New Issue
Block a user