Hello There, Guest! Login Register


Script error catches all pokemon in route 34
#1
This is a leveling script I modified from one of silver's scripts. This script will level the first of your team in route 34 and heal up in Goldenrod. Till now there are no issues feel free to give any advice. Hope you like my first modifying script. Copyrights to Silver again. The script went wrong catching all pokemon it meets what should I do.

Script:

-- Copyright © 2016 KimoK <misterotaku77@gmail.com>
-- 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: Route 34"
author = "KimoK"
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 Goldenrod City and the Route 34.]]

function onPathAction()
    if isPokemonUsable(1) then
        if getMapName() == "Pokecenter Goldenrod" then
            moveToMap("Goldenrod City")
        elseif getMapName() == "Goldenrod City" then
            moveToMap("Route 34")
        elseif getMapName() == "Route 34" then
            moveToGrass()
        end
    else
        if getMapName() == "Route 34" then
            moveToMap("Goldenrod City")
        elseif getMapName() == "Goldenrod City" then
            moveToMap("Pokecenter Goldenrod")
        elseif getMapName() == "Pokecenter Goldenrod" then
            usePokecenter()
        end
    end
end

function onBattleAction()
    if isWildBattle() and ( isOpponentShiny() or (not isAlreadyCaught()) or (getOpponentName() == "Abra" ) or (getOpponentName() == "Ditto" ))  then
                if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
            return
            end
    end
    
    if getActivePokemonNumber() == 1 then
        return attack() or sendUsablePokemon() or run() or sendAnyPokemon()
    else
        return run() or attack() or sendUsablePokemon() or sendAnyPokemon()
    end
end
 
Reply
#2
So, as you asked on discord to review your script and help you improving it, here is my opinion
You could add a lot of logs, mount support and moveToRectangle() support.

For that, you'll need some functions as log() , isMounted(), useItem() and moveToRectangle()
If you want to do some detailled logs, you may need stringContains onPause(), onStop(), onDialogMessage() and onBattleMessage()
Have fun Smile.
I do NOT publish script and don't accept script requests.
I just help people do their own scripts.
 
Reply
#3
Thanks alot someone fiamlly helped me on this forum. Big Grin
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)