Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ## Data
- name = "ProTo's Catcher"
- author = "ProTo"
- description = [[ Nothing special, just a basic Catcher. ]]
- -- ##
- -- ## Settings
- local PathFinder = require "Pathfinder/Maps_Pathfind"
- local map = nil
- AlwaysCatch = "Ditto"
- CatchUncaught = 0
- wildencounters = 0
- catchonlycounter = 0
- shinycounter = 0
- -- ##
- PathFinder.disableDigPath()
- -- ## GUI Settings
- tab = {"Catch Uncaught"}
- for i = 1, 1 do
- setOptionName(i, tab[i] .. "")
- setTextOptionName(1, "Place to level/farm ")
- setTextOption(1, getMapName())
- setTextOptionName(2, "Always catch this")
- setTextOption(2, AlwaysCatch)
- setTextOptionName(3, "Grass/Water/Custom")
- setTextOption(3, "Grass")
- end
- -- ##
- -- ## Functions
- function onStart()
- log(" ")
- log(" - - Catcher - -")
- log("A basic Catcher by ProTo")
- log("Version 0.0.1")
- log("- - - - - - - - - -")
- log(" ")
- end
- function onPause()
- log("Catcher | Paused")
- end
- function onResume()
- log("Catcher | Resumed")
- end
- function onPathAction()
- map = getMapName()
- if isPokemonUsable(1) then
- if getMapName() == getTextOption(1) then
- if getTextOption(3) == "Water" then
- moveToWater()
- elseif getTextOption(3) == "Custom" then
- moveToRectangle(MinX, MinY, MaxX, MaxY)
- else
- moveToGrass()
- end
- else
- PathFinder.moveTo(map, getTextOption(1))
- end
- elseif not isPokemonUsable(1) then
- PathFinder.useNearestPokecenter(map)
- end
- end
- function onBattleAction()
- if isWildBattle() and (isOpponentShiny() or isAlreadyCaught() == false and getOption(1) == true) or getOpponentName() == getTextOption(2) then
- return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball")
- else
- return attack() or run() or sendUsablePokemon() or sendAnyPokemon()
- end
- end
- function onBattleMessage(wild)
- if stringContains(wild, "A Wild SHINY ") then
- shinycounter = shinyCounter + 1
- wildencounters = wildCounter + 1
- elseif stringContains(wild, "A Wild ") then
- wildencounters = wildencounters + 1
- elseif stringContains(wild, AlwaysCatch) then
- catchonlycounter = catchonlycounter + 1
- elseif stringContains(wild, "You have won the battle.") then
- log("- - Log - -")
- log("Pokemons encountered: " .. wildencounters)
- log("Shinies encountered: " .. shinycounter)
- log("Encounted desired poke: " .. catchonlycounter)
- log("- - - - - -")
- end
- end
- -- ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement