Allow chatting without logging to console

This commit is contained in:
Kyle Coburn 2015-04-24 21:04:44 -07:00
parent 7521250a5c
commit ba3f8b780e
4 changed files with 14 additions and 12 deletions

View File

@ -336,7 +336,7 @@ function Control.encounter(battleState)
local zubatCount = Data.increment("encounters_zubat") local zubatCount = Data.increment("encounters_zubat")
Data.run.encounters_zubat = zubatCount Data.run.encounters_zubat = zubatCount
if STREAMING_MODE then if STREAMING_MODE then
Bridge.chat(Utils.multiplyString("NightBat", zubatCount)) Bridge.chat(Utils.multiplyString("NightBat", zubatCount), true)
end end
elseif opponent == "rattata" then elseif opponent == "rattata" then
Data.run.encounters_rattata = Data.increment("encounters_rattata") Data.run.encounters_rattata = Data.increment("encounters_rattata")

View File

@ -421,7 +421,7 @@ strategyFunctions.catchNidoran = function()
Bridge.caught("nidoran") Bridge.caught("nidoran")
status.canProgress = true status.canProgress = true
if not gotExperience then if not gotExperience then
Bridge.chat("is waiting in the grass for a suitable encounter for experience.", Pokemon.getExp()) Bridge.chat("is waiting in the grass for a suitable encounter for experience.")
end end
end end
if gotExperience then if gotExperience then
@ -1040,7 +1040,7 @@ strategyFunctions.potionBeforeMisty = function(data)
message = "is limiting heals to attempt to get closer to red-bar off Misty..." message = "is limiting heals to attempt to get closer to red-bar off Misty..."
end end
if message then if message then
Bridge.chat(message, potionCount) Bridge.chat(message, false, potionCount)
end end
end end
return strategyFunctions.potion({hp=healAmount, chain=data.chain}) return strategyFunctions.potion({hp=healAmount, chain=data.chain})
@ -1241,7 +1241,7 @@ strategyFunctions.potionBeforeSurge = function()
if Control.yolo then if Control.yolo then
local curr_hp = Combat.hp() local curr_hp = Combat.hp()
if curr_hp > yoloHp and curr_hp <= 21 then if curr_hp > yoloHp and curr_hp <= 21 then
Bridge.chat("is attempting to keep red-bar through Surge", curr_hp) Bridge.chat("is attempting to keep red-bar through Surge")
return true return true
end end
end end
@ -1449,7 +1449,7 @@ strategyFunctions.silphRival = function()
if Strategies.initialize() then if Strategies.initialize() then
if Control.yolo then if Control.yolo then
status.gyaradosDamage = Combat.healthFor("RivalGyarados") status.gyaradosDamage = Combat.healthFor("RivalGyarados")
Bridge.chat("is attempting to red-bar off Silph Rival. Get ready to spaghetti!", status.gyaradosDamage.." "..Combat.redHP()) Bridge.chat("is attempting to red-bar off Silph Rival. Get ready to spaghetti!")
end end
end end

View File

@ -51,7 +51,7 @@ function Strategies.hardReset(reason, message, extra, wait)
local map, px, py = Memory.value("game", "map"), Player.position() local map, px, py = Memory.value("game", "map"), Player.position()
Data.reset(reason, Control.areaName, map, px, py) Data.reset(reason, Control.areaName, map, px, py)
Bridge.chat(message, extra) Bridge.chat(message, false, extra)
if wait and INTERNAL and not STREAMING_MODE then if wait and INTERNAL and not STREAMING_MODE then
strategyFunctions.wait() strategyFunctions.wait()
else else
@ -462,7 +462,7 @@ function Strategies.completeCans()
prefix = "Reset me now" prefix = "Reset me now"
suffix = " BibleThump" suffix = " BibleThump"
end end
Bridge.chat(" "..prefix..", "..status.tries.." try Trashcans"..suffix, Utils.elapsedTime()) Bridge.chat(" "..prefix..", "..status.tries.." try Trashcans"..suffix)
return true return true
end end
local completePath = { local completePath = {

View File

@ -65,11 +65,13 @@ function Bridge.pollForName()
send("poll_name") send("poll_name")
end end
function Bridge.chat(message, extra, newLine) function Bridge.chat(message, suppressed, extra, newLine)
if extra then if not suppressed then
p(message.." || "..extra, newLine) if extra then
else p(message.." || "..extra, newLine)
p(message, newLine) else
p(message, newLine)
end
end end
return send("msg", message) return send("msg", message)
end end