Hello There, Guest! Login Register


ProTo's Script | Reworked
#1
Big Grin 
Hi guys!

I've been working lately on the awesome Proto's Script, since Proto left it for a while now I've decided to take it up a notch, so here's the current status of the script so far:

---------------------------------------------------------------------------------------
-- ## LUA Script by ProTo, do not share it outside of the proshine-bot.com board!
-- ## LUA Script von ProTo, bitte nicht außerhalb des proshine-bot.com Forum teilen!
---------------------------------------------------------------------------------------
-- Current Version: 0.7 | Latest Changes
--        - Code Cleanup #2
--        - Try to check every possibillity in a fight (prevent Error's)
--        - Reset Statistic (Turn ON, Start Bot)
--                            (It will stop the bot right after, with that the Statistic got reset!)
---------------------------------------------------------------------------------------
--        I will not include the EXP-Share Method!
---------------------------------------------------------------------------------------
--        PLEASE GIVE A REVUE ON 'PROSHINE-BOT.COM'
---------------------------------------------------------------------------------------
--        WARNING: WE DO NOT TAKE RESPONSABILITY FOR ANY BANNED ACCOUNT,
--                 USE AT YOU OWN RISK
---------------------------------------------------------------------------------------
-- Note: I comment everything because im mostly high while scripting this,
--         without them i would forget everything c:
---------------------------------------------------------------------------------------

name = "ProTo's Script | Reworked"
authors = "ProTo", "Zai"
description = [[
-------------------------------------
Usage: Press on 'Show Settings', then configurate the script.
OPTIONS: Walk/Level Bot - Run/Kill every pokemon encountered besides shinies and desired.
OPTIONS: False Swipe - It will use a pokemon with this move, then it will catch it
OPTIONS: Thief - Steals wild Pokemons' held items and auto removes them after battle. Only works if the first Pokemon has the Frisk ability, and another one with the thief move (better have a Pokemon with Frisk + Thief like Furret).
OPTIONS: EV training - Use 'ATK', 'SPATK', 'DEF', 'SPDEF', 'SPD' or 'HP' without '' to choose which you want to train. Use space to separate each desired EV! Macho Brace, if available, is autoequipped on first Pokemon. Must restart the bot to show options.
OPTIONS: Custom Move - Use custom movement. Coordinates must be input. Must restart the bot to show options.
OPTIONS: Disable PM's - Disable private messages from other users. Doesn't work with GM's messages though.
OPTIONS: Reset Statistics - Activate it once, then start. It will deactivate on it's own. Dont activate it again!
OPTIONS: Place to level/farm - Desired location where you want to level/farm/Move. like 'Route 8' without ''!
OPTIONS: Desired Pokemons - Names of the Pokemons your hunting like 'Abra' without '', use space to separate names!
OPTIONS: Ball - The ball to use, like: 'Pokeball' without ''! The bot uses other balls if you dont have desired one's.
OPTIONS: Train - The number of Pokemons you wish to train. The number (1-6) means if the Pokemon on that index is unusable the bot will go to pokecenter. Use in conjunction with Ev training.
OPTIONS: Grass/Water/Ground - The type of movement.
OPTIONS: Level Cap - The max level you wish a pokemon to level. As Ev training, the Train option defines the number you want to train. It will train one at a time before swapping to the next pokemon.
OPTIONS: MinXYMaxXY - Coordinates for Custom Move.
OPTIONS: Ev Profile - Define a profile in accordance with the order inserted in Ev training. Pokemons will swap depending on how many you want to train.
]]

-- ## Settings/Einstellungen
local PathFinder = require "Pathfinder.MoveToApp"
require = "OptionsCheck"
local map = nil

uncaughtCatch = 0
wildEncounter = 0
desiredEncounter = 0
wantedCatch = 0
shinyEncounter = 0
shinyCatch = 0
levelUpCounter = 0
heldItemsCounter = 0
stolenItemsCounter = 0
falseSwipeIndex = 0
thiefIndex = 0
stealStatus = 0
resetStats = 0
swapStatus = 0
evSwap = 1
levelCapSwap = 1
evBattleSwap = 0
inBattleStatus = 0
disabledStatus = 0
evArray = {"HP","SPD","ATK","SPATK","DEF","SPDEF"}
-- ## End Settings/Einstellungen

-- ## GUI Settings
tab = {"Walk/Level Bot", "False Swipe", "Thief", "Better ball", "EV Training", "Custom Move", "Disable PM's", "Reset Stats"}
for i = 1, 8 do
    setOptionName(i, tab[i].."")
end
    setOptionDescription(1, "On = Battle everything; Off = Run away from wild Pokemons")
    setOptionDescription(2, "Use False Swipe. Must have a Pokemon with the move in your party")
    setOptionDescription(3, "Steal wild Pokemon's held item. Needs a Pokemon with Frisk ability in the first position of the party and another with the Thief move")
    setOptionDescription(4, "Use better Pokeballs if available")
    setOptionDescription(5, "Must be active and the EV field filled. Macho brace will automatically change to the first usable Pokemon if available")
    setOptionDescription(6, "Turn on to use custom movement. Bot must be restarted after enabling and disabling. Coordinates must be valid")
    setOptionDescription(7, "Disable Private Messages. GM's may still bypass this when sending messages to you")
    setOptionDescription(8, "Reset statistics. Bot must be restarted after enabling")
    setTextOptionName(1, "Location")
    setTextOptionDescription(1, "Place to Level, farm or just move")
    setTextOption(1, getMapName())
    setTextOptionName(2, "Desired Pokemons")
    setTextOptionDescription(2, "Type the names, with/without separation")
    setTextOption(2, "")
    setTextOptionName(8, "Ball")
    setTextOption(8, "Pokeball")
    setTextOptionDescription(8, "Name of Pokeball to use")
    setTextOptionName(9, "Train")
    setTextOptionDescription(9, "Number of Pokemons to train. Regulates the amount of Pokemons for Ev training and Level training.")
    setTextOption(9, "1")
    setTextOptionName(12, "Level Cap")
    setTextOptionDescription(12, "Level cap for Pokemons. Levels the first Pokemon until cap is reached. Will stop the bot once training is complete")
    setTextOption(12, "")
    setTextOptionName(3, "Movement Type")
    setTextOption(3, "Ground")
    setTextOptionDescription(3, "Grass, Water or Ground")
-- ## End GUI Settings

-- ## Functions/Funktionen
function onPause()
    log("ProToScript | Paused")
end

function onResume()
    log("ProToScript | Resumed")
end

function onWarningMessage(isDifferentMap, distance) -- Alerts when relocated/teleported
    playSound("Assets/siren.wav")
    log("the distance is "..distance)
    if distance > 2 and not distance == 44 then
        fatal("Lag distance too great")
    end
end

function onSystemMessage(msg)
    if stringContains(msg, "You can't do this while surfing!") then -- Alerts to possible surf stuck situation
        playSound("Assets/siren.wav")
    end
end

function onStop() -- Alerts when the bot stops (can be a bit annoying, but useful)
    playSound("Assets/siren.wav")
end

function onStart() -- Bot starts here
    log("Map: "..getTextOption(1))
    log("Location: "..getTextOption(3))
    if (getTextOption(2) == "") then
        log("Desired Pokemons: None")
    elseif (getTextOption(2) != "") then
        log("Desired Pokemons: "..getTextOption(2))
    end
    log("Leader Pkmn LvL: "..tonumber(getPokemonLevel(1)))
    -- Check User Configuration
    checkConfiguration()
end

function checkConfiguration() -- Notification, Warnings, Errors
    if getOption(8) and resetStats == 0 then
        log("WARNING: Statistic's cleared!")
        log("WARNING: To start botting, start again!")
        setOption(8, false)
        uncaughtCatch = 0
        wildEncounter = 0
        desiredEncounter = 0
        wantedCatch = 0
        shinyEncounter = 0
        shinyCatch = 0
        levelUpCounter = 0
        heldItemsCounter = 0
        stolenItemsCounter = 0
        resetStats = 1
        fatal()
    elseif getOption(8) and resetStats == 1 then
        log("WARNING: Statistic's already cleared!")
    else
        -- User Configuration
        
        if getOption(1) then
            log("Level Bot: Yes")
        else
            log("Level Bot: No")
        end
        
        if getOption(2) then
            for i = 1, getTeamSize() do
                if(hasMove(i, "False Swipe")) then
                    falseSwipeIndex = i
                    log("Use False Swipe: Yes")
                end
            end
            if (falseSwipeIndex == 0) then
                log("Use False Swipe: No available Pokemon with that move")
                setOption(2, false)
            end
        else
            log("Use False Swipe: No")
        end
        
        if getOption(3) then
            for i = 1, getTeamSize() do
                if(hasMove(i, "Thief")) then
                    thiefIndex = i
                    log("Use Thief: Yes")
                end
            end
            if (thiefIndex == 0) then
                log("Use Thief: No available Pokemon with that move")
                setOption(3, false)
            end
        else
            log("Use Thief: No")
        end
        
        if getOption(4) then
            log("Always use better Ball: Yes")
        else
            log("Always use better Ball: No")
        end
        
        if getOption(5) then
            setTextOptionName(10, "EV's")
            setTextOptionDescription(10, "Ev's to train. Please use a space to separate each one")
            setTextOptionName(11, "EV Profile")
            setTextOptionDescription(11, "Trains current usable Pokemon's EV quantity to match the profile. Please insert the quantities in order with the EV's input")
            log("WARNING: EV training activated, please restart bot!")
        else
            removeTextOption(10)
            removeTextOption(11)
            log("EV Training: No")
        end
        
        if getOption(6) then
            removeTextOption(3)
            setTextOptionName(4, "MinX")
            setTextOptionDescription(4, "Coordinates")
            setTextOptionName(5, "MaxX")
            setTextOptionDescription(5, "Coordinates")
            setTextOptionName(6, "MinY")
            setTextOptionDescription(6, "Coordinates")
            setTextOptionName(7, "MaxY")
            setTextOptionDescription(7, "Coordinates")
            log("WARNING: Move type changed, please restart bot!")
        else
            setTextOptionName(3, "Movement Type")
            setTextOptionDescription(3, "Grass, Water or Ground")
            removeTextOption(4)
            removeTextOption(5)
            removeTextOption(6)
            removeTextOption(7)
            log("Custom Move: No")
        end
        
        if getOption(7) then
            disablePrivateMessage()
            log("Disable Private Messages: Yes")
        else
            enablePrivateMessage()
            log("Disable Private Messages: No\n")
        end
        
    end
end

function onBattleMessage(wild) -- For statistics and triggers
    if (resetStats == 1) then
        resetStats = 0
    end
    if stringContains(wild, "A Wild SHINY ") then
        shinyEncounter = shinyEncounter + 1
        playSound("Assets/dixie.wav")
    elseif stringContains(wild, "A Wild ") then
        wildEncounter = wildEncounter + 1
        if isAlreadyCaught() == false then
            uncaughtCatch = uncaughtCatch + 1
        elseif getTextOption(2) != "" then
            for str in string.gmatch(getTextOption(2), "%S+") do -- Checks desired Pokemon list
                if str == getOpponentName() then
                    desiredEncounter = desiredEncounter + 1
                    playSound("Assets/chinese.wav")
                end
            end
        end
    elseif stringContains(wild, "You have won the battle.") then
        log("\n")
        log("- -  Statistics  - -")
        log("Completed Level's: "..levelUpCounter)
        log("New Pokemons: "..uncaughtCatch)
        log("Pokemons encountered: "..wildEncounter)
        log("Shiny Pokemon caught/encountered: "..shinyCatch.."/"..shinyEncounter)
        log("Desired Pokemon caught/encountered: "..wantedCatch.."/"..desiredEncounter)
        log("Held items stolen/found: "..stolenItemsCounter.."/"..heldItemsCounter)
        log("- -  - -  - -  - -  - -\n")
    elseif stringContains(wild, "Success! You caught") and not isOpponentShiny()
        and getTextOption(2) != "" then
        for str in string.gmatch(getTextOption(2), "%S+") do -- Checks desired Pokemon list
            if str == getOpponentName() then
                wantedCatch = wantedCatch + 1
                playSound("Assets/cash.wav")
            end
        end        
        log("\n")
        log("- -  Statistics  - -")
        log("Completed Level's: "..levelUpCounter)
        log("New Pokemons: "..uncaughtCatch)
        log("Pokemons encountered: "..wildEncounter)
        log("Shiny Pokemon caught/encountered: "..shinyCatch.."/"..shinyEncounter)
        log("Desired Pokemon caught/encountered: "..wantedCatch.."/"..desiredEncounter)
        log("Held items stolen/found: "..stolenItemsCounter.."/"..heldItemsCounter)
        log("- -  - -  - -  - -  - -\n")
    elseif stringContains(wild, "Success! You caught") and isOpponentShiny() then
        shinyCatch = shinyCatch + 1
        playSound("Assets/cash.wav")
        log("\n")
        log("- -  Statistics  - -")
        log("Completed Level's: "..levelUpCounter)
        log("New Pokemons: "..uncaughtCatch)
        log("Pokemons encountered: "..wildEncounter)
        log("Shiny Pokemon caught/encountered: "..shinyCatch.."/"..shinyEncounter)
        log("Desired Pokemon caught/encountered: "..wantedCatch.."/"..desiredEncounter)
        log("Held items stolen/found: "..stolenItemsCounter.."/"..heldItemsCounter)
        log("- -  - -  - -  - -  - -\n")
    end
    if stringContains(wild, "has grown to") then
        levelUpCounter = levelUpCounter + 1
    end
    if getOption(3) then
        if stringContains(wild, "is holding") and stealStatus == 0 and isWildBattle() and getRemainingPowerPoints(thiefIndex, "Thief") > 0 then
        heldItemsCounter = heldItemsCounter + 1
        stealStatus = 1
        end
        if stringContains(wild, "stole") and stealStatus == 1 then
        stolenItemsCounter = stolenItemsCounter + 1
        stealStatus = 2
        end
    end
    if stringContains(wild, "was disabled!") then
        disabledStatus = 1
    end
    if stringContains(wild, "no longer disabled!") then
        disabledStatus = 0
    end
end

function onPathAction() -- Action Priorities Brain
    if inBattleStatus == 1 then -- sleeps bot after battle
        inBattleStatus = 0
        disabledStatus = 0
        sleep(2)
    end
    map = getMapName()
    if(getOption(2) or getOption(3) or getOption(5) or getTextOption(12) != "") then -- Update False Swipe, Thief and Ev training Pokemon's indexes
        recheckPositions()
    end
    if stealStatus == 2 then -- Removes thief's held item
        stealStatus = 0
        log("Removing stolen goods...")
        return takeItemFromPokemon(thiefIndex)
    elseif getOption(3) and stealStatus == 1 then
        stealStatus = 0
        log("Failed to steal item...")
    end
    if getOption(5) then -- Swaps Pokemon if Ev training is complete and equips the first pokemon with Macho Brace if available. Train number will specify the amount of Pokemons to Ev train
        if swapStatus == 1 then
            if hasItem("Macho Brace") and getPokemonHeldItem(1) == "Macho Brace" then
                takeItemFromPokemon(1)
            end
            if evSwap != tonumber(getTextOption(9)) then
                swapStatus = 0
                evSwap = evSwap + 1
                swapPokemon(1, evSwap)
            else
                log("Ev Training Complete!")
                evSwap = 0
                setTextOption(10, "")
                setTextOption(11, "")
                setOption(5, false)
                fatal()
            end
        end
        if hasItem("Macho Brace") and getPokemonHeldItem(1) != "Macho Brace" then
            return giveItemToPokemon("Macho Brace", 1)
        end
    end
    if getTextOption(12) != "" then -- Level cap
        if levelCapStatus == 1 then
            if levelCapSwap != tonumber(getTextOption(9)) then
                levelCapStatus = 0
                levelCapSwap = levelCapSwap +1
                return swapPokemon(1, levelCapSwap)
            else
                log("Level Training Complete!")
                fatal()
            end
        end
    end
    if isOutside() and not isMounted() and not isSurfing() and hasItem("Bicycle") then -- Auto use Bicyle
        return useItem("Bicycle")
    end
    if (not isPokemonUsable(tonumber(getTextOption(9))) or getPokemonHealthPercent(tonumber(getTextOption(9))) <= 10) -- Use Pokecenter
        or (getOption(2) and (getRemainingPowerPoints(falseSwipeIndex, "False Swipe") <= 1 or getPokemonHealthPercent(falseSwipeIndex) <= 10))
        or (getOption(3) and (getRemainingPowerPoints(thiefIndex, "Thief") <= 1 or getPokemonHealthPercent(thiefIndex) <= 10))
        or (getOption(5) and getUsablePokemonCount() != getTeamSize())
        or (getTextOption(12) != "" and getUsablePokemonCount() != getTeamSize())
    then
        evSwap = 1
        levelCapSwap = 1
        return usepokecenter()
    elseif isPokemonUsable(tonumber(getTextOption(9))) and (getOption(1) == false) then -- Just Walk
        PathFinder.moveTo(map, getTextOption(1))
    end
    if isPokemonUsable(tonumber(getTextOption(9))) and getOption(1) then -- Move functions
        if getMapName() == getTextOption(1) then
            if (getItemQuantity("Bicycle") > 0) and isOutside() and not isMounted() and not isSurfing() then
                useItem("Bicycle")
            end
            if getOption(6) then
                moveToRectangle(tonumber(getTextOption(4)), tonumber(getTextOption(6)), tonumber(getTextOption(5)), tonumber(getTextOption(7)))
            elseif getTextOption(3) == "Water" then
                moveToWater()
            elseif getTextOption(3) == "Grass" then                    
                moveToGrass()                    
            elseif getTextOption(3) == "Ground" then
                moveToNormalGround()
            end
        else
            PathFinder.moveTo(map, getTextOption(1))
        end
    end
end

function onBattleAction() -- Walk Bot
    inBattleStatus = 1
    if not getOption(1) and not isOpponentShiny() and isWildBattle() then
        return run()
    else
        checkOperation()
    end
end

function checkOperation() -- Battle Priorities Brain
    if isWildBattle() then
        if isOpponentShiny() then -- Catch shiny
            return customCatch()
        else
            if checkPokeballs() then -- Checks if there are pokeballs in inventory
                if not isAlreadyCaught() then -- Catch uncaught
                    return customCatch()
                end            
                if getTextOption(2) != "" then
                    for str in string.gmatch(getTextOption(2), "%S+") do -- Checks desired Pokemon list
                        if str == getOpponentName() then
                            return customCatch()
                        end
                    end
                end
            else
                log("Ran out of Pokeballs...")
                setTextOption(2, "")
            end
            if getOption(3) and stealStatus == 1 then -- Steal wild Pokemon's held item
                return stealHeldItem()
            end    
            if isPokemonUsable(getActivePokemonNumber()) and getOption(5) and not assertEV() then -- Ev training
                log("Running away...")
                return run() or sendUsablePokemon() or sendAnyPokemon()
            end
        end    
        walkOrLevelBot()
    else
        battle()
    end
end

function walkOrLevelBot() -- Level Bot
    if getOption(1) then
        if getOption(5) and not isPokemonUsable(getActivePokemonNumber()) then
            evBattleSwap = 1
            return run() or sendUsablePokemon() or sendAnyPokemon()
        end
        if isPokemonUsable(getActivePokemonNumber()) then
            if evBattleSwap == 1 then
                evBattleSwap = 0
                return run()
            elseif disabledStatus == 1 then
                return useAnyMove() or sendUsablePokemon() or sendAnyPokemon() or run()
            else
                return attack() or sendAnyPokemon() or run()
            end
        else
            return sendUsablePokemon() or sendAnyPokemon() or useAnyMove()
        end
    else -- Nothing/Nichts
        return run()
    end
end

function battle() -- Trainer Battle
    if isPokemonUsable(getActivePokemonNumber()) then
        if disabledStatus == 1 then
            return useAnyMove()
        else
            return attack() or sendAnyPokemon()
        end
    else
        return sendUsablePokemon() or sendAnyPokemon() or useAnyMove()
    end
end

function checkPokeballs() -- Checks the existence of pokeballs
    if hasItem("Pokeball") or hasItem("Great Ball") or hasItem("Ultra Ball") then
        return true
    else
        return false
    end
end

function catchFunction() -- New Catch Function/Neue Fang Function
    if getOption(4) then -- Always use better ball
        if getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity(getTextOption(8)) > 0 then
            return useItem(getTextOption(8))
        elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity("Ultra Ball") > 0 then
            return useItem("Ultra Ball")
        elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity("Great Ball") > 0 then
            return useItem("Great Ball")
        elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity("Pokeball") > 0 then
            return useItem("Pokeball")
        elseif getPokemonHealthPercent(getActivePokemonNumber()) < 1 then
            return sendAnyPokemon() or sendUsablePokemon()
        end
    else -- Normal catch try
        if getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity(getTextOption(8)) > 0 then
            return useItem(getTextOption(8))
        elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity("Pokeball") > 0 then
            return useItem("Pokeball")
        elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity("Great Ball") > 0 then
            return useItem("Great Ball")
        elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and getItemQuantity("Ultra Ball") > 0 then
            return useItem("Ultra Ball")
        elseif getPokemonHealthPercent(getActivePokemonNumber()) < 1 then
            return sendAnyPokemon() or sendUsablePokemon()
        end
    end
end

function customCatch() -- False swipe/normal Catch
    if getOption(2) and (getOpponentName() != "Abra" or getOpponentName() != "Machop" or getOpponentName() != "Machoke") then -- New False Swiper / support for fleeing/suicidal Pokemons
            if not hasMove(getActivePokemonNumber(), "False Swipe") then
                return sendPokemon(falseSwipeIndex) or catchFunction()
            elseif (isPokemonUsable(getActivePokemonNumber()) and (getActivePokemonNumber() == falseSwipeIndex) and (getOpponentHealth() > 10) and hasMove(getActivePokemonNumber(), "False Swipe")) then
                return useMove("False Swipe") or sendUsablePokemon()
            elseif getPokemonHealthPercent(getActivePokemonNumber()) > 0 and (getActivePokemonNumber() == falseSwipeIndex) and (getOpponentHealth() < 10) then
                return catchFunction()
            elseif getPokemonHealthPercent(getActivePokemonNumber()) < 1 or getRemainingPowerPoints(falseSwipeIndex, "False Swipe" == 0) then
                return sendUsablePokemon() or catchFunction()
            end
    elseif isPokemonUsable(getActivePokemonNumber()) then -- Normal Catch
        return catchFunction()
    elseif not isPokemonUsable(getActivePokemonNumber()) then
        return sendUsablePokemon() or catchFunction()
    end
end

function stealHeldItem() -- Steal Held Items from wild Pokemon
    if isPokemonUsable(getActivePokemonNumber()) then
        if getOption(3) then
            if not hasMove(getActivePokemonNumber(), "Thief") then
                return sendPokemon(thiefIndex) or checkOperation()
            elseif getActivePokemonNumber() == thiefIndex and hasMove(getActivePokemonNumber(), "Thief") and stealStatus != 0 then
                return useMove("Thief")
            elseif getPokemonHealthPercent(getActivePokemonNumber()) < 1 or getRemainingPowerPoints(thiefIndex, "Thief" == 0) then
                return sendUsablePokemon() or sendAnyPokemon() or run()
            end
        end
    else
        return checkOperation()
    end
end

function equipMachoBrace() -- Equips Macho Brace to next usable Pokemon. EV training only
    for i = 1, getTeamSize() do
        if isPokemonUsable(i) then
            return giveItemToPokemon("Macho Brace", i)
        end
    end
end    

function recheckPositions() -- Updates False Swipe and Thief Pokemon indexes and updates Ev training pokemon
    if getOption(2) then
        for i = 1, getTeamSize() do
            if(hasMove(i, "False Swipe")) then
                falseSwipeIndex = i
            end
        end
        if falseSwipeIndex == 0 then
            log("WARNING False Swipe: No available Pokemon with that move")
            setOption(2, false)
        end
    end
    if getOption(3) then
        for i = 1, getTeamSize() do
            if hasMove(i, "Thief") then
                thiefIndex = i
            end
        end
        if thiefIndex == 0 then
            log("WARNING Thief: No available Pokemon with that move")
            setOption(3, false)
        end
    end
    if getOption(5) and getTextOption(10) != "" then
        evProfile={}
        evStats={}
        avoidStats={}
        i = 1
        for str in string.gmatch(getTextOption(11), "%S+") do -- retrieve Ev profile
            evProfile[i] = tonumber(str)
            i = i + 1
        end
        i = 1
        for str in string.gmatch(getTextOption(10), "%S+") do -- retrieve desired Ev stats
            evStats[i] = str
            i = i +1
        end
        evStatus = 0
        for j = 1, i-1 do
            if evProfile[j] != nil then
                if getPokemonEffortValue(1, evStats[j]) >= evProfile[j] then
                    evStatus = evStatus + 1
                    avoidStats[evStatus] = evStats[j]
                end
            end    
            j = j + 1
        end
        if not totalEVpoints() or evStatus == i-1 then
            swapStatus = 1
        end
    end
    if getTextOption(12) != "" then
        if tonumber(getTextOption(12)) == tonumber(getPokemonLevel(1)) then
            levelCapStatus = 1
        end
    end
end

function totalEVpoints() -- Counts the total EV of a the first Pokemon
    totalPoints = 0
    for i = 1, getTeamSize() do
        totalPoints = totalPoints + getPokemonEffortValue(1, evArray[i])
    end
    if totalPoints < 510 then
        return true
    else
        return false
    end
end
    
function assertEV() -- Assert opponent's Ev
   for str in string.gmatch(getTextOption(10), "%S+") do -- Split desired EV's and checks each one with opponent's
        if isOpponentEffortValue(str) then
            if evStats != 0 then
                for i = 1, evStatus do
                    if avoidStats[i] == str then
                        return false
                    end
                    i = i + 1
                end
                return true
            end
        end
   end    
    return false
end

function sleep(sec) -- sleeps bot for X seconds
    local time = os.clock() + sec
    repeat until os.clock() > time
end

function usepokecenter() -- Moves to pokecenter and heals team
    log(" - -  Need Pokecenter  - -")
    PathFinder.useNearestPokecenter(map)
end

-- ## End Functions/Funktionen


Everything should work properly as long as you read the script settings and the tooltip descriptions in the bot itself.
I'd like to thank Proto for his wonderful contribution to the community, and I hope everyone enjoys our work.
If you find any problem please submit your issue with a log, if possible Smile
 
Reply
#2
Just one word: amazing. Everything works perfectly and it uses pathfinder really well, didn't get stuck anywhere so far, only thing that might be a nice add is some kind of exp sharing or switch training because low level pokes get pulverized Big Grin
 
Reply
#3
(2018-09-01, 18:23:05)ZoneX95 Just one word: amazing. Everything works perfectly and it uses pathfinder really well, didn't get stuck anywhere so far, only thing that might be a nice add is some kind of exp sharing or switch training because low level pokes get pulverized Big Grin

Thank you for your input, if any trouble should arise please post it here.

As for the bot getting stuck there's nothing to be done if synchronize fails, you will have to restart it.

As for the training part I'm not going to code Exp share, the script as it is will train x pokemon in these given conditions:
  1.  The "Train" option will basically exhaust your party until pokemon nº x faints or its hp drop to about 10%;
  2.  The "Ev training" will train your party according to the desired stats and profile specified by the "Train" number,
      so for best results place the pokemon you want to ev train in order;
I haven't tested the training option with level cap on more than one pokemon, so i don't know the outcome, although i think it works.
And using Level cap and Ev training together might result in failure since i've always Ev trained my pokemon from low level.


The "Ev training" will work fine as long as your pokemon aren't already above the desired profile to begin with.
Leaving the "Ev Profile" blank will basically make the bot flee from pokemon which don't have the desired stats, I'm not sure if it will still train multiple pokemon properly or just use the first one indefinitely.
Also try not to use pokemon which you are ev training in trainer battles, i'm sure the bot will not switch out the pokemon you want to train.
It's best to start ev training with your pokemon from scratch in a place where you wont have trainer battles to avoid misbehavior.
 
Reply
#4
Just a quick question, would desired pokes work with syncs eg: sync in 1st slot, false swiper in 2nd?
 
Reply
#5
(2018-09-01, 18:59:26)ZoneX95 Just a quick question, would desired pokes work with syncs eg: sync in 1st slot, false swiper in 2nd?

There is no need to put false swiper pokemon in second, you can have him in any slot, if "False Swipe" option is enabled he will jump in, use false swipe (i'm sure he only uses the move once, after that, if the desired pokemon's hp is above 10% it might fail), and throws a pokeball.

As for the synch pokemon it needs to be in first place always, so it's best to put it manually and have other options set in a way that the bot won't try and switch the party order (Level cap and Ev training do this once completed).

Also, an important note, the bot will always try and catch any uncaught pokemon it encounters, as long as it has pokeballs, so please always have pokeballs available, otherwise the bot will simply continue fighting everything it encounters.

Finally, i've confirmed that "Train" and "Level Cap" work as intended, stopping the bot once training is complete.
 
Reply
#6
Script doesn't go back to pokecenter if a pokemon has fainted?? Is there a way for that to be implemented?
 
Reply
#7
(2018-09-03, 14:44:38)TheShiba_Inu Script doesn't go back to pokecenter if a pokemon has fainted?? Is there a way for that to be implemented?

If you put "Train" to 1 and the pokemon you wish to train in first place it will go, please read the script settings and in bot tooltips, all you need to know is there.
 
Reply
#8
hello, how is this script used? could they explain me please n.n
 
Reply
#9
(2018-09-03, 19:58:10)Nata031 hello, how is this script used? could they explain me please n.n

1. Copy the code above into a text file with a name of your choosing.
2. Place the file inside the Script folder in Proshine's folder location.
3. Make sure you also have Pathfinder in the same folder.
4. Open Proshine and load the script.

That should do the trick
 
Reply
#10
idk why but sometimes it just randomly catches pokes even if they are not shinies
 
Reply
#11
(2018-10-24, 11:23:22)llllleeeeelllll idk why but sometimes it just randomly catches pokes even if they are not shinies

I noticed today as well. I'm suddenly out of pokeballs even I don't have the one I wanted encountered.

Empty name, wrong name, doesn't matter it still random catch pokemons not shiny/not on the list.

EDIT:

Also it randomly stops and I need to hit play again. Then it runs for 15 minutes or only 2 and I need to press play again. Not that much of a hassle since I always check the messages then but it doesn't run long without interaction.

[17:20:09] You have won the battle.
[17:20:15]  - -  Need Pokecenter  - -
[17:20:15] Path: Route 22->Viridian City->Pokecenter Viridian
[17:20:15] Path: Maps Remains: 2  Moving To: --> Viridian City
[17:20:18] Position updated: Viridian City (1, 49) [OK]
[17:20:22]  - -  Need Pokecenter  - -
[17:20:22] Path: Maps Remains: 1  Moving To: --> Pokecenter Viridian
[17:20:37] Position updated: Pokecenter Viridian (9, 22) [OK]
[17:20:39]  - -  Need Pokecenter  - -
[17:20:39] Pathfinder: Destination Reached.
[17:20:41]  - -  Need Pokecenter  - -
[17:20:41] Good day, Trainer!
[17:20:41] Welcome to Viridian City Pokemon Center.
[17:20:41] Would you like me to heal your Pokemon?
[17:20:43] Okay, let me take a look at those Pokemon.
[17:20:48] There you go, take care of them!
[17:20:48] Have a nice day!
[17:20:50] Path: Pokecenter Viridian->Viridian City->Route 22
[17:20:50] Path: Maps Remains: 2  Moving To: --> Viridian City
[17:20:51] Position updated: Viridian City (44, 44) [OK]
[17:20:54] Path: Maps Remains: 1  Moving To: --> Route 22
[17:21:08] Position updated: Route 22 (59, 10) [OK]
[17:21:12] No action executed: stopping the bot.
[17:21:12] Bot stopped
[17:22:09] System: You are now AFK!

EDIT 2:
I think the starting/stopping triggered something since I have been banned in 2 hours of using it Smile
 
Reply
#12
Any problem like

This move is disabled for 3 round/s! (When enemies used Disable)

It would be great if we had the option of using Potions, Super Potions, Hyper, Elixir, Ether, Equip Leftovers
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)