Created
June 21, 2016 22:10
-
-
Save g0ldPRO/64b0c0eba98388709147dc35fe5f9250 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
author="g0ld" | |
description="Testing PC API" | |
local bestIVCount = 0 | |
local bestPokemon = -1 | |
local currentBoxId = 1 | |
local currentPokemonId = 1 | |
function managePC() | |
local boxCount = getPCBoxCount() | |
local currentBoxSize = getCurrentPCBoxSize() | |
if getCurrentPCBoxId() == currentBoxId then | |
log("box #" .. currentBoxId .. ":") | |
for i=1,currentBoxSize do | |
log("pokemon: " .. getPokemonNameFromPC(currentBoxId, i)) | |
end | |
currentBoxId = currentBoxId + 1 | |
log("opening box #" .. currentBoxId) | |
return openPCBox(currentBoxId) | |
end | |
return false | |
end | |
function onPathAction() | |
-- moveToCell(12,18) | |
if isPCOpen() then | |
if isCurrentPCBoxRefreshed() then | |
managePC() | |
else | |
log("Box not refreshed") | |
return | |
end | |
else | |
if usePC() then | |
log("PC closed, using PC (success)") | |
else | |
log("PC closed, using PC (failure)") | |
end | |
end | |
end | |
[00:08:56] PC closed, using PC (success) | |
[00:08:56] box #1: | |
[00:08:56] pokemon: Mankey | |
[00:08:56] pokemon: Ponyta | |
[00:08:56] pokemon: Spinarak | |
[00:08:56] pokemon: Caterpie | |
[00:08:56] pokemon: Metapod | |
[00:08:56] pokemon: Pidgey | |
[00:08:56] pokemon: Kakuna | |
[00:08:56] pokemon: Weedle | |
[00:08:56] pokemon: Paras | |
[00:08:56] pokemon: Geodude | |
[00:08:56] pokemon: Sandshrew | |
[00:08:56] pokemon: Zubat | |
[00:08:56] pokemon: Sandslash | |
[00:08:56] pokemon: Onix | |
[00:08:56] pokemon: Clefairy | |
[00:08:56] opening box #2 | |
[00:08:57] box #2: | |
[00:08:57] pokemon: Bronzor | |
[00:08:57] opening box #3 | |
[00:08:58] box #3: | |
[00:08:58] opening box #4 | |
[00:09:00] box #4: | |
[00:09:00] opening box #5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment