From ee8ed15734431ed8e644333b55c06bd0e5cb697c Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Wed, 8 Apr 2015 01:53:24 -0700 Subject: [PATCH] Simplify Max Ether and add failsafe --- ai/red/strategies.lua | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/ai/red/strategies.lua b/ai/red/strategies.lua index cba7fe3..1599e03 100644 --- a/ai/red/strategies.lua +++ b/ai/red/strategies.lua @@ -1971,25 +1971,21 @@ strategyFunctions.ether = function(data) end strategyFunctions.pickMaxEther = function() - if not status.canProgress then - if maxEtherSkip then + if Strategies.initialize() then + if maxEtherSkip or Inventory.isFull() then return true end - if Memory.value("player", "moving") == 0 then - if Player.isFacing("Right") then - status.canProgress = true - end - status.tempDir = not status.tempDir - if status.tempDir then - Input.press("Right", 1) - end - end - return false end if Inventory.contains("max_ether") then return true end - Player.interact("Right") + local px, py = Player.position() + if px > 7 then + return Strategies.reset("Accidentally walked on the island :(", px, true) + end + if Memory.value("player", "moving") == 0 then + Player.interact("Right") + end end -- push