(2016-12-06, 07:00:37)koplakbener (2016-12-06, 06:33:54)james6345 if isWildBattle() and ( isOpponentShiny() or getOpponentName() == "Eeve" or getOpponentName() == "Snover") or getOpponentName() == "Stantler" and getOpponentForm() ~= 0 then ^
^
well Eevee is not spelled right
Dont know if there anything else wrong off hand new to this
actually dont mind with eeve coz i dont have membership either :p
it just stop when i see stantler which maybe xmas poke, because i doesnt problem to cacth snover and run normal stantler before
[12:04:52 PM] A Wild Stantler Attacks!
[12:04:52 PM] Stantler's Intimidate cuts Kadabra's attack!
[12:04:58 PM] You have run away from the wild Pokemon.
[12:05:03 PM] Position updated: Flake Wood (10, 33) [OK, lag, distance=2]
[12:05:03 PM] A Wild Swinub Attacks!
[12:05:09 PM] You have run away from the wild Pokemon.
[12:05:14 PM] Position updated: Flake Wood (9, 33) [OK, lag, distance=3]
[12:05:14 PM] A Wild Delibird Attacks!
[12:05:18 PM] You have run away from the wild Pokemon.
[12:05:26 PM] Position updated: Flake Wood (11, 34) [OK, lag, distance=3]
[12:05:26 PM] A Wild Patrat Attacks!
[12:05:31 PM] You have run away from the wild Pokemon.
[12:05:36 PM] Position updated: Flake Wood (7, 36) [OK, lag, distance=4]
[12:05:36 PM] A Wild Patrat Attacks!
[12:05:42 PM] You have run away from the wild Pokemon.
[12:05:52 PM] Position updated: Flake Wood (9, 32) [OK, lag, distance=2]
[12:05:52 PM] A Wild Stantler Attacks!
[12:05:56 PM] Error during the script execution: chunk_1:(44,8-31): attempt to perform arithmetic on a nil value
[12:05:56 PM] Bot stopped
[12:06:53 PM] System: You are now AFK!
Ok so I was playing around and made this you will need to edit the rectangle you want to walk within and I wont list the ones I use sorry.
P.s. I did not make all of this someone on discord game me it to start scripts with dont remember who sorry I just edit it to work with event pokemon and places I want to farm, its edit to catch any event pokemon in the event zones so you can set it up to farm others spots too and you dont have to worrie about editing main code just core settings like spots.
update too working for me got a event pokemon already with it.
--supports up to 5 stops, leave unused stops blank--
city = "Viridian City"
pokecenter = "Pokecenter Viridian"
stop1 = ""
stop2 = ""
stop3 = ""
stop4 = ""
stop5 = ""
endLocation = "Flake Wood"
martLocation = "Viridian Pokemart"
-- Bot stop timer --
stopBotByTime = false
stopTime = 9999999
-- Bot stop encounter --
stopBotByEnc = true
stopCount = 9999999
-- Settings for escape rope --
useEscapeRope = false
--if no city, and pokecenter is on route, change this to true, and leave city blank--
pokecenterOnRoute = false
--Leave this true unless you are not fighting/catching in grass--
lookForGrass = false
--If the above is false, what rectangle do you want to walk within at your endLocation?--
rectX1 =
rectX2 =
rectY1 =
rectY2 =
--the below will be the percentage of your opponent's health we'll start throwing balls at--
--DEFAULT: 100--
percentToStartThrowing = 99
--DEFAULT: 100--
percentToStartThrowingIfShiny = 99
--DEFAULT: 100--
percentToStartThrowingIfForm = 99
--Do you want to catch shineys and uncaught pokemon?--
catchShineys = true
catchNotCaught = true
--Do you only want to catch pokemon, and not level?--
onlyCatch = false
--the below is case-sensitive, add more moves by adding commas. ex : onlyCatchThesePokemon = {"Pokemon 1", "Pokemon 2", "Pokemon 3"}--
--Even if you set all other capture variables to false, we'll still try to catch these/this pokemon--
--Leave an empty "" here if you aren't using it--
catchThesePokemon = {"Glaceon", "Eevee", "Snover"}
--the below will be the percentage of your last alive poke's health that we'll stop fighting at--
--DEFAULT: 50--
healthToRunAt = 80
--Level to stop levelling mons, set to a value over 100 if you are just catching and have a lvl 100 team--
levelPokesTo = 101
--the below is case-sensitive, add more moves by adding commas. ex : movesNotToForget = {"Move 1", "Move 2", "Move 3"}--
--Leave an empty "" here if you aren't using it--
movesNotToForget = {"Earthquake", "Double-Edge", "Ice Fang", "Thunder Fang", "Fire Fang", "Play Rough", "Bite", "Covet", "Low Kick", "Quick Attack", "Ice Punch", "Thunder Punch", "Fire Punch", "Sky Uppercut", "Thunderbolt", "Thunder", "Thrash", "Horn Attack", "Poison Jab"}
--Start Script--
name = "Level-Script | Anywhere"
author = "Credit to Royal for providing the base framework"
description = "Training at " .. endLocation .. " and healing at " .. pokecenter .. "." .. " Leveling all pokemon in teams to " .. levelPokesTo .. "."
stops = 0
function onStart()
shinyCounter = 0
wildCounter = 0
pokecenterCounter = 0
if stop1 ~= "" then
stops = stops + 1
end
if stop2 ~= "" then
stops = stops + 1
end
if stop3 ~= "" then
stops = stops + 1
end
if stop4 ~= "" then
stops = stops + 1
end
if stop5 ~= "" then
stops = stops + 1
end
end
function onBattleMessage(wild)
if stringContains(wild, "A Wild SHINY ") then
shinyCounter = shinyCounter + 1
wildCounter = wildCounter + 1
log("Info | Shineys encountered: " .. shinyCounter)
log("Info | Pokemon encountered: " .. wildCounter)
elseif stringContains(wild, "A Wild ") then
wildCounter = wildCounter + 1
log("Info | Shineys encountered: " .. shinyCounter)
log("Info | Pokemon encountered: " .. wildCounter)
end
end
function onDialogMessage(pokecenter)
if stringContains(pokecenter, "Would you like me to heal your Pokemon?") then
pokecenterCounter = pokecenterCounter + 1
log("Info | Times in Pokecenter: " .. pokecenterCounter)
end
end
function onPause()
log("Info | Shineys encountered: " .. shinyCounter)
log("Info | Pokemon encountered: " .. wildCounter)
log("Info | Times in Pokecenter: " .. pokecenterCounter)
end
function IsSorted()
if getTeamSize() == 1 then
return true
elseif getTeamSize() == 2 then
if getPokemonLevel(1) <= getPokemonLevel(2) then
return true
else
return false
end
elseif getTeamSize() == 3 then
if getPokemonLevel(1) <= getPokemonLevel(2) and getPokemonLevel(2) <= getPokemonLevel(3) then
return true
else
return false
end
elseif getTeamSize() == 4 then
if getPokemonLevel(1) <= getPokemonLevel(2) and getPokemonLevel(2) <= getPokemonLevel(3) and getPokemonLevel(3) <= getPokemonLevel(4) then
return true
else
return false
end
elseif getTeamSize() == 5 then
if getPokemonLevel(1) <= getPokemonLevel(2) and getPokemonLevel(2) <= getPokemonLevel(3) and getPokemonLevel(3) <= getPokemonLevel(4) and getPokemonLevel(4) <= getPokemonLevel(5) then
return true
else
return false
end
elseif getTeamSize() == 6 then
if getPokemonLevel(1) <= getPokemonLevel(2) and getPokemonLevel(2) <= getPokemonLevel(3) and getPokemonLevel(3) <= getPokemonLevel(4) and getPokemonLevel(4) <= getPokemonLevel(5) and getPokemonLevel(5) <= getPokemonLevel(6) then
return true
else
return false
end
end
end
function ReturnHighestIndexUnderLevel()
result = 0
for i = 1, getTeamSize(), 1 do
if getPokemonLevel(i) < levelPokesTo then
result = i
end
end
return result
end
function IsPokemonOnCaptureList()
result = false
if catchThesePokemon[1] ~= "" then
for i = 1, TableLength(catchThesePokemon), 1 do
if getOpponentName() == catchThesePokemon[i] then
result = true
break
end
end
end
return result
end
function TableLength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
function onPathAction()
if getUsablePokemonCount() >= 1 and getPokemonHealthPercent(getTeamSize()) >= healthToRunAt and isPokemonUsable(ReturnHighestIndexUnderLevel()) then
if not onlyCatch and not IsSorted() then
sortTeamByLevelAscending()
elseif not isMounted() and hasItem("S Ninetales Mount") and not string.find(getMapName(), "Pokecenter") and not string.find(getMapName(), "Tunnel") and not string.find(getMapName(), "Stop") and not string.find(getMapName(), "Cave") and not string.find(getMapName(), "Mt") and not string.find(getMapName(), "Tower") and not string.find(getMapName(), "mansion") and not string.find(getMapName(), "Victory") then
useItem("Bicycle")
log("Getting on bike.")
elseif stops == 0 and pokecenterOnRoute then
if getMapName() == pokecenter then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
elseif stops == 0 and not pokecenterOnRoute then
if getMapName() == pokecenter then
moveToMap(city)
elseif getMapName() == city then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
elseif stops == 1 then
if getMapName() == pokecenter then
moveToMap(city)
elseif getMapName() == city then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
elseif stops == 2 then
if getMapName() == pokecenter then
moveToMap(city)
elseif getMapName() == city then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
elseif stops == 3 then
if getMapName() == pokecenter then
moveToMap(city)
elseif getMapName() == city then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
elseif stops == 4 then
if getMapName() == pokecenter then
moveToMap(city)
elseif getMapName() == city then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(stop4)
elseif getMapName() == stop4 then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
elseif stops == 5 then
if getMapName() == pokecenter then
moveToMap(city)
elseif getMapName() == city then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(stop4)
elseif getMapName() == stop4 then
moveToMap(stop5)
elseif getMapName() == stop5 then
moveToMap(endLocation)
elseif getMapName() == endLocation then
if lookForGrass then
moveToGrass()
else
moveToRectangle(rectX1, rectY1, rectX2, rectY2)
end
end
end
else
if stops == 0 and pokecenterOnRoute then
if getMapName() == endLocation then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
elseif not isMounted() and hasItem("Bicycle") and not string.find(getMapName(), "Pokecenter") and not string.find(getMapName(), "Tunnel") and not string.find(getMapName(), "Stop") and not string.find(getMapName(), "Cave") and not string.find(getMapName(), "Mt") and not string.find(getMapName(), "Tower") and not string.find(getMapName(), "mansion") and not string.find(getMapName(), "Victory") then
useItem("Bicycle")
log("Getting on bike.")
elseif stops == 0 and not pokecenterOnRoute then
if getMapName() == endLocation then
moveToMap(city)
elseif getMapName() == city then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
elseif stops == 1 then
if getMapName() == endLocation then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(city)
elseif getMapName() == city then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
elseif stops == 2 then
if getMapName() == endLocation then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(city)
elseif getMapName() == city then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
elseif stops == 3 then
if getMapName() == endLocation then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(city)
elseif getMapName() == city then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
elseif stops == 4 then
if getMapName() == endLocation then
moveToMap(stop4)
elseif getMapName() == stop4 then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(city)
elseif getMapName() == city then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
elseif stops == 5 then
if getMapName() == endLocation then
moveToMap(stop5)
elseif getMapName() == stop5 then
moveToMap(stop4)
elseif getMapName() == stop4 then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop1)
elseif getMapName() == stop1 then
moveToMap(city)
elseif getMapName() == city then
moveToMap(pokecenter)
elseif getMapName() == pokecenter then
usePokecenter()
end
end
end --condition--
end --func--
function onBattleAction()
if getActivePokemonNumber() <= getTeamSize() then
if isWildBattle() and getOpponentName() == "Glaceon" and getOpponentForm() ~= 0 or "Stantler" and getOpponentForm() ~= 0 or "Teddiursa" and getOpponentForm() ~= 0 or "Ursaring" and getOpponentForm() ~= 0 or "Eevee" and getOpponentForm() ~= 0 or "Sentret" and getOpponentForm() ~= 0 or "Furret" and getOpponentForm() ~= 0 or "Buneary" and getOpponentForm() ~= 0 or ((isOpponentShiny() and catchShineys) or (catchNotCaught and not isAlreadyCaught())) or IsPokemonOnCaptureList() then
if getPokemonHealthPercent(getTeamSize()) > healthToRunAt then
if isPokemonUsable(getActivePokemonNumber()) then
if getOpponentHealthPercent() >= percentToStartThrowing and not isOpponentShiny then
return weakAttack()
else
if useItem("Pokeball") or useItem("Pokeball") or useItem("Pokeball") then
return
else
return attack() or sendUsablePokemon() or run()
end
end
if getOpponentHealthPercent() >= percentToStartThrowingIfShiny and isOpponentShiny then
return weakAttack()
else
if useItem("Pokeball") or useItem("Pokeball") or useItem("Pokeball") then
return
else
return attack() or sendUsablePokemon() or run()
end
end
else
return sendUsablePokemon()
end
else
return run()
end
else
if getPokemonHealthPercent(getTeamSize()) < healthToRunAt or onlyCatch then
return run()
else
return attack() or sendUsablePokemon() or run()
end
end
end
end
function onLearningMove(moveName, pokemonIndex)
forgetAnyMoveExcept(movesNotToForget)
end