Hello There, Guest! Login Register


Help me script for teleport quest hoen
#1
This is my quest for doing teleport quest in hoen

However, it has problem when i come from pokecenter to city:
*Position updated: Pokecenter Fortree City (8, 17) [OK]
*Path: Pokecenter Fortree City->Fortree City->Route 120_A->Route 121->Lilycove City->Pokecenter Lilycove City
*Path: Maps Remains: 5  Moving To: --> Fortree City
*Position updated: Fortree City (8, 12) [OK]
*No action executed: stopping the bot.
*Bot stopped

Thank you
pf = require "Pathfinder/MoveToApp"

function onStart()
    done=0
    ask_security=false
    cannotrun=false
    log("***********START************")
end

function onDialogMessage(message)
    if stringContains(message, "successfully") then
        done = done + 1
    end
end
    
function onPathAction()
cannotrun=false
    if getMapName()=="Transmat Station"  then
        if ask_security==false then
            talkToNpcOnCell(1, 7)
            ask_security=true
        else
            moveToCell(9, 10)
        end
    end

    if getMapName()=="Pokecenter Oldale Town" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Petalburg City")
        end
    elseif getMapName()=="Pokecenter Petalburg City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Rustboro City")
        end
    elseif getMapName()=="Pokecenter Rustboro City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Verdanturf")
        end
    elseif getMapName()=="Pokecenter Verdanturf" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Mauville City")
        end
    elseif getMapName()=="Pokecenter Mauville City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Fortree City")
        end
    elseif getMapName()=="Pokecenter Fortree City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Lilycove City")
        end
    elseif getMapName()=="Pokecenter Lilycove City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Sootopolis City")
        end
    elseif getMapName()=="Pokecenter Sootopolis City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Mossdeep City")
        end
    elseif getMapName()=="Pokecenter Mossdeep City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Ever Grande City")
        end
    elseif getMapName()=="Pokecenter Ever Grande City" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Pacifidlog Town")
        end
    elseif getMapName()=="Pokecenter Pacifidlog Town" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Slateport")
        end
    elseif getMapName()=="Pokecenter Slateport" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Dewford Town")
        end
    elseif getMapName()=="Pokecenter Dewford Town" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Fallarbor Town")
        end
    elseif getMapName()=="Pokecenter Fallarbor Town" then
        if ask_security==false then
            talkToNpcOnCell(8, 4)
        else
            pf.moveTo(getMapName(), "Pokecenter Lavaridge Town")
        end
    end
end
    
function onBattleAction()

    if cannotrun==true then
        return attack()
    elseif isWildBattle() and isOpponentShiny() then
        return useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") or run() or attack() or sendAnyPokemon()
    end
    return run() or attack() or sendAnyPokemon()
end
 
Reply
#2
I am not too good at this script but I think Some thing happened to route 120 it couldn't find the route 120 or something happened with ask_security . or I don't know coz I am bad at this scripts.
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)