*Currently spending my time learning more Lua, script updates are postponed*
This is my second attempt at writing Lua so go easy. This is once again heavily based on the work of Royal. The script should be user friendly allowing you to insert any farming location you would like. this script catches any shiny pokemon or uncaught pokemon while it sorts your team and levels them up.
Tutorial(Does not support caves unless surfing)
Run the script in your pokecenter , mart, or cityname location.
buyingPokeballs: if you have no mart or you're too poor make sure to set to false
autobox: untested recommend setting is false. this setting store pokemon caught while farming.
onlyCatching: prevents reorganising of team useful for synchronise setup.
usingSpecialCatch: if you do not have a pokemon with false swipe AND sleep set to false
sleepattack: can be altered to your sleep move preference ie. "Spore" "Sleep Powder" etc etc
alwaysCatch: allows you to specify a pokemon whom you wish to always try to catch.
cityName: does not need to be the location of a city, simply a location beside a pokecenter
center: should be filled in with the name of the pokecenter beside your cityname location
mart: is an optional setting see buyingPokeballs but your mart needs to be beside your cityname location.
travel: is the first map between your city name and disired farming location set to "none" if adjacent (Situational)
travelTwo: is the second map. see above. (Situational)
farmLocation: is the area in which you would like to have your pokemon level and or catch pokemon
surf: is set to true if the area you wish to level / catch pokemon is on the water note: this does not support mounts and you will need to have a pokemon on your team with surf.
Let me know if you find any errors and I will do my best to fix them.
*NEWEST VERSION BUGGY*
- Newest version contains, a max level setting for pokemon while grinding. This should halt the script when you reach your desired level.
- set maxLevel to true and desiredLevel to your leveling goal.
added: realisticMovement toggle read description in script.
added: onlyLevel which prevents catching of any pokemon
This is my second attempt at writing Lua so go easy. This is once again heavily based on the work of Royal. The script should be user friendly allowing you to insert any farming location you would like. this script catches any shiny pokemon or uncaught pokemon while it sorts your team and levels them up.
Tutorial(Does not support caves unless surfing)
Run the script in your pokecenter , mart, or cityname location.
buyingPokeballs: if you have no mart or you're too poor make sure to set to false
autobox: untested recommend setting is false. this setting store pokemon caught while farming.
onlyCatching: prevents reorganising of team useful for synchronise setup.
usingSpecialCatch: if you do not have a pokemon with false swipe AND sleep set to false
sleepattack: can be altered to your sleep move preference ie. "Spore" "Sleep Powder" etc etc
alwaysCatch: allows you to specify a pokemon whom you wish to always try to catch.
cityName: does not need to be the location of a city, simply a location beside a pokecenter
center: should be filled in with the name of the pokecenter beside your cityname location
mart: is an optional setting see buyingPokeballs but your mart needs to be beside your cityname location.
travel: is the first map between your city name and disired farming location set to "none" if adjacent (Situational)
travelTwo: is the second map. see above. (Situational)
farmLocation: is the area in which you would like to have your pokemon level and or catch pokemon
surf: is set to true if the area you wish to level / catch pokemon is on the water note: this does not support mounts and you will need to have a pokemon on your team with surf.
-- Config
-- Start in town, pokecenter, or mart.
usingLogs = true
-- also set to false if no mart is near by
buyingPokeballs = false
itemName = "Pokeball"
-- How many do you would like to buy?
quantity = 50
-- Set the minimum number of Pokeballs what you would like to have (after you have less than you entered the bot will buy new Pokeballs)
atLeast = 100
-- will automatically box pokemon caught while leveling
autoBox = false
-- If you only wish to catch pokemon set this to true
onlyCatching = false
-- Attack config
attack_pokemon = true
-- Special catch: False Swipe + Sleep
usingSpecialCatch = false
-- Config this lines only if you use Special Catch
sleepAttack = "Hypnosis"
-- always try to catch this pokemon
alwaysCatch = "none"
-- town/city near farming location
cityName = "Viridian City"
-- pokemon center
center = "Viridian Pokecenter"
-- pokemon mart
mart = "none"
-- Intermitant area ex "Route 12"
travel = "Route 2"
-- Second Intermitant area ex "Route 13"
travelTwo = "none"
-- Location for farming ex "Route 14"
farmLocation = "Viridian Forest"
-- if farming in body of water set as true, make sure a pokemon on your team has surf no mount support.
surf = false
--[[
Below this line is the script.
Don't touch anything if you don't know what you're doing.
]]
name = "Pokemon Trainer"
author = "SMF"
description = [[Train Pokemon, Catch Pokemon, Be Pokemon]]
indexOfFalseSwiper = 0
indexOfSleep = 0
sortingHat = true
teamSizeStart = 1
teamSizeNow = 1
pokemonOne = "none"
pokemonTwo = "none"
pokemonThree = "none"
pokemonFour = "none"
pokemonFive = "none"
pokemonSix = "none"
travelX = NA
travelY = NA
travelZ = 0
travelTwoX = NA
travelTwoY = NA
travelTwoZ = 0
farmLocationX = NA
farmLocationY = NA
farmLocationZ = 0
function travelXY()
if travelX == NA then
travelX = getPlayerX()
travelY = getPlayerY()
end
end
function travelTwoXY()
if travelTwoX == NA then
travelTwoX = getPlayerX()
travelTwoY = getPlayerY()
end
end
function farmLocationXY()
if farmLocationX == NA then
farmLocationX = getPlayerX()
farmLocationY = getPlayerY()
end
end
-- has a moveToMap() function
function traveling()
if travel == "none" then return false
else
moveToMap(travel)
return true
end
end
-- has a moveToMap() function
function travelingFar()
if travelTwo == "none" then return false
else
moveToMap(travelTwo)
return true
end
end
function setIndexes()
local teamSize = getTeamSize()
for i=1,teamSize
do
if hasMove( i, "False Swipe") then
indexOfFalseSwiper = i
end
if hasMove(i, sleepAttack) then
indexOfSleep = i
end
end
end
-- has a moveToWater() / moveToGrass()
function setFarm()
if Surf == true then
moveToWater()
else
moveToGrass()
end
end
-- deposites any pokemon not on team when script starts *untested*
function gottaBoxEmAll()
local teamSizeNow = getTeamSize()
if teamSizeNow > teamSizeStart then
usePC()
for i=1, teamSizeNow
do
if not getPokemonName(i) == pokemonOne or not getPokemonName(i) == pokemonTwo or not getPokemonName(i) == pokemonThree or not getPokemonName(i) == pokemonFour or not getPokemonName(i) == pokemonFive or not getPokemonName(i) == pokemonSix then
depositPokemonToPC(i)
end
end
end
end
-- moves towards farming location
function forwardwardMarch()
if getMapName() == center then
moveToMap(cityName)
elseif getMapName() == mart then
moveToMap(cityName)
elseif getMapName() == cityName and not traveling() then
moveToMap(farmLocation)
elseif getMapName() == travel then
travelXY()
if not travelingFar() then
moveToMap(farmLocation)
end
elseif getMapName() == travelTwo then
travelTwoXY()
moveToMap(FarmLocation)
elseif getMapName() == farmLocation then
farmLocationXY()
setFarm()
end
end
-- checks if at farm location
function areWeThereFarm()
if getPlayerX() == farmLocationX and getPlayerY() == farmLocationY then
return true
else return false
end
end
-- checks if at location 2
function areWeThereTwo()
if getPlayerX() == travelTwoX and getPlayerY() == travelTwoY then
return true
else return false
end
end
-- check if at location 1
function areWeThere()
if getPlayerX() == travelX and getPlayerY() == travelY then
return true
else return false
end
end
-- moves towards pokecenter / mart
function retreat()
if getMapName() == farmLocation then
farmLocationZ = farmLocationZ +1
if farmLocationZ == 1 then
moveToCell(farmLocationX + 1,farmLocationY)
elseif farmLocationZ == 2 then
moveToCell(farmLocationX,farmLocationY + 1)
elseif farmLocationZ == 3 then
moveToCell(farmLocationX - 1,farmLocationY)
elseif farmLocationZ == 4 then
moveToCell(farmLocationX,farmLocationY - 1)
elseif farmLocationZ > 4 then
farmLocationZ = 0
end
-- current map is location two
elseif getMapName() == travelTwo then
travelTwoZ = travelTwoZ +1
if travelTwoZ == 1 then
moveToCell(travelTwoX + 1,travelTwoY)
elseif travelTwoZ == 2 then
moveToCell(travelTwoX,travelTwoY + 1)
elseif travelTwoZ == 3 then
moveToCell(travelTwoX - 1,travelTwoY)
elseif travelTwoZ == 4 then
moveToCell(travelTwoX,travelTwoY - 1)
elseif travelTwoZ > 4 then
travelTwoZ = 0
end
elseif getMapName() == travel then
travelZ = travelZ +1
if travelZ == 1 then
moveToCell(travelX + 1,travelY)
elseif travelZ == 2 then
moveToCell(travelX,travelY + 1)
elseif travelZ == 3 then
moveToCell(travelX - 1,travelY)
elseif travelZ == 4 then
moveToCell(travelX,travelY - 1)
elseif travelZ > 4 then
travelZ = 0
end
end
end
-- uses map names instead of coordinates less reliable on certain map layouts
function poorMansRetreat()
if getMapName() == farmLocation and farmLocationX == NA then
if not travelingFar() and not traveling() then
moveToMap(cityName)
end
elseif getMapName() == travelTwo and travelTwoX == NA then
travel()
elseif getMapName() == travel and travelX == NA then
moveToMap(cityName)
end
end
function onStart()
-- Counters, don't change the lines below
wildCounter = 0
shinyCounter = 0
pokecenterCounter = 0
startingMoney = getMoney()
pokeballCounter = 0
alwaysCatchCounter = 0
setIndexes()
teamSizeStart = getTeamSize()
if teamSizeStart >= 1 then
pokemonOne = getPokemonName(1)
end
if teamSizeStart > 1 then
pokemonTwo = getPokemonName(2)
end
if teamSizeStart > 2 then
pokemonThree = getPokemonName(3)
end
if teamSizeStart > 3 then
pokemonFour = getPokemonName(4)
end
if teamSizeStart > 4 then
pokemonFive = getPokemonName(5)
end
if teamSizeStart > 5 then
pokemonSix = getPokemonName(6)
end
if usingLogs == true then
log("Info | Index of False Swiper: " .. indexOfFalseSwiper)
log("Info | Index of Sleeper: " .. indexOfSleep)
log("Info | Sleep Attack: " .. sleepAttack)
log("Info | Pokemon Team ")
if teamSizeStart >= 1 then
log("Info |" .. pokemonOne)
end
if teamSizeStart > 1 then
log("Info |" .. pokemonTwo)
end
if teamSizeStart > 2 then
log("Info |" .. pokemonThree)
end
if teamSizeStart > 3 then
log("Info |" .. pokemonFour)
end
if teamSizeStart > 4 then
log("Info |" .. pokemonFive)
end
if teamSizeStart > 5 then
log("Info |" .. pokemonSix)
end
end
if usingLogs == true and usingSpecialCatch == true then
log("Info | Using special catch is activated!")
else
log("Info | Using special catch is deactivated!")
end
end
function useLogs()
if not alwaysCatch == "none" and usingLogs == true then
log("Info | " .. alwaysCatch .. "s encountered: " .. alwaysCatchCounter)
elseif usingLogs == true then
log("Info | Pokemons encountered: " .. wildCounter)
log("Info | Shinies encountered: " .. shinyCounter)
end
end
function onDialogMessage(pokecenter)
if stringContains(pokecenter, "Would you like me to heal your Pokemon?") then
pokecenterCounter = pokecenterCounter + 1
end
end
function onBattleMessage(wild)
if stringContains(wild, "A Wild SHINY ") then
shinyCounter = shinyCounter + 1
wildCounter = wildCounter + 1
useLogs()
elseif wild == "A Wild " .. alwaysCatch .. " Attacks!" then
alwaysCatchCounter = alwaysCatchCounter + 1
wildCounter = wildCounter + 1
useLogs()
elseif stringContains(wild, "A Wild ") then
wildCounter = wildCounter + 1
useLogs()
elseif stringContains(wild, "Pokedollar(s)") then
if usingLogs == true then
log("Info | Pokedollars earned: "..tostring(getMoney() - startingMoney).." (" ..tostring((getMoney() - startingMoney)/wildCounter).." average)")
end
elseif stringContains(wild, "You throw") then
pokeballCounter = pokeballCounter + 1
end
end
function onPause()
if not alwaysCatch == "none" and usingLogs == true then
log("Info | " .. alwaysCatch .. "s encountered: " .. alwaysCatchCounter .. " (" .. 100 * (alwaysCatchCounter/wildCounter) .. "%)")
elseif usingLogs == true then
log("Times in Pokecenter: " .. pokecenterCounter)
log("Pokemons encountered: " .. wildCounter)
log("Shinies encountered: " .. shinyCounter .. " (" .. 100 * (shinyCounter/wildCounter) .. "%)")
log("Pokedollars earned: "..tostring(getMoney() - startingMoney).." (" ..tostring((getMoney() - startingMoney)/wildCounter).." average)")
log("Pokeballs used: " .. pokeballCounter)
end
end
function onPathAction()
if onlyCatching == false and isTeamRangeSortedByLevelAscending(1,6) == false then
sortTeamByLevelAscending()
sortingHat = true
elseif sortingHat == true then
sortingHat = false
setIndexes()
elseif getItemQuantity(itemName) < atLeast and buyingPokeballs == true then
poorMansRetreat()
retreat()
-- current map is farm location
if getMapName() == cityName then
moveToMap(mart)
elseif getMapName() == mart and not isShopOpen() then
talkToNpcOnCell(3, 5)
elseif isShopOpen() then
buyItem(itemName, quantity)
end
elseif (usingSpecialCatch == true and isPokemonUsable(1) and isPokemonUsable(indexOfFalseSwiper) and isPokemonUsable(indexOfSleep) and getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") >= 1 and getRemainingPowerPoints(indexOfSleep, sleepAttack) >= 1) then
forwardwardMarch()
elseif isPokemonUsable(1) then
forwardwardMarch()
elseif not isPokemonUsable(1) and usingSpecialCatch == false then
poorMansRetreat()
retreat()
if getMapName() == cityName then
moveToMap(center)
elseif getMapName() == mart then
moveToMap(cityName)
elseif getMapName() == center then
usePokecenter()
if autoBox == true then gottaBoxEmAll()
end
end
elseif not isPokemonUsable(1) or (usingSpecialCatch and (getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") < 1 or getRemainingPowerPoints(indexOfSleep, sleepAttack) < 1)) then
retreat()
if getMapName() == cityName then
moveToMap(center)
elseif getMapName() == mart then
moveToMap(cityName)
elseif getMapName() == center then
usePokecenter()
if autoBox == true then gottaBoxEmAll()
end
end
end
end
function onBattleAction()
if usingSpecialCatch == true and isWildBattle() and (isOpponentShiny() or getOpponentName() == alwaysCatch or not isAlreadyCaught() ) then
if getActivePokemonNumber() ~= indexOfFalseSwiper and getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") > 0 and isPokemonUsable(indexOfFalseSwiper) then
if usingLogs == true then
log("Info | Sending False Swiper")
end
return sendPokemon(indexOfFalseSwiper)
elseif getActivePokemonNumber() == indexOfFalseSwiper and getOpponentHealth() > 1 and getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") > 0 then
if usingLogs == true then
log("Info | Using False Swipe")
end
return useMove("False Swipe")
elseif getActivePokemonNumber() ~= indexOfSleep and getOpponentHealth() == 1 and getRemainingPowerPoints(indexOfSleep, sleepAttack) == 0 and isPokemonUsable(indexOfSleep) then
if usingLogs == true then
log("Info | Sending Sleeper")
end
return sendPokemon(indexOfSleep)
elseif getActivePokemonNumber() == indexOfSleep and getOpponentStatus() ~= "SLEEP" and getRemainingPowerPoints(indexOfSleep, sleepAttack) > 0 then
if usingLogs == true then
log("Info | Using a Sleep Attack")
end
return useMove(sleepAttack)
elseif getOpponentStatus() == "SLEEP" or not (isPokemonUsable(indexOfSleep) and not isPokemonUsable(indexOfFalseSwiper)) then
if usingLogs == true then
log("Info | Using Pokeballs")
end
return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or sendUsablePokemon()
end
elseif not usingSpecialCatch and isWildBattle() and (isOpponentShiny() or getOpponentName() == alwaysCatch or not isAlreadyCaught() ) then
return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or run() or attack() or sendUsablePokemon()
elseif attack_pokemon == false and isWildBattle() and not isOpponentShiny() or not getOpponentName() == alwaysCatch then
return run() or sendUsablePokemon() or attack()
elseif attack_pokemon == true and isWildBattle() and not isOpponentShiny() or not getOpponentName() == alwaysCatch then
return attack() or sendUsablePokemon() or run()
end
end
Let me know if you find any errors and I will do my best to fix them.
*NEWEST VERSION BUGGY*
-- Config
-- Start in town, pokecenter, or mart.
usingLogs = true
-- also set to false if no mart is near by
buyingPokeballs = true
-- item used for capture can be changed to Greatball or Ultaball becareful about spending costs
itemName = "Pokeball"
-- How many do you would like to buy?
quantity = 50
-- Set the minimum number of Pokeballs what you would like to have (after you have less than you entered the bot will buy new Pokeballs)
atLeast = 100
-- if set to true will stop leveling when desiredLevel is met
maxLevel = true
-- will stop running when lead pokemon reaches desired level
desiredLevel = 100
-- set to true to stop the bot from trying to catch any pokemon
onlyLevel = false
-- will automatically box pokemon caught while leveling
autoBox = false
-- If you only wish to catch pokemon set this to true
onlyCatching = false
-- Attack config
attack_pokemon = true
-- Special catch: False Swipe + Sleep
usingSpecialCatch = false
-- Config this line only if you use Special Catch
sleepAttack = "Hypnosis"
-- always try to catch this pokemon
alwaysCatch = ""
-- town/city near farming location
cityName = "Oldale Town"
-- pokemon center
center = "Pokecenter Oldale Town"
-- pokemon mart
mart = "Pokemart Oldale Town"
-- Intermitant area ex "Route 12"
travel = "none"
-- Second Intermitant area ex "Route 13"
travelTwo = "none"
-- Location for farming ex "Route 14"
farmLocation = "Route 103"
-- if farming in body of water set as true, make sure a pokemon on your team has surf no mount support.
surf = false
-- this will stop the bot from searching for exits and simply walk to them WARNING: some maps have multiple exits with the same name, with this turned off the bot will stop functioning on said maps.
realisticMovement = true
--[[
Below this line is the script.
Don't touch anything if you don't know what you're doing.
]]
name = "Pokemon Trainer"
author = "SMF"
description = [[Train Pokemon, Catch Pokemon, Be Pokemon]]
indexOfFalseSwiper = 0
indexOfSleep = 0
sortingHat = true
teamSizeStart = 1
teamSizeNow = 1
hault = false
boxed = true
pokemonOne = "none"
pokemonTwo = "none"
pokemonThree = "none"
pokemonFour = "none"
pokemonFive = "none"
pokemonSix = "none"
travelX = NA
travelY = NA
travelZ = 0
travelTwoX = NA
travelTwoY = NA
travelTwoZ = 0
farmLocationX = NA
farmLocationY = NA
farmLocationZ = 0
function travelXY()
if travelX == NA then
travelX = getPlayerX()
travelY = getPlayerY()
end
end
function travelTwoXY()
if travelTwoX == NA then
travelTwoX = getPlayerX()
travelTwoY = getPlayerY()
end
end
function farmLocationXY()
if farmLocationX == NA then
farmLocationX = getPlayerX()
farmLocationY = getPlayerY()
end
end
-- has a moveToMap() function
function traveling()
if travel == "none" then return false
else
moveToMap(travel)
return true
end
end
-- has a moveToMap() function
function travelingFar()
if travelTwo == "none" then return false
else
moveToMap(travelTwo)
return true
end
end
function setIndexes()
local teamSize = getTeamSize()
for i=1,teamSize
do
if hasMove( i, "False Swipe") then
indexOfFalseSwiper = i
end
if hasMove(i, sleepAttack) then
indexOfSleep = i
end
end
end
-- has a moveToWater() / moveToGrass()
function setFarm()
if Surf == true then
moveToWater()
else
moveToGrass()
end
end
-- deposites any pokemon not on team when script starts *untested*
function gottaBoxEmAll()
local teamSizeNow = getTeamSize()
if teamSizeNow > teamSizeStart then
usePC()
for i=1, teamSizeNow
do
if not getPokemonName(i) == pokemonOne or not getPokemonName(i) == pokemonTwo or not getPokemonName(i) == pokemonThree or not getPokemonName(i) == pokemonFour or not getPokemonName(i) == pokemonFive or not getPokemonName(i) == pokemonSix then
depositPokemonToPC(i)
end
end
end
end
-- moves towards farming location
function forwardwardMarch()
if getMapName() == center then
moveToMap(cityName)
elseif getMapName() == mart then
moveToMap(cityName)
elseif getMapName() == cityName and not traveling() then
moveToMap(farmLocation)
elseif getMapName() == travel then
travelXY()
if not travelingFar() then
moveToMap(farmLocation)
end
elseif getMapName() == travelTwo then
travelTwoXY()
moveToMap(FarmLocation)
elseif getMapName() == farmLocation then
farmLocationXY()
setFarm()
end
end
-- checks if at farm location
function areWeThereFarm()
if getPlayerX() == farmLocationX and getPlayerY() == farmLocationY then
return true
else return false
end
end
-- checks if at location 2
function areWeThereTwo()
if getPlayerX() == travelTwoX and getPlayerY() == travelTwoY then
return true
else return false
end
end
-- check if at location 1
function areWeThere()
if getPlayerX() == travelX and getPlayerY() == travelY then
return true
else return false
end
end
-- moves towards pokecenter / mart
function retreat()
if getMapName() == farmLocation and farmLocationX ~= NA then
farmLocationZ = farmLocationZ +1
if farmLocationZ == 1 then
moveToCell(farmLocationX + 1,farmLocationY)
elseif farmLocationZ == 2 then
moveToCell(farmLocationX,farmLocationY + 1)
elseif farmLocationZ == 3 then
moveToCell(farmLocationX - 1,farmLocationY)
elseif farmLocationZ == 4 then
moveToCell(farmLocationX,farmLocationY - 1)
elseif farmLocationZ > 4 then
farmLocationZ = 0
end
-- current map is location two
elseif getMapName() == travelTwo and travelTwoX ~= NA then
travelTwoZ = travelTwoZ +1
if travelTwoZ == 1 then
moveToCell(travelTwoX + 1,travelTwoY)
elseif travelTwoZ == 2 then
moveToCell(travelTwoX,travelTwoY + 1)
elseif travelTwoZ == 3 then
moveToCell(travelTwoX - 1,travelTwoY)
elseif travelTwoZ == 4 then
moveToCell(travelTwoX,travelTwoY - 1)
elseif travelTwoZ > 4 then
travelTwoZ = 0
end
elseif getMapName() == travel and travelX ~= NA then
travelZ = travelZ +1
if travelZ == 1 then
moveToCell(travelX + 1,travelY)
elseif travelZ == 2 then
moveToCell(travelX,travelY + 1)
elseif travelZ == 3 then
moveToCell(travelX - 1,travelY)
elseif travelZ == 4 then
moveToCell(travelX,travelY - 1)
elseif travelZ > 4 then
travelZ = 0
end
end
end
-- uses map names instead of coordinates less reliable on certain map layouts
function poorMansRetreat()
if getMapName() == farmLocation and farmLocationX == NA and farmLocationX ~= NA then
if not travelingFar() and not traveling() then
moveToMap(cityName)
end
elseif getMapName() == travelTwo and travelTwoX == NA then
travel()
elseif getMapName() == travel and travelX == NA then
moveToMap(cityName)
end
end
function backUpRetreat()
if getMapName() == farmLocation then
if not travelingFar() and not traveling() then
moveToMap(cityName)
end
elseif getMapName() == travelTwo then
travel()
elseif getMapName() == travel then
moveToMap(cityName)
end
end
function toMart()
if getMapName() == cityName then
moveToMap(mart)
elseif getMapName() == mart and not isShopOpen() then
talkToNpcOnCell(3, 5)
elseif isShopOpen() then
buyItem(itemName, quantity)
end
end
function toCenter()
if getMapName() == cityName then
moveToMap(center)
boxed = false
elseif getMapName() == mart then
moveToMap(cityName)
elseif getMapName() == center and autoBox == true and boxed == false then
gottaBoxEmAll()
boxed = true
elseif getMapName() == center and boxed == true then
usePokecenter()
elseif getMapName() == center and autoBox == false then
usePokecenter()
end
end
function onStart()
-- Counters, don't change the lines below
wildCounter = 0
shinyCounter = 0
pokecenterCounter = 0
startingMoney = getMoney()
pokeballCounter = 0
alwaysCatchCounter = 0
setIndexes()
teamSizeStart = getTeamSize()
if teamSizeStart >= 1 then
pokemonOne = getPokemonName(1)
end
if teamSizeStart > 1 then
pokemonTwo = getPokemonName(2)
end
if teamSizeStart > 2 then
pokemonThree = getPokemonName(3)
end
if teamSizeStart > 3 then
pokemonFour = getPokemonName(4)
end
if teamSizeStart > 4 then
pokemonFive = getPokemonName(5)
end
if teamSizeStart > 5 then
pokemonSix = getPokemonName(6)
end
if usingLogs == true then
log("Info | Index of False Swiper: " .. indexOfFalseSwiper)
log("Info | Index of Sleeper: " .. indexOfSleep)
log("Info | Sleep Attack: " .. sleepAttack)
log("Info | Pokemon Team ")
if teamSizeStart >= 1 then
log("Info |" .. pokemonOne)
end
if teamSizeStart > 1 then
log("Info |" .. pokemonTwo)
end
if teamSizeStart > 2 then
log("Info |" .. pokemonThree)
end
if teamSizeStart > 3 then
log("Info |" .. pokemonFour)
end
if teamSizeStart > 4 then
log("Info |" .. pokemonFive)
end
if teamSizeStart > 5 then
log("Info |" .. pokemonSix)
end
end
if usingLogs == true and usingSpecialCatch == true then
log("Info | Using special catch is activated!")
else
log("Info | Using special catch is deactivated!")
end
end
function useLogs()
if not alwaysCatch == "none" and usingLogs == true then
log("Info | " .. alwaysCatch .. "s encountered: " .. alwaysCatchCounter)
elseif usingLogs == true then
log("Info | Pokemons encountered: " .. wildCounter)
log("Info | Shinies encountered: " .. shinyCounter)
end
end
function onDialogMessage(pokecenter)
if stringContains(pokecenter, "Would you like me to heal your Pokemon?") then
pokecenterCounter = pokecenterCounter + 1
end
end
function onBattleMessage(wild)
if stringContains(wild, "A Wild SHINY ") then
shinyCounter = shinyCounter + 1
wildCounter = wildCounter + 1
useLogs()
elseif wild == "A Wild " .. alwaysCatch .. " Attacks!" then
alwaysCatchCounter = alwaysCatchCounter + 1
wildCounter = wildCounter + 1
useLogs()
elseif stringContains(wild, "A Wild ") then
wildCounter = wildCounter + 1
useLogs()
elseif stringContains(wild, "Pokedollar(s)") then
if usingLogs == true then
log("Info | Pokedollars earned: "..tostring(getMoney() - startingMoney).." (" ..tostring((getMoney() - startingMoney)/wildCounter).." average)")
end
elseif stringContains(wild, "You throw") then
pokeballCounter = pokeballCounter + 1
end
end
function onPause()
if not alwaysCatch == "none" and usingLogs == true then
log("Info | " .. alwaysCatch .. "s encountered: " .. alwaysCatchCounter .. " (" .. 100 * (alwaysCatchCounter/wildCounter) .. "%)")
elseif usingLogs == true then
log("Times in Pokecenter: " .. pokecenterCounter)
log("Pokemons encountered: " .. wildCounter)
log("Shinies encountered: " .. shinyCounter .. " (" .. 100 * (shinyCounter/wildCounter) .. "%)")
log("Pokedollars earned: "..tostring(getMoney() - startingMoney).." (" ..tostring((getMoney() - startingMoney)/wildCounter).." average)")
log("Pokeballs used: " .. pokeballCounter)
end
end
function onPathAction()
if onlyCatching == false and isTeamRangeSortedByLevelAscending(1,6) == false then
sortTeamByLevelAscending()
sortingHat = true
elseif sortingHat == true then
sortingHat = false
setIndexes()
if maxLevel == true and getPokemonLevel(1) == desiredLevel then
hault = true
end
elseif getItemQuantity(itemName) < atLeast and buyingPokeballs == true then
if hault == false then
if realisticMovement == true then
backUpRetreat()
toMart()
else
poorMansRetreat()
retreat()
toMart()
end
end
elseif usingSpecialCatch == true and isPokemonUsable(1) and isPokemonUsable(indexOfFalseSwiper) and isPokemonUsable(indexOfSleep) and getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") >= 1 and getRemainingPowerPoints(indexOfSleep, sleepAttack) >= 1 then
if hault == false then
forwardwardMarch()
end
elseif isPokemonUsable(1) then
if hault == false then
forwardwardMarch()
end
elseif not isPokemonUsable(1) and usingSpecialCatch == false then
if hault == false then
if realisticMovement == true then
backUpRetreat()
toCenter()
else
poorMansRetreat()
retreat()
toCenter()
end
end
elseif not isPokemonUsable(1) or (usingSpecialCatch and (getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") < 1 or getRemainingPowerPoints(indexOfSleep, sleepAttack) < 1)) then
if hault == false then
if realisticMovement == true then
backUpRetreat()
toCenter()
else
poorMansRetreat()
retreat()
toCenter()
end
end
end
end
function onBattleAction()
if onlyLevel == false then
if usingSpecialCatch == true and isWildBattle() and (isOpponentShiny() or getOpponentName() == alwaysCatch or not isAlreadyCaught() ) then
if getActivePokemonNumber() ~= indexOfFalseSwiper and getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") > 0 and isPokemonUsable(indexOfFalseSwiper) then
if usingLogs == true then
log("Info | Sending False Swiper")
end
return sendPokemon(indexOfFalseSwiper) or run()
elseif getActivePokemonNumber() == indexOfFalseSwiper and getOpponentHealth() > 1 and getRemainingPowerPoints(indexOfFalseSwiper, "False Swipe") > 0 then
if usingLogs == true then
log("Info | Using False Swipe")
end
return useMove("False Swipe") or run()
elseif getActivePokemonNumber() ~= indexOfSleep and getOpponentHealth() == 1 and getRemainingPowerPoints(indexOfSleep, sleepAttack) == 0 and isPokemonUsable(indexOfSleep) then
if usingLogs == true then
log("Info | Sending Sleeper")
end
return sendPokemon(indexOfSleep) or run()
elseif getActivePokemonNumber() == indexOfSleep and getOpponentStatus() ~= "SLEEP" and getRemainingPowerPoints(indexOfSleep, sleepAttack) > 0 then
if usingLogs == true then
log("Info | Using a Sleep Attack")
end
return useMove(sleepAttack) or run()
elseif getOpponentStatus() == "SLEEP" or not (isPokemonUsable(indexOfSleep) and not isPokemonUsable(indexOfFalseSwiper)) then
if usingLogs == true then
log("Info | Using Pokeballs")
end
return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or sendUsablePokemon() or run()
end
elseif not usingSpecialCatch and isWildBattle() and (isOpponentShiny() or getOpponentName() == alwaysCatch or not isAlreadyCaught() ) then
return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or attack() or sendUsablePokemon() or run()
elseif attack_pokemon == false and isWildBattle() and not isOpponentShiny() or not getOpponentName() == alwaysCatch then
return run() or sendUsablePokemon() or attack()
elseif attack_pokemon == true and isWildBattle() and not isOpponentShiny() or not getOpponentName() == alwaysCatch then
return attack() or sendUsablePokemon() or run()
end
else
return attack() or sendUsablePokemon() or run()
end
end
- Newest version contains, a max level setting for pokemon while grinding. This should halt the script when you reach your desired level.
- set maxLevel to true and desiredLevel to your leveling goal.
added: realisticMovement toggle read description in script.
added: onlyLevel which prevents catching of any pokemon