Hello There, Guest! Login Register


can someone can help me to change this json scripts to lua. scripts
#1
i am a noob on writing scripts so i need someone to help me my dragon den scripts is level up all my pokemon in my team until the last pokemon in dragon den but i dont know how can i do to change it lua. form

There is my scripts

{
"name": "Leveling: Victory Road new",
"author": "93simon)",
"path": [
{
"condition": ["usablePokemons", ">", 1],
"actions": [
{
"condition": ["map", "Pokecenter Blackthorn"],
"action": ["moveToMap", "Blackthorn City"]
},
{
"condition": ["map", "Blackthorn City"],
"action": ["moveToMap", "Dragons Den Entrance"]
},
{
"condition": ["map", "Dragons Den Entrance"],
"action": ["moveToMap", "Dragons Den"]
},
{
"condition": ["map", "Dragons Den"],
"action": ["moveNearExit", "Dragons Den Entrance"]
}
]
},
{
"actions": [
{
"condition": ["map", "Dragons Den"],
"action": ["moveToMap", "Dragons Den Entrance"]
},
{
"condition": ["map", "Dragons Den Entrance"],
"action": ["moveToMap", "Blackthorn City"]
},
{
"condition": ["map", "Blackthorn City"],
"action": ["moveToMap", "Pokecenter Blackthorn"]
},
{
"condition": ["map", "Pokecenter Blackthorn"],
"action": ["usePokecenter"]
}
]
}
],
"battle": [
{
"condition": ["isOpponentShiny"],
"action": ["useItem", "Ultra Ball", "Great Ball", "Pokeball"]
},

{
"condition": ["usablePokemons", ">", 1],
"actions": [
{
"condition": ["activeHealth", ">", 0],
"action": ["attack"]
},
{
"action": ["sendNextPokemon"]
}
]
},
{
"condition": ["usablePokemons", "=", 1],
"actions": [
{
"condition": ["activeHealth%", ">", 50],
"action": ["attack"]
},
{
"action": ["run"]
}
]
}
]
}


pls help me/__\ thank you nice huys
 
Reply
#2
I guess it's the wrong forum.
some examples to help you with your script.



--Für  "path": [...]
function onPathAction()
        if isPokemonUsable(1) and isPokemonUsable(2) and isPokemonUsable(3) and isPokemonUsable(4) and isPokemonUsable(5) and isPokemonUsable(6) then
                
                        if getMapName() == "Pokecenter Veridian" then
                        moveToMap("Veridian City")
                    elseif getMapName() == "Veridian City" then
                        moveToMap("Route 22")
                    elseif getMapName() == "Route 22" then
                        moveToGrass()


                              --elseif getmapname ... bla bla bla
                          end
else

                    if getMapName() == "Route 22" then
            moveToMap("Veridian City")
        elseif getMapName() == "Veridian City" then
            moveToMap("Pokecenter Veridian")
        elseif getMapName() == "Pokecenter Veridian" then
            usePokecenter()
                --elseif bla bla bla
              end
end

function onBattleAction()
  if (isWildBattle()) then
   if (getActivePokemonNumber() == 1) then
   return attack() or run()
  elseif (blablabla) then
   return blablabla
  end
end
 
Reply
#3
thank you so much
 
Reply
#4
1UP I guess it's the wrong forum.
some examples to help you with your script.



--Für  "path": [...]
function onPathAction()
        if isPokemonUsable(1) and isPokemonUsable(2) and isPokemonUsable(3) and isPokemonUsable(4) and isPokemonUsable(5) and isPokemonUsable(6) then
                
                        if getMapName() == "Pokecenter Veridian" then
                        moveToMap("Veridian City")
                    elseif getMapName() == "Veridian City" then
                        moveToMap("Route 22")
                    elseif getMapName() == "Route 22" then
                        moveToGrass()


                              --elseif getmapname ... bla bla bla
                          end
else

                    if getMapName() == "Route 22" then
            moveToMap("Veridian City")
        elseif getMapName() == "Veridian City" then
            moveToMap("Pokecenter Veridian")
        elseif getMapName() == "Pokecenter Veridian" then
            usePokecenter()
                --elseif bla bla bla
              end
end

function onBattleAction()
  if (isWildBattle()) then
   if (getActivePokemonNumber() == 1) then
   return attack() or run()
  elseif (blablabla) then
   return blablabla
  end
end

Btw I have not try it is it work but getactivepokemon number should be change??? since i have try the different it cannot change pokemon and still battle
 
Reply
#5
this should help you


--Für  "path": [...]
function onPathAction()
        if (getUsablePokemonCount() == 1 and getPokemonHealthPercent(6) > 50) then
                
                        if getMapName() == "Pokecenter Blackthorn" then
                        moveToMap("Blackthornn City")
                    elseif getMapName() == "Blackthorn City" then
                        moveToMap("Dragons Den Entrance")
                    elseif getMapName() == "Dragons Den Entrance" then
                        moveToMap("Dragons Den Entrance")
                                        elseif getMapName() == "Dragons Den" then
                        moveToWater()
                          end
else

                    if getMapName() == "Dragons Den" then
            moveToMap("Dragons Den Entrance")
                  elseif getMapName() == "Dragons Den Entrance" then
            moveToMap("Blackthorn City")
                        
                        elseif getMapName() == "Blackthorn City" then
            moveToMap("Pokecenter Blackthorn")
        elseif getMapName() == "Pokecenter Blackthorn" then
            usePokecenter()
                
              end
end

function onBattleAction()
  if isWildBattle() and ( isOpponentShiny() or (not isAlreadyCaught()) or (getOpponentName() == "Dragonair" )) then
        if useItem("Great Ball") or useItem("Pokeball") then
            return
        end
    end
  if (getUsablePokemonCount() == 1 and getPokemonHealthPercent(6) > 50 then
  return attack() or sendUsablePokemon() or run() or sendAnyPokemon()
    else
        return run()
    end
end
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)