Hello There, Guest! Login Register


Help with getOpponentStatus
#1
function onBattleAction()
    if isWildBattle() and ( isOpponentShiny() or getOpponentName() == "Beldum" ) then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2) 
        elseif ( getActivePokemonNumber() == 2 ) and ( getOpponentStatus() ~= "PARALYZE" ) then
            return useMove("Thunder Wave") or useItem("Pokeball") or useItem("Great Ball") or useItem("Pokeball") or sendPokemon(3)
        elseif getOpponentStatus() == "PARALYZE" then        
            return useItem("Pokeball") or useItem("Great Ball") or useItem("Pokeball") or sendAnyPokemon()
        
        end
    end
if getOpponentName() == "Wobbuffet" then
        return attack() or  sendAnyPokemon() or run()
    end
    if getActivePokemonNumber() >= 1 then
        return run() or attack()
    end
end


The problem here is that the bot doesn't detect if the oppenent is paralyzed , it keeps using thunder wave until it faints

I tried to change "PARALYZE" with "PARALYZED" but still no good
 
Reply
#2
If I'm not mistaken, in this game it's PARALIZE. Could be wrong though
 
Reply
#3
Try this on for size, not the best fix, but it should work.
function onBattleAction()
    if isWildBattle() and ( isOpponentShiny() or getOpponentName() == "Beldum" ) then
        if getActivePokemonNumber() == 1 then
            return sendPokemon(2)
        elseif ( getActivePokemonNumber() == 2 ) and ( getOpponentStatus() == "None" ) then
            return useMove("Thunder Wave") or useItem("Pokeball") or useItem("Great Ball") or useItem("Pokeball") or sendPokemon(3)
        elseif getOpponentStatus() ~= "None" then        
            return useItem("Pokeball") or useItem("Great Ball") or useItem("Pokeball") or sendAnyPokemon()
        
        end
    end
if getOpponentName() == "Wobbuffet" then
        return attack() or  sendAnyPokemon() or run()
    end
    if getActivePokemonNumber() >= 1 then
        return run() or attack()
    end
end
 
Reply
#4
(2017-08-31, 20:20:33)DubsCheckum Try this on for size, not the best fix, but it should work.
function onBattleAction()
   if isWildBattle() and ( isOpponentShiny() or getOpponentName() == "Beldum" ) then
       if getActivePokemonNumber() == 1 then
           return sendPokemon(2)
       elseif ( getActivePokemonNumber() == 2 ) and ( getOpponentStatus() == "None" ) then
           return useMove("Thunder Wave") or useItem("Pokeball") or useItem("Great Ball") or useItem("Pokeball") or sendPokemon(3)
       elseif getOpponentStatus() ~= "None" then        
           return useItem("Pokeball") or useItem("Great Ball") or useItem("Pokeball") or sendAnyPokemon()
       
       end
   end
if getOpponentName() == "Wobbuffet" then
       return attack() or  sendAnyPokemon() or run()
   end
   if getActivePokemonNumber() >= 1 then
       return run() or attack()
   end
end
Dude nice idea seriously pretty sure it'll work
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)