Hello There, Guest! Login Register


I need help with function on pathaction in route 24 water
#1
function onPathAction()
    
    if isPokemonUsable(1) and getPokemonEffortValue(1, "Attack") < 252 then
        if getMapName() == "Pokecenter Cerulean" then
            moveToMap("Cerulean City")
        elseif getMapName() == "Cerulean City" then
            if not isMounted() then
                useItem("S Talonflame Mount")
            elseif isMounted() then
                moveToMap("Route 24")
            end
        elseif getMapName() == "Route 24" then
            moveToWater() 
        end
    else
        if getMapName() == "Route 24" then    
            moveToMap("Cerulean City")
        elseif getMapName() == "Cerulean City" then    
            moveToMap("Pokecenter Cerulean")
        elseif getMapName() == "Pokecenter Cerulean" then    
            usePokecenter()
        end       
    end
end

function onBattleAction()
    if isWildBattle() and ( isOpponentShiny() ) then
            return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or attack() or run()
    elseif getActivePokemonNumber() == 1 and isOpponentEffortValue("Attack") and getPokemonEffortValue(1,"Attack") < 252 then
        log("Your "..getPokemonName(1).." have "..getPokemonEffortValue(1,"Attack").. " Atk EVs.")
        return attack() or sendPokemon(5) or sendPokemon(6) or run() 
    end

    
    return run() or sendUsablePokemon() or sendAnyPokemon()
    
end.



This script i changed a little bit to move to route 24 water, but i know i have to go through route 25 then go to route 24 water, i dont know how to write it. Can someone help me please
 
Reply
#2
If you want to move to route 25 then to route 24, there is nothing special to do, you can just call moveToMap.

elseif getMapName() == "Cerulean City" then
    moveToMap("Route 25")
elseif getMapName() == "Route 25" then
    moveToMap("Route 24")
elseif getMapName() == "Route 24" then
    moveToWater()
end
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)