Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function onBattleAction()
log("onBattleAction()")
log("isWildBattle()")
if isWildBattle() then
log("true")
log("isOpponentShiny()")
if isOpponentShiny() then
log("true")
log("useItem('Ultra Ball')")
if not useItem("Ultra Ball") then
log("useItem('Great Ball')")
if not useItem("Great Ball") then
log("useItem('Pokeball')")
if useItem("Pokeball") then
log("true")
return
end
else
log("true")
return
end
else
log("true")
return
end
end
end
log("getActivePokemonNumber()")
if getActivePokemonNumber() == 1 then
log("1")
log("attack()")
if not attack() then
log("sendUsablePokemon()")
if not sendUsablePokemon() then
log("run()")
if run() then
log("true")
end
else
log("true")
end
else
log("true")
end
return
else
log(getActivePokemonNumber())
log("run()")
if not run() then
log("attack()")
if not attack() then
log("sendUsablePokemon()")
if sendUsablePokemon() then
log("true")
end
else
log("true")
end
else
log("true")
end
return
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.