Simplify bot mode checking, fix enabling paint for all run conditions

This commit is contained in:
Kyle Coburn 2015-04-22 15:28:48 -07:00
parent e3382430de
commit d104157e6d
7 changed files with 12 additions and 15 deletions

View File

@ -333,7 +333,7 @@ function Control.encounter(battleState)
if Pokemon.isOpponent("zubat") then
local zubatCount = Data.increment("encounters_zubats")
Data.run.encounters_zubats = zubatCount
if INTERNAL and STREAMING_MODE then
if STREAMING_MODE then
Bridge.chat(Utils.multiplyString("NightBat", zubatCount))
end
end

View File

@ -2093,8 +2093,8 @@ end
-- PROCESS
function Strategies.initGame(midGame)
if not STREAMING_MODE then
-- Strategies.setYolo("bulbasaur")
if midGame then
Strategies.setYolo("bulbasaur")
stats.squirtle = {
attack = 11,
defense = 11,

View File

@ -1656,7 +1656,7 @@ Strategies.functions = {
Data.run.frames = Utils.frames()
print("v"..VERSION..": "..Data.run.frames.." frames, with seed "..Data.run.seed)
if STREAMING_MODE and not Strategies.replay then
if (yellow or not INTERNAL or RESET_FOR_TIME) and not Strategies.replay then
print("Please save this seed number to share, if you would like proof of your run!")
print("A screenshot has been saved to the Gameboy\\Screenshots folder in BizHawk.")
gui.cleartext()
@ -1712,9 +1712,7 @@ function Strategies.execute(data)
end
function Strategies.init(midGame)
if not STREAMING_MODE then
splitTime = Utils.timeSince(0)
end
splitTime = Utils.timeSince(0)
if midGame then
Control.preferredPotion = "super"
Combat.factorPP(true)

View File

@ -1017,7 +1017,7 @@ end
-- PROCESS
function Strategies.initGame(midGame)
if not STREAMING_MODE then
if midGame then
-- Strategies.setYolo("")
if Pokemon.inParty("nidoking") then
local attDV, defDV, spdDV, sclDV = Pokemon.getDVs("nidoking")

View File

@ -26,8 +26,7 @@ function Data.increment(key)
end
function Data.reset(reason, areaName, map, px, py)
-- if INTERNAL and STREAMING_MODE then --TODO
if INTERNAL then
if STREAMING_MODE then
local report = Data.run
report.cutter = Pokemon.inParty("paras", "oddish", "sandshrew", "charmander")

View File

@ -67,7 +67,7 @@ p("Welcome to PokeBot "..GAME_NAME.." version "..VERSION, true)
Control.init()
STREAMING_MODE = not Walk.init()
STREAMING_MODE = not Walk.init() and INTERNAL
if CUSTOM_SEED then
client.reboot_core()
@ -81,11 +81,11 @@ if RESET_FOR_TIME and hasAlreadyStartedPlaying then
p("Disabling time-limit resets as the game is already running. Please reset the emulator and restart the script if you'd like to go for a fast time.", true)
end
if STREAMING_MODE then
if not CUSTOM_SEED and INTERNAL then
if not CUSTOM_SEED then
RESET_FOR_TIME = true
end
Bridge.init()
else
elseif PAINT_ON then
Input.setDebug(true)
end

View File

@ -54,7 +54,7 @@ function Bridge.init()
end
function Bridge.tweet(message)
if INTERNAL and STREAMING_MODE then
if STREAMING_MODE then
print("tweet::"..message)
return send("tweet", message)
end
@ -135,7 +135,7 @@ function Bridge.encounter()
end
function Bridge.report(report)
if not STREAMING_MODE then
if INTERNAL and not STREAMING_MODE then
print(json.encode(report))
end
send("report", json.encode(report))