2016-06-19, 00:45:33
Can any1 add Charmander and Magma catching?
name = "Leveling: Cinnabar Mansion"
author = "Snes1010"
description = [[This script will train the first pokémon of your team.
It will also try to capture shinies by throwing pokéballs.
Start anywhere between the Cinnabar Mansion and the pokécenter.]]
function onStart()
shinyCounter = 0
wildCounter = 0
startMoney = getMoney()
log("You have " .. getMoney() .. " Pokedollars.")
end
function onPause()
log("***********************************PAUSED - SESSION STATS***********************************")
log("You have earned ".. tostring(getMoney() - startMoney) .." PokeDollars!")
log("Shinies Caught: " .. shinyCounter)
log("Pokemon raped: " .. wildCounter)
log("*********************************************************************************************")
end
function onResume()
log("SESSION RESUMED")
end
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Cinnabar" then
moveToMap("Cinnabar Island")
elseif getMapName() == "Cinnabar Island" then
if not isMounted() then
return useItem("Bicycle")
else moveToMap("Cinnabar mansion 1")
end
elseif getMapName() == "Cinnabar mansion 1" then
moveToMap("Cinnabar mansion 2")
elseif getMapName() == "Cinnabar mansion 2" then
moveToMap("Cinnabar mansion 3")
elseif getMapName() == "Cinnabar mansion 3" then
moveToRectangle(1,12,13,18)
end
else
if getMapName() == "Cinnabar mansion 3" then
moveToMap("Cinnabar mansion 2")
elseif getMapName() == "Cinnabar mansion 2" then
moveToMap("Cinnabar mansion 1")
elseif getMapName() == "Cinnabar mansion 1" then
moveToMap("Cinnabar Island")
elseif getMapName() == "Cinnabar Island" then
if not isMounted() then
return useItem("Bicycle")
else moveToMap("Pokecenter Cinnabar")
end
elseif getMapName() == "Pokecenter Cinnabar" then
usePokecenter()
end
end
end
function onBattleMessage(wild)
if stringContains(wild, "A Wild SHINY ") then
shinyCounter = shinyCounter + 1
elseif stringContains(wild, "A Wild ") then
wildCounter = wildCounter + 1
end
end
function onBattleAction()
if isWildBattle() and isOpponentShiny() then
if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
return
end
end
if getActivePokemonNumber() == 1 then
return attack() or sendUsablePokemon() or run() or sendAnyPokemon()
else
return run() or attack() or sendUsablePokemon() or sendAnyPokemon()
end
end