Hello There, Guest! Login Register


Vermilion City | Farm-Script | .lua
#1
Vermilion City Farm-Script

I had write a simple script to surf in the water in Vermilion City to catch any Squirtel where appeared. If you have any suggestions or found any bugs, please tell me.

First Pokemon: Sync
Second Pokemon: False Swipe

[Image: 95f920759bb1402ab3d0a42d63e2cbf2.jpg]
  • Catch every Shiny
  • Runs away from every Pokemon
  • Catch every Squirtle


[Image: 1db3a0aa89fa4c9890b77037d08c6b20.png]

Royal 14th June 2016: Bug fixed
19th June 2016: Bug fixed

[Image: 57e4fd7b135f4a1e839ac392ee7d539e.jpg]

name = "Farm-Script | Vermilion City"
author = "Royal"
description = [[Starting Maps: Pokecenter Vermilion; Vermilion City.
Farming in Vermilion City for Squirtel and Shinies.
First Pokemon: Sync
Second Pokemon: False Swipe
]]

function onStart()
    wildCounter = 0
    squirtleCounter = 0
    shinyCounter = 0
end

function onBattleMessage(wild)
    if wild == "A Wild SHINY " then
        shinyCounter = shinyCounter + 1
        wildCounter = wildCounter + 1
    elseif wild == "A Wild [FF9900]Squirtle[-] Attacks!" then
        snubullCounter = squirtleCounte + 1
        wildCounter = wildCounter + 1
    end
end

function onPause()
    log("Pokemons encountered: " .. wildCounter)
    log("Shinies encountered: " .. shinyCounter)
    log("Squirtle's encountered: " .. squirtleCounter)
end

function onPathAction()
    if (isPokemonUsable(1) and isPokemonUsable(2) and getRemainingPowerPoints(2, "False Swipe") > 1) then
        if getMapName() == "Pokecenter Vermilion" then
            moveToMap("Vermilion City")
        elseif getMapName() == "Vermilion City" then
            moveToWater()
        end
    else
        if getMapName() == "Vermilion City" then
            moveToMap("Pokecenter Vermilion")
        elseif getMapName() == "Pokecenter Vermilion" then
            usePokecenter()
        end
    end
end

function onBattleAction()
    if isWildBattle() and isOpponentShiny() or getOpponentName() == "Squirtle" then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2) or run()
        elseif getActivePokemonNumber == 2 and getOpponentHealth() > 1 then
            return weakAttack() or run()
        elseif getOpponentHealth() == 1 then
            if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
                return
            end
        end
    if getActivePokemonNumber() >= 1 then
            return run() or attack()
        end
    end
end

-- Feel free to edit it, use it for your own script, do whatever you want.

[Image: Credits_Royal.jpg]
  • BestKiller, thank your very much for these wonderful pictures!
 
Reply
#2
Skyver Hey, Royal. Look that you wrote "Squirtel" instead "Squirtle"

:p

Thank you very much for telling this! <3
 
Reply
#3
if getMapName() == "Pokecenter Vermilion" then
    moveToMap("Vermilion City")
elseif getMapName() == "Vermilion City" then
    moveToCell(27, 26)
elseif (getPlayerX() == 27 and getPlayerY() == 26) then
    moveToWater()
end

This part is incorrect.
Please test your scripts before releasing them or at least write that they are currently untested.
 
Reply
#4
Silv3r
if getMapName() == "Pokecenter Vermilion" then
    moveToMap("Vermilion City")
elseif getMapName() == "Vermilion City" then
    moveToCell(27, 26)
elseif (getPlayerX() == 27 and getPlayerY() == 26) then
    moveToWater()
end

This part is incorrect.
Please test your scripts before releasing them or at least write that they are currently untested.

Well, somebody told me it's working fine. Next time I will test it by myself.
 
Reply
#5
getOpponentName() == "Squirtle,Tentacool"

This will not work, there is no Pokémon named "Squirtle,Tentacool".
You have to write something like that:

( getOpponentName() == "Squirtle" or getOpponentName() == "Tentacool" )
 
Reply
#6
[Image: Update_Royal.jpg]

It should work now.
 
Reply
#7
Royal https://s32.postimg.org/yiwam9bo5/Update_Royal.jpg

It should work now.

Didn't work for me, does first poke need sync? Should take off that req
 
Reply
#8
[12:07:20 PM] A Wild Tentacool Attacks!
[12:07:29 PM] No action executed: stopping the bot.
[12:07:29 PM] Bot stopped

[12:24:20 PM] A Wild Tentacruel Attacks!
[12:24:30 PM] No action executed: stopping the bot.
[12:24:30 PM] Bot stopped


Doesn't work...
 
Reply
#9
lightbearer [12:07:20 PM] A Wild Tentacool Attacks!
[12:07:29 PM] No action executed: stopping the bot.
[12:07:29 PM] Bot stopped

[12:24:20 PM] A Wild Tentacruel Attacks!
[12:24:30 PM] No action executed: stopping the bot.
[12:24:30 PM] Bot stopped


Doesn't work...

Give me a few minutes, I'll re-write this script. Wink

Could you test it now? It should work now fine.
 
Reply
#10
Hello Royal. I still have a problem with the script. It keeps showing the above message. I have placed Natu in first place with sync and scyther with false swipe in second. Does natu need to have a normal attack like peck? Because mine knows only psych attacks. Thank you for your time.
 
Reply
#11
kalel9 Hello Royal. I still have a problem with the script. It keeps showing the above message. I have placed Natu in first place with sync and scyther with false swipe in second. Does natu need to have a normal attack like peck? Because mine knows only psych attacks. Thank you for your time.

I'm so sorry, I found the bug. I'll fix it when I'm at home.
 
Reply
#12
snubullCounter = squirtleCounterCounter + 1
Hey Royal, there is an issue with the variable name. Smile
 
Reply
#13
loneacer
snubullCounter = squirtleCounterCounter + 1
Hey Royal, there is an issue with the variable name. Smile

Well, I'm stupid. Thank you very much. :-)
 
Reply
#14
[Image: Update_Royal.jpg]

I have to work now (it must work!). Big Grin
 
Reply
#15
I tried this and it seems to work. I hope I didn't mess your script.

function onBattleAction()
    if isWildBattle() and isOpponentShiny() then
        if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
            return
        end
    end
        if isWildBattle() and getOpponentName() == "Squirtle" then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2) or run()
        elseif getActivePokemonNumber == 2 and getOpponentHealth() > 1 then
            return weakAttack() or run()
        elseif getOpponentHealth() == 1 then
            if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
                return
            end
        end
    if isWildBattle() and getOpponentName() == "Tentacool" or getOpponentName() == "Tentacruel" or getOpponentName() == "Horsea" or getOpponentName() == "Poliwag" then
        return run() or sendUsablePokemon() or run() or sendAnyPokemon()
    else
        return attack() or run() or sendUsablePokemon() or sendAnyPokemon()
        end
    end
end

Edit: Add code tags. -- g0ld
 
Reply
#16
kalel9 I tried this and it seems to work. I hope I didn't mess your script.
function onBattleAction()
    if isWildBattle() and isOpponentShiny() then
        if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
            return
        end
    end
        if isWildBattle() and getOpponentName() == "Squirtle" then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2) or run()
        elseif getActivePokemonNumber == 2 and getOpponentHealth() > 1 then
            return weakAttack() or run()
        elseif getOpponentHealth() == 1 then
            if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
                return
            end
        end
    if isWildBattle() and getOpponentName() == "Tentacool" or getOpponentName() == "Tentacruel" or getOpponentName() == "Horsea" or getOpponentName() == "Poliwag" then
        return run() or sendUsablePokemon() or run() or sendAnyPokemon()
    else
        return attack() or run() or sendUsablePokemon() or sendAnyPokemon()
        end
    end
end

Looks good. Wink

Could somebody test my script? It should work now. Smile
 
Reply
#17
Still getting no action!

[5:48:09 PM] A Wild Tentacool Attacks!
[5:48:17 PM] No action executed: stopping the bot.
[5:48:17 PM] Bot stopped


what's the problem?

name = "Farm-Script | Vermilion City"
author = "Royal"
description = [[Starting Maps: Pokecenter Vermilion; Vermilion City.
Farming in Vermilion City for Squirtel and Shinies.
First Pokemon: Sync
Second Pokemon: False Swipe
]]

function onStart()
    wildCounter = 0
    squirtleCounter = 0
    shinyCounter = 0
end

function onBattleMessage(wild)
    if wild == "A Wild SHINY " then
        shinyCounter = shinyCounter + 1
        wildCounter = wildCounter + 1
    elseif wild == "A Wild [FF9900]Squirtle[-] Attacks!" then
        snubullCounter = squirtleCounterCounter + 1
        wildCounter = wildCounter + 1
    end
end

function onPause()
    log("Pokemons encountered: " .. wildCounter)
    log("Shinies encountered: " .. shinyCounter)
    log("Squirtle's encountered: " .. squirtleCounter)
end

function onPathAction()
    if (isPokemonUsable(1) and isPokemonUsable(2) and getRemainingPowerPoints(2, "False Swipe") > 1) then
        if getMapName() == "Pokecenter Vermilion" then
            moveToMap("Vermilion City")
        elseif getMapName() == "Vermilion City" then
            moveToWater()
        end
    else
        if getMapName() == "Vermilion City" then
            moveToMap("Pokecenter Vermilion")
        elseif getMapName() == "Pokecenter Vermilion" then
            usePokecenter()
        end
    end
end

function onBattleAction()
    if isWildBattle() and isOpponentShiny() then
        if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
            return
        end
    end
        if isWildBattle() and getOpponentName() == "Squirtle" then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2) or run()
        elseif getActivePokemonNumber == 2 and getOpponentHealth() > 1 then
            return weakAttack() or run()
        elseif getOpponentHealth() == 1 then
            if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
                return
            end
        end
    if isWildBattle() and getOpponentName() == "Tentacool" or getOpponentName() == "Tentacruel" or getOpponentName() == "Horsea" or getOpponentName() == "Poliwag" then
        return run() or sendUsablePokemon() or run() or sendAnyPokemon()
    else
        return attack() or run() or sendUsablePokemon() or sendAnyPokemon()
        end
    end
end

Edit: added code tags -- Silv3r
 
Reply
#18
log("Pokemons encountered: " .. wildCounter)
    log("Shinies encountered: " .. shinyCounter)
    log("Squirtle's encountered: " .. squirtleCounter)
You can write this code instead to gain space :
log("Pokemons encountered : "..wildCounter.." ("..shinyCounter.." Shiny, "..squirtleCounter.." Squirtle(s) )")
It will write "Pokemons encountered : 23 ( 0 Shiny, 1 Squirtle(s) )"
For 23 encounters, 0 shiny and 1 squirtle xD
I do NOT publish script and don't accept script requests.
I just help people do their own scripts.
 
Reply
#19
lightbearer Still getting no action!

[5:48:09 PM] A Wild Tentacool Attacks!
[5:48:17 PM] No action executed: stopping the bot.
[5:48:17 PM] Bot stopped


what's the problem?

name = "Farm-Script | Vermilion City"
author = "Royal"
description = [[Starting Maps: Pokecenter Vermilion; Vermilion City.
Farming in Vermilion City for Squirtel and Shinies.
First Pokemon: Sync
Second Pokemon: False Swipe
]]

function onStart()
    wildCounter = 0
    squirtleCounter = 0
    shinyCounter = 0
end

function onBattleMessage(wild)
    if wild == "A Wild SHINY " then
        shinyCounter = shinyCounter + 1
        wildCounter = wildCounter + 1
    elseif wild == "A Wild [FF9900]Squirtle[-] Attacks!" then
        snubullCounter = squirtleCounterCounter + 1
        wildCounter = wildCounter + 1
    end
end

function onPause()
    log("Pokemons encountered: " .. wildCounter)
    log("Shinies encountered: " .. shinyCounter)
    log("Squirtle's encountered: " .. squirtleCounter)
end

function onPathAction()
    if (isPokemonUsable(1) and isPokemonUsable(2) and getRemainingPowerPoints(2, "False Swipe") > 1) then
        if getMapName() == "Pokecenter Vermilion" then
            moveToMap("Vermilion City")
        elseif getMapName() == "Vermilion City" then
            moveToWater()
        end
    else
        if getMapName() == "Vermilion City" then
            moveToMap("Pokecenter Vermilion")
        elseif getMapName() == "Pokecenter Vermilion" then
            usePokecenter()
        end
    end
end

function onBattleAction()
    if isWildBattle() and isOpponentShiny() then
        if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
            return
        end
    end
        if isWildBattle() and getOpponentName() == "Squirtle" then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2) or run()
        elseif getActivePokemonNumber == 2 and getOpponentHealth() > 1 then
            return weakAttack() or run()
        elseif getOpponentHealth() == 1 then
            if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
                return
            end
        end
    if isWildBattle() and getOpponentName() == "Tentacool" or getOpponentName() == "Tentacruel" or getOpponentName() == "Horsea" or getOpponentName() == "Poliwag" then
        return run() or sendUsablePokemon() or run() or sendAnyPokemon()
    else
        return attack() or run() or sendUsablePokemon() or sendAnyPokemon()
        end
    end
end

Edit: added code tags -- Silv3r

I'm confused, I'll check this later.
 
Reply
#20
This is not my work and i am sorry for posting this without permission. Just replace with the following for onBattleAction. For me it is working fine.

function onBattleAction()
    if isWildBattle() and ( isOpponentShiny() or (getOpponentName() == "Squirtle" )) then
        if getActivePokemonNumber() == 1 then

            return sendPokemon(2)

        elseif ( getActivePokemonNumber() == 2 ) and ( getOpponentHealth() > 1 ) then

            return weakAttack()

        elseif  getOpponentHealth() == 1 then

            return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or run()
        
        end    
    end
    if isWildBattle() then
        return run()
        end
end
 
Reply
#21
kalel9 This is not my work and i am sorry for posting this without permission. Just replace with the following for onBattleAction. For me it is working fine.

function onBattleAction()
    if isWildBattle() and ( isOpponentShiny() or (getOpponentName() == "Squirtle" )) then
        if getActivePokemonNumber() == 1 then

            return sendPokemon(2)

        elseif ( getActivePokemonNumber() == 2 ) and ( getOpponentHealth() > 1 ) then

            return weakAttack()

        elseif  getOpponentHealth() == 1 then

            return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or run()
        
        end    
    end
    if isWildBattle() then
        return run()
        end
end

Feel free to post whatever you want if this help to improve the script. Thank you very much. Wink
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)