Hello There, Guest! Login Register


switch pokemons in my script
#1
so what i want to do is when my first pokemon is dead or have no pp anymore i want it to switch with my secend pokemon and so on so on (replace it in my team line up)

this is my script but it dosent work


 -- Copyright © 2016 Silv3r <silv3r@openmailbox.org>
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.

name = "Leveling: Victory Road (near Indigo Plateau)"
author = "Silv3r"
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 exit of the Victory Road and the Indigo Plateau.]]

function onPathAction()
              if isPrivateMessageEnabled() then log("Private messages disabled.") return disablePrivateMessage() end
                if not isPokemonUsable(1) then
                     swapPokemon(1, getUsablePokemonCount())
        if getMapName() == "Indigo Plateau Center" then
            moveToMap("Indigo Plateau")
        elseif getMapName() == "Indigo Plateau" then
            moveToMap("Victory Road Kanto 3F")
        elseif getMapName() == "Victory Road Kanto 3F" then
            moveToCell(34, 37)
                           elseif getMapName() == "Victory Road Kanto 2F" then
                                          moveToRectangle(34, 28, 40, 30)
        end
    else
                           if getMapName() == "Victory Road Kanto 2F" then
                                           moveToMap("Victory Road Kanto 3F")
        elseif getMapName() == "Victory Road Kanto 3F" then
            moveToMap("Indigo Plateau")
        elseif getMapName() == "Indigo Plateau" then
            moveToMap("Indigo Plateau Center")
        elseif getMapName() == "Indigo Plateau Center" then
            talkToNpcOnCell(4, 22)
        end
    end
end

function onBattleAction()
   if isWildBattle() and isOpponentShiny() then
       if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
           return
       end
else
return attack() or sendUsablePokemon() or sendAnyPokemon()  or run()
   end


end
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)