2018-06-14, 14:48:16
need help with this script when it goes to sinnoh victory road it stop please help
--------
--------
[7:40:07 AM] Position updated: Pokecenter League Pokemon Sinnoh (8, 15) [OK]
[7:40:12 AM] Bot started
[7:40:12 AM] Position updated: Pokemon League Sinnoh (13, 73) [OK]
[7:40:17 AM] Getting on bike.
[7:40:22 AM] Position updated: Sinnoh Victory Road 1F (16, 72) [OK]
[7:40:30 AM] No action executed: stopping the bot.
[7:40:30 AM] Bot stopped
------------------
i Dont know where i did wrong ,here is the script
-----------
-----------
--------
--------
[7:40:07 AM] Position updated: Pokecenter League Pokemon Sinnoh (8, 15) [OK]
[7:40:12 AM] Bot started
[7:40:12 AM] Position updated: Pokemon League Sinnoh (13, 73) [OK]
[7:40:17 AM] Getting on bike.
[7:40:22 AM] Position updated: Sinnoh Victory Road 1F (16, 72) [OK]
[7:40:30 AM] No action executed: stopping the bot.
[7:40:30 AM] Bot stopped
------------------
i Dont know where i did wrong ,here is the script
-----------
-----------
--supports up to 5 stops, leave unused stops blank--
city = "Pokemon League Sinnoh"
pokecenter = "Pokecenter League Pokemon Sinnoh"
stop1 = ""
stop2 = ""
stop3 = ""
stop4 = ""
stop5 = ""
endLocation = "Sinnoh Victory Road 1F"
--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 = 1
rectX2 = 13
rectY1 = 13
rectY2 = 19
--the below will be the percentage of your opponent's health we'll start throwing balls at--
--DEFAULT: 50--
percentToStartThrowing = 50
--DEFAULT: 50--
percentToStartThrowingIfShiny = 50
--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 = {"Gabite"}
--the below will be the percentage of your last alive poke's health that we'll stop fighting at--
--DEFAULT: 20--
healthToRunAt = 20
--Level to stop levelling mons, set to a value over 100 if you are just catching and have a lvl 100 team--
levelPokesTo = 100
--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 = "Zymu - 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("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 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 ((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("Ultra Ball") or useItem("Great Ball") 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("Ultra Ball") or useItem("Great Ball") 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