Hello There, Guest! Login Register


False Swipe and 'Any' location Shiny catching
#1
I'm looking for a script that is a general location shiny catcher. There's a lot of general leveling scripts and I'd like to just have a script that shows how many encounters there have been, how many have been shiny, and false swipe to catch if it is a shiny.
 
Reply
#2
I have this one that automatically uses you sync and False swipe. Not much configuration, still might need some testing tho.
--Configuration--
--DO THIS FIRST--                

local autoEvolve = "off"

local location = "Dragons Den"        

local catchThesePokemon = {"Gyarados", "Dragonair"}

local lookForGrass = false
local lookForWater = true
local caveGround = false
local minX = 14
local minY = 20
local maxX = 35
local maxY = 60

local statusMove = "Hypnosis"

local throwHealth = 1

local typeBall = "Pokeball"

    
--END OF CONFIGURATION--




--Start Of Script--


name = "Universal Catcher"
author = "Crazy3001"
description = "Hunting at " .. location .. ". Press Start"

local pf = require "PathFinder/Maps_Pathfind"
local lib = require "PathFinder/Lib/lib"
local failedRun = false


function onStart()
local syncId = hasSync()
local swipeId = hasSwipe()
local statusId = hasStatus()

   healCounter = 0
   shinyCounter = 0
   catchCounter = 0
   wildCounter = 0
   log("Start botting.")
 
    if hasSync() then
        if syncId ~= 1 then
            swapPokemon(1, syncId)
            lib.log1time("Using " .. getPokemonName(syncId) .. " for Sync. Swapped with leader.")
        else
            lib.log1time("Using " .. getPokemonName(syncId) .. " for Sync.")
        end
    end
    
    if hasSwipe() then
        lib.log1time("Using " .. getPokemonName(swipeId) .. " for False Swipe.")
    end
    
    if hasStatus() then
        lib.log1time("Using " .. getPokemonName(statusId) .. " for " .. statusMove ..".")
    end    
 
      if autoEvolve == "on" then
        if not isAutoEvolve() then
            enableAutoEvolve()
        end
    end
    if autoEvolve == "off" then
        if isAutoEvolve then
            disableAutoEvolve()
        end
    end
end

function onPause()
  log("***********************************PAUSED - SESSION STATS***********************************")
  log("Shinies Caught: " .. shinyCounter)
  log("Pokemon Caught: " .. catchCounter)
  log("Pokemons encountered: " .. wildCounter)
  log("You have visited the PokeCenter ".. healCounter .." times.")
  log("*********************************************************************************************")
end

function onResume()
  log("SESSION RESUMED")
end

function onDialogMessage(pokecenter)
   if stringContains(pokecenter, "There you go, take care of them!") then
        healCounter = healCounter + 1
        log("You have visited the PokeCenter ".. healCounter .." times.")
   end
end

function onBattleMessage(wild)
    if stringContains(wild, "A Wild SHINY ") then
        shinyCounter = shinyCounter + 1
        wildCounter = wildCounter + 1
        log("Info | Shineys encountered: " .. shinyCounter)
        log("Info | Pokemon caught: " .. catchCounter)
        log("Info | Pokemon encountered: " .. wildCounter)
    elseif stringContains(wild, "Success! You caught ") then
        catchCounter = catchCounter + 1
        log("Info | Shineys encountered: " .. shinyCounter)
        log("Info | Pokemon caught: " .. catchCounter)
        log("Info | Pokemon encountered: " .. wildCounter)
    elseif stringContains(wild, "A Wild ") then
       wildCounter = wildCounter + 1
       log("Info | Shineys encountered: " .. shinyCounter)
       log("Info | Pokemon caught: " .. catchCounter)
       log("Info | Pokemon encountered: " .. wildCounter)
    elseif wild == "You failed to run away!" then
       failedRun = true
    elseif wild == "You can not switch this Pokemon!" then
        failedRun = true
   end
end

function IsPokemonOnCaptureList()
  result = false
  if catchThesePokemon[1] ~= "" then
  for i = 1, TableLength(catchThesePokemon), 1 do
      if getOpponentName() == catchThesePokemon[i] then
          result = true
          break
      end
  end
  end
  return result
end

function TableLength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end

function hasSync()
    for syncId = 1, getTeamSize() do
        if getPokemonAbility(syncId) == "Synchronize" then
            return syncId, true
        end
    end
    return false
end

function hasSwipe()
    for swipeId = 1, getTeamSize() do
        if hasMove(swipeId, "False Swipe") then
            return swipeId, true
        end
    end
    return false
end

function hasStatus()
    for statusId = 1, getTeamSize() do
        if hasMove(statusId, statusMove) then
            return statusId, true
        end
    end
    return false
end


function isTeamUsable()
local syncId = hasSync()
local swipeId = hasSwipe()
local statusId = hasStatus()
    if (hasSync() and getPokemonHealth(syncId) >= 1)  
    or (hasSwipe() and (getRemainingPowerPoints(swipeId, "False Swipe") >= 1 or getPokemonHealth(swipeId) >= 1))
    or (hasStatus() and (getRemainingPowerPoints(statusId, statusMove) >= 1 or getPokemonHealth(statusId) >= 1)) then
    return true end
end

function onPathAction()
    if isTeamUsable() then
        if getMapName() == location then
            if lookForGrass then
                moveToGrass()
            elseif lookForWater then
                moveToWater()
            elseif caveGround then
                moveToRectangle(minX, minY, maxX, maxY)
            end
        else pf.MoveTo(location)
        end
    else
        pf.UseNearestPC()
    end
end

function onBattleAction()
    if isWildBattle() and (isOpponentShiny() or IsPokemonOnCaptureList()) then
        if hasSync() and getActivePokemonNumber() == hasSync() then
            if hasSwipe() and getRemainingPowerPoints(hasSwipe(), "False Swipe") >= 1 then
                if sendPokemon(hasSwipe()) then return end
            elseif hasStatus() and getRemainingPowerPoints(hasStatus(), statusMove) >= 1 then
                if sendPokemon(hasStatus()) then return end
            else
                if sendUsablePokemon() or sendAnyPokemon() or useItem(typeBall) or run() then return end
            end
        elseif hasSwipe() and getActivePokemonNumber() == hasSwipe() then
            if getRemainingPowerPoints(hasSwipe(), "False Swipe") >= 1 then
                if getOpponentHealthPercent() > throwHealth then
                    if useMove("False Swipe") then return end
                else
                    if getOpponentHealthPercent() == throwHealth then
                        if hasStatus() then
                            if sendPokemon(hasStatus()) then return end
                        else
                            if useItem(typeBall) then return end
                        end
                    end
                end
            elseif hasStatus() and getRemainingPowerPoints(hasStatus(), statusMove) >= 1 then
                if sendPokemon(hasStatus()) then return end
            else
                if sendUsablePokemon() or sendAnyPokemon() or useItem(typeBall) or run() then return end
            end
        elseif hasStatus() and getActivePokemonNumber() == statusId() then
            if getRemainingPowerPoints(hasStatus(), statusMove) >= 1 then
                if getOpponentStatus() ~= status then
                    if useMove(statusMove) then return end
                else
                    if useItem(typeBall) then return end
                end
            else
                if sendUsablePokemon() or sendAnyPokemon() or useItem(typeBall) or run() then return end
            end
        else
            if isPokemonUsable(getActivePokemonNumber()) then
                if getOpponentHealthPercent() > throwHealth then
                    if useWeakMove() then return end
                else
                    if getOpponentHealthPercent() == throwHealth then
                        if useItem(typeBall) then return end
                    end
                end
            else
                if sendUsablePokemon() or sendAnyPokemon() or useItem(typeBall) or run() then return end
            end
        end
    else
        if failedRun then
            failedRun = false
            return sendUsablePokemon() or attack()
        else
            return run() or sendUsablePokemon()
        end
    end    
    return run() or sendUsablePokemon()
end
 
Reply
#3
I'm looking through your script and this part:

local statusMove = "Hypnosis"

What does this work with?

And is there a way to change it to catch ONLY shiny? 

local catchThesePokemon = {"Gyarados", "Dragonair"}
 
Reply
#4
If you want to use a status move to put traget to sleep or paralyze, put in the move name, if not just leave "".
local statusMove = ""

If you want just shineys, same thing, just leave a "".

local catchThesePokemon = {""}
 
Reply
#5
Ok cool, that's what I was going to test with but wanted to make sure.

I appreciate it. I'll test it a bit and see how it works.

Oh and the other thing, location just does a single map? Which is fine with me, just want to check.
 
Reply
#6
Yeah it does just one map. I dunno if I can do multiple maps, Ill look into it.
 
Reply
#7
(2016-10-13, 00:02:49)Crazy3001 Yeah it does just one map. I dunno if I can do multiple maps, Ill look into it.

No worries, it is working..I just haven't encountered any shiny's yet. But from what I've been hearing it's 1/6000+ chance. I'm not close to that yet.
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)