Skip to content

Commit f68b209

Browse files
committed
Fix bug in bot framework for EVE Online that caused larger session logs
Fix a bug in the bot framework for EVE Online that prevented the removal of unused screenshots from the play session recording when run in combination with the current BotLab client. The retention of the whole last reading from the game client in the state removed with this commit meant that we did not achieve convergence for reduced agent events in the session as quickly anymore. The event reduction reduces pixel data, so the retention of the whole reading in the state meant that the state would differ initially. Convergence was only achieved after completing the following reading from the game client. However, the BotLab client only searched for convergence up to three events. Therefore, it did not reach convergence anymore in practice. This commit resolves the convergence complications by removing the general retention of superfluous parts of the reading from the game client. It only keeps the offset needed for the placement of pointer effects.
1 parent b50e702 commit f68b209

File tree

9 files changed

+49
-44
lines changed

9 files changed

+49
-44
lines changed

implement/applications/eve-online/eve-online-combat-anomaly-bot/Bot.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{- EVE Online combat anomaly bot version 2024-11-08
1+
{- EVE Online combat anomaly bot version 2024-11-15
22
33
This bot uses the probe scanner to find combat anomalies and kills rats using drones and weapon modules.
44

implement/applications/eve-online/eve-online-combat-anomaly-bot/EveOnline/BotFramework.elm

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type alias SetupState =
128128
, searchUIRootAddressResponse :
129129
Maybe { timeInMilliseconds : Int, response : VolatileProcessInterface.SearchUIRootAddressResponseStruct }
130130
, lastReadingFromGame : Maybe { timeInMilliseconds : Int, stage : ReadingFromGameState }
131-
, lastReadFromGameComplete : Maybe InterfaceToHost.ReadFromWindowCompleteStruct
131+
, lastReadFromGameClientRectLeftUpperToScreen : Maybe InterfaceToHost.WinApiPointStruct
132132
, lastEffectFailedToAcquireInputFocus : Maybe String
133133
, randomIntegers : List Int
134134
}
@@ -474,7 +474,7 @@ initSetup =
474474
, gameClientProcesses = Nothing
475475
, searchUIRootAddressResponse = Nothing
476476
, lastReadingFromGame = Nothing
477-
, lastReadFromGameComplete = Nothing
477+
, lastReadFromGameClientRectLeftUpperToScreen = Nothing
478478
, lastEffectFailedToAcquireInputFocus = Nothing
479479
, randomIntegers = []
480480
}
@@ -1294,7 +1294,8 @@ integrateReadFromWindowComplete { timeInMilliseconds, readFromWindowComplete } s
12941294
{ timeInMilliseconds = readingTimeInMilliseconds
12951295
, stage = ReadingFromGameInProgress inProgress
12961296
}
1297-
, lastReadFromGameComplete = Just readFromWindowComplete
1297+
, lastReadFromGameClientRectLeftUpperToScreen =
1298+
Just readFromWindowComplete.clientRectLeftUpperToScreen
12981299
}
12991300

13001301

@@ -1496,19 +1497,19 @@ getSetupTaskWhenVolatileProcessSetupCompleted { timeInMilliseconds } botConfigur
14961497
OperateBot
14971498
{ buildTaskFromEffectSequence =
14981499
\effectSequenceOnWindow ->
1499-
case stateBefore.lastReadFromGameComplete of
1500+
case stateBefore.lastReadFromGameClientRectLeftUpperToScreen of
15001501
Nothing ->
15011502
InterfaceToHost.WindowsInputRequest []
15021503

1503-
Just lastReadFromGameComplete ->
1504+
Just lastReadFromGameClientRectLeftUpperToScreen ->
15041505
InterfaceToHost.WindowsInputRequest
15051506
(List.concat
15061507
[ [ InterfaceToHost.BringWindowToForeground
15071508
("winapi/" ++ gameClientSelection.selectedProcess.mainWindowId)
15081509
, InterfaceToHost.WaitMilliseconds 100
15091510
]
15101511
, effectSequenceOnWindow
1511-
|> List.map (effectOnWindowAsWindowsInputSequenceItem lastReadFromGameComplete)
1512+
|> List.map (effectOnWindowAsWindowsInputSequenceItem lastReadFromGameClientRectLeftUpperToScreen)
15121513
|> List.intersperse (InterfaceToHost.WaitMilliseconds 210)
15131514
]
15141515
)
@@ -1544,15 +1545,15 @@ getSetupTaskWhenVolatileProcessSetupCompleted { timeInMilliseconds } botConfigur
15441545

15451546

15461547
effectOnWindowAsWindowsInputSequenceItem :
1547-
InterfaceToHost.ReadFromWindowCompleteStruct
1548+
InterfaceToHost.WinApiPointStruct
15481549
-> Common.EffectOnWindow.EffectOnWindowStruct
15491550
-> InterfaceToHost.WindowsInputSequenceItem
1550-
effectOnWindowAsWindowsInputSequenceItem readFromWindow effectOnWindow =
1551+
effectOnWindowAsWindowsInputSequenceItem lastReadFromGameClientRectLeftUpperToScreen effectOnWindow =
15511552
case effectOnWindow of
15521553
Common.EffectOnWindow.MouseMoveTo mouseMoveTo ->
15531554
let
15541555
clientRectOffset =
1555-
readFromWindow.clientRectLeftUpperToScreen
1556+
lastReadFromGameClientRectLeftUpperToScreen
15561557

15571558
mouseMoveToInClientArea =
15581559
{ x = mouseMoveTo.x + clientRectOffset.x

implement/applications/eve-online/eve-online-combat-anomaly-bot/EveOnline/UnstuckBot.elm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type alias UnstuckBotState supervised =
1919
, lastReadFromWindowComplete :
2020
Maybe
2121
{ windowId : String
22-
, reading : InterfaceToHost.ReadFromWindowCompleteStruct
22+
, clientRectLeftUpperToScreen : InterfaceToHost.WinApiPointStruct
2323
}
2424
}
2525

@@ -54,7 +54,8 @@ processEventResolvingStuck config event stateBefore =
5454
InterfaceToHost.InvokeMethodOnWindowResponse windowId (Ok (InterfaceToHost.ReadFromWindowMethodResult readFromWindowComplete)) ->
5555
Just
5656
{ windowId = windowId
57-
, reading = readFromWindowComplete
57+
, clientRectLeftUpperToScreen =
58+
readFromWindowComplete.clientRectLeftUpperToScreen
5859
}
5960

6061
_ ->
@@ -116,8 +117,8 @@ processEventResolvingStuck config event stateBefore =
116117
Just readFromWindowComplete ->
117118
let
118119
mouseClickLocation =
119-
{ x = readFromWindowComplete.reading.clientRectLeftUpperToScreen.x + 10
120-
, y = readFromWindowComplete.reading.clientRectLeftUpperToScreen.y + 10
120+
{ x = readFromWindowComplete.clientRectLeftUpperToScreen.x + 10
121+
, y = readFromWindowComplete.clientRectLeftUpperToScreen.y + 10
121122
}
122123

123124
windowId =

implement/applications/eve-online/eve-online-local-watch/Bot.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{- EVE Online Intel Bot - Local Watch Script - 2024-11-09
1+
{- EVE Online Intel Bot - Local Watch Script - 2024-12-01
22
33
This bot watches local and plays an alarm sound when a pilot with bad standing appears.
44
-}

implement/applications/eve-online/eve-online-local-watch/EveOnline/BotFramework.elm

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type alias SetupState =
128128
, searchUIRootAddressResponse :
129129
Maybe { timeInMilliseconds : Int, response : VolatileProcessInterface.SearchUIRootAddressResponseStruct }
130130
, lastReadingFromGame : Maybe { timeInMilliseconds : Int, stage : ReadingFromGameState }
131-
, lastReadFromGameComplete : Maybe InterfaceToHost.ReadFromWindowCompleteStruct
131+
, lastReadFromGameClientRectLeftUpperToScreen : Maybe InterfaceToHost.WinApiPointStruct
132132
, lastEffectFailedToAcquireInputFocus : Maybe String
133133
, randomIntegers : List Int
134134
}
@@ -475,7 +475,7 @@ initSetup =
475475
, gameClientProcesses = Nothing
476476
, searchUIRootAddressResponse = Nothing
477477
, lastReadingFromGame = Nothing
478-
, lastReadFromGameComplete = Nothing
478+
, lastReadFromGameClientRectLeftUpperToScreen = Nothing
479479
, lastEffectFailedToAcquireInputFocus = Nothing
480480
, randomIntegers = []
481481
}
@@ -1295,7 +1295,8 @@ integrateReadFromWindowComplete { timeInMilliseconds, readFromWindowComplete } s
12951295
{ timeInMilliseconds = readingTimeInMilliseconds
12961296
, stage = ReadingFromGameInProgress inProgress
12971297
}
1298-
, lastReadFromGameComplete = Just readFromWindowComplete
1298+
, lastReadFromGameClientRectLeftUpperToScreen =
1299+
Just readFromWindowComplete.clientRectLeftUpperToScreen
12991300
}
13001301

13011302

@@ -1497,19 +1498,19 @@ getSetupTaskWhenVolatileProcessSetupCompleted { timeInMilliseconds } botConfigur
14971498
OperateBot
14981499
{ buildTaskFromEffectSequence =
14991500
\effectSequenceOnWindow ->
1500-
case stateBefore.lastReadFromGameComplete of
1501+
case stateBefore.lastReadFromGameClientRectLeftUpperToScreen of
15011502
Nothing ->
15021503
InterfaceToHost.WindowsInputRequest []
15031504

1504-
Just lastReadFromGameComplete ->
1505+
Just lastReadFromGameClientRectLeftUpperToScreen ->
15051506
InterfaceToHost.WindowsInputRequest
15061507
(List.concat
15071508
[ [ InterfaceToHost.BringWindowToForeground
15081509
("winapi/" ++ gameClientSelection.selectedProcess.mainWindowId)
15091510
, InterfaceToHost.WaitMilliseconds 100
15101511
]
15111512
, effectSequenceOnWindow
1512-
|> List.map (effectOnWindowAsWindowsInputSequenceItem lastReadFromGameComplete)
1513+
|> List.map (effectOnWindowAsWindowsInputSequenceItem lastReadFromGameClientRectLeftUpperToScreen)
15131514
|> List.intersperse (InterfaceToHost.WaitMilliseconds 210)
15141515
]
15151516
)
@@ -1545,15 +1546,15 @@ getSetupTaskWhenVolatileProcessSetupCompleted { timeInMilliseconds } botConfigur
15451546

15461547

15471548
effectOnWindowAsWindowsInputSequenceItem :
1548-
InterfaceToHost.ReadFromWindowCompleteStruct
1549+
InterfaceToHost.WinApiPointStruct
15491550
-> Common.EffectOnWindow.EffectOnWindowStruct
15501551
-> InterfaceToHost.WindowsInputSequenceItem
1551-
effectOnWindowAsWindowsInputSequenceItem readFromWindow effectOnWindow =
1552+
effectOnWindowAsWindowsInputSequenceItem lastReadFromGameClientRectLeftUpperToScreen effectOnWindow =
15521553
case effectOnWindow of
15531554
Common.EffectOnWindow.MouseMoveTo mouseMoveTo ->
15541555
let
15551556
clientRectOffset =
1556-
readFromWindow.clientRectLeftUpperToScreen
1557+
lastReadFromGameClientRectLeftUpperToScreen
15571558

15581559
mouseMoveToInClientArea =
15591560
{ x = mouseMoveTo.x + clientRectOffset.x

implement/applications/eve-online/eve-online-mining-bot/Bot.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{- EVE Online mining bot version 2024-10-26
1+
{- EVE Online mining bot version 2024-11-15
22
33
This bot automates the complete mining process, including offloading the ore and traveling between the mining spot and the unloading location.
44

implement/applications/eve-online/eve-online-mining-bot/EveOnline/BotFramework.elm

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type alias SetupState =
128128
, searchUIRootAddressResponse :
129129
Maybe { timeInMilliseconds : Int, response : VolatileProcessInterface.SearchUIRootAddressResponseStruct }
130130
, lastReadingFromGame : Maybe { timeInMilliseconds : Int, stage : ReadingFromGameState }
131-
, lastReadFromGameComplete : Maybe InterfaceToHost.ReadFromWindowCompleteStruct
131+
, lastReadFromGameClientRectLeftUpperToScreen : Maybe InterfaceToHost.WinApiPointStruct
132132
, lastEffectFailedToAcquireInputFocus : Maybe String
133133
, randomIntegers : List Int
134134
}
@@ -475,7 +475,7 @@ initSetup =
475475
, gameClientProcesses = Nothing
476476
, searchUIRootAddressResponse = Nothing
477477
, lastReadingFromGame = Nothing
478-
, lastReadFromGameComplete = Nothing
478+
, lastReadFromGameClientRectLeftUpperToScreen = Nothing
479479
, lastEffectFailedToAcquireInputFocus = Nothing
480480
, randomIntegers = []
481481
}
@@ -1295,7 +1295,8 @@ integrateReadFromWindowComplete { timeInMilliseconds, readFromWindowComplete } s
12951295
{ timeInMilliseconds = readingTimeInMilliseconds
12961296
, stage = ReadingFromGameInProgress inProgress
12971297
}
1298-
, lastReadFromGameComplete = Just readFromWindowComplete
1298+
, lastReadFromGameClientRectLeftUpperToScreen =
1299+
Just readFromWindowComplete.clientRectLeftUpperToScreen
12991300
}
13001301

13011302

@@ -1497,19 +1498,19 @@ getSetupTaskWhenVolatileProcessSetupCompleted { timeInMilliseconds } botConfigur
14971498
OperateBot
14981499
{ buildTaskFromEffectSequence =
14991500
\effectSequenceOnWindow ->
1500-
case stateBefore.lastReadFromGameComplete of
1501+
case stateBefore.lastReadFromGameClientRectLeftUpperToScreen of
15011502
Nothing ->
15021503
InterfaceToHost.WindowsInputRequest []
15031504

1504-
Just lastReadFromGameComplete ->
1505+
Just lastReadFromGameClientRectLeftUpperToScreen ->
15051506
InterfaceToHost.WindowsInputRequest
15061507
(List.concat
15071508
[ [ InterfaceToHost.BringWindowToForeground
15081509
("winapi/" ++ gameClientSelection.selectedProcess.mainWindowId)
15091510
, InterfaceToHost.WaitMilliseconds 100
15101511
]
15111512
, effectSequenceOnWindow
1512-
|> List.map (effectOnWindowAsWindowsInputSequenceItem lastReadFromGameComplete)
1513+
|> List.map (effectOnWindowAsWindowsInputSequenceItem lastReadFromGameClientRectLeftUpperToScreen)
15131514
|> List.intersperse (InterfaceToHost.WaitMilliseconds 210)
15141515
]
15151516
)
@@ -1545,15 +1546,15 @@ getSetupTaskWhenVolatileProcessSetupCompleted { timeInMilliseconds } botConfigur
15451546

15461547

15471548
effectOnWindowAsWindowsInputSequenceItem :
1548-
InterfaceToHost.ReadFromWindowCompleteStruct
1549+
InterfaceToHost.WinApiPointStruct
15491550
-> Common.EffectOnWindow.EffectOnWindowStruct
15501551
-> InterfaceToHost.WindowsInputSequenceItem
1551-
effectOnWindowAsWindowsInputSequenceItem readFromWindow effectOnWindow =
1552+
effectOnWindowAsWindowsInputSequenceItem lastReadFromGameClientRectLeftUpperToScreen effectOnWindow =
15521553
case effectOnWindow of
15531554
Common.EffectOnWindow.MouseMoveTo mouseMoveTo ->
15541555
let
15551556
clientRectOffset =
1556-
readFromWindow.clientRectLeftUpperToScreen
1557+
lastReadFromGameClientRectLeftUpperToScreen
15571558

15581559
mouseMoveToInClientArea =
15591560
{ x = mouseMoveTo.x + clientRectOffset.x

implement/applications/eve-online/eve-online-warp-to-0-autopilot/Bot.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{- EVE Online warp-to-0 auto-pilot version 2024-10-21
1+
{- EVE Online warp-to-0 auto-pilot version 2024-11-15
22
33
This bot makes your travels faster and safer by directly warping to gates/stations. It follows the route set in the in-game autopilot and uses the context menu to initiate jump and dock commands.
44

0 commit comments

Comments
 (0)