Jump to content

Rise

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Rise

  1. 1 hour ago, zakne11 said:

     

    Not ideal as you ask, but made for my needs.

     

    
    if not g_game.isOnline() then return end
    
    local function wave5x3()
     
    local MonstersInRangeN = 0
    local MonstersInRangeE = 0
    local MonstersInRangeS = 0
    local MonstersInRangeW = 0
    local MonstersInActualRange = 0
    local direction = g_game.getLocalPlayer():getDirection()
     
    for _, creature in pairs(g_game.getCreatures()) do
      local playerPos = g_game.getLocalPlayer():getPosition()
      local creaturePos = creature:getPosition()
      local offsetX = playerPos.x - creaturePos.x
      local offsetY = playerPos.y - creaturePos.y
        if creature == nil then creature = playerPos end
          -- West 
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetX >= 1 and offsetX <= 5 and offsetY <= 1 and offsetY >= -1 then
          MonstersInRangeW = MonstersInRangeW + 1
        end
    			-- East
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetX >= -5 and offsetX <= -1 and offsetY <= 1 and offsetY >= -1 then			
    			MonstersInRangeE = MonstersInRangeE + 1
        end
    			-- North
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetY >= 1 and offsetY <= 5  and offsetX <= 1 and offsetX >= -1 then 		
    			MonstersInRangeN = MonstersInRangeN + 1
        end
          -- Sauth
        if creature:isMonster() and creaturePos:isInRange(playerPos, 5, 5) and offsetY >= -5 and offsetY <= -1 and offsetX <= 1 and offsetX >= -1 then 		
    			MonstersInRangeS = MonstersInRangeS + 1
        end 	
     
    end
    
    local highest = 0
    local nums = {MonstersInRangeN, MonstersInRangeE, MonstersInRangeS, MonstersInRangeW}
    local bestdirection = direction
    
    for i,v in pairs(nums)do
    	if v > highest then
    	  highest = v
    	end
    end
    
    if highest == MonstersInRangeN and MonstersInRangeN > MonstersInRangeE and MonstersInRangeN > MonstersInRangeS and MonstersInRangeN > MonstersInRangeW then
    	bestdirection = 0
    end
    if highest == MonstersInRangeE and MonstersInRangeE > MonstersInRangeN and MonstersInRangeE > MonstersInRangeS and MonstersInRangeE > MonstersInRangeW then
    	bestdirection = 1
    end
    if highest == MonstersInRangeS and MonstersInRangeS > MonstersInRangeE and MonstersInRangeS > MonstersInRangeN and MonstersInRangeS > MonstersInRangeW then
    	bestdirection = 2
    end
    if highest == MonstersInRangeW and MonstersInRangeW > MonstersInRangeE and MonstersInRangeW > MonstersInRangeS and MonstersInRangeW > MonstersInRangeN then
    	bestdirection = 3
    end
    
    if direction == 0 then MonstersInActualRange = MonstersInRangeN end
    if direction == 1 then MonstersInActualRange = MonstersInRangeE end
    if direction == 2 then MonstersInActualRange = MonstersInRangeS end
    if direction == 3 then MonstersInActualRange = MonstersInRangeW end
    
    return MonstersInRangeN,MonstersInRangeE,MonstersInRangeS,MonstersInRangeW,MonstersInActualRange,bestdirection
    
    end	
    
    
    
    
    local MonstersInRangeN, MonstersInRangeE, MonstersInRangeS, MonstersInRangeW, MonstersInActualRange, bestdirection = wave5x3()
    local player = g_game.getLocalPlayer()
    local checkRange = 5
    local monsterinrange = 3
    local monsterinrangestand = 1
    local monsteraround2 = #g_game.getMonstersAround(2)
    local monsteraround1 = #g_game.getMonstersAround(1)
    local manapercent = g_game.getLocalPlayer():getManaPercent()
    
    if a == nil then a = 0 end
    
    
    if a ~= nil and a > 3 and monsteraround1 >= MonstersInActualRange and monsteraround1 >= 1 and g_game.isAttacking() and g_game.getIdleTime() > 300 then
          g_game.turn(g_game.getBestTurnDirection())
          a = 0
    end
    
    
    
    
    if g_game.isAttacking() then
      if manapercent >= 20 and monsteraround2 >= monsterinrange then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and monsteraround2 >= monsterinrange*2 then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and MonstersInActualRange >= 2 then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and MonstersInActualRange >= monsterinrange then
        g_game.sendKey("Fx")
      end
      if manapercent >= 20 and MonstersInActualRange >= monsterinrange then
        g_game.sendKey("Fx")
      end
    end
    
    
    
    
    if a ~= nil then
    a=a+1
    end
    
    auto(250)

     

    Could you explain me this script? Don't understand last lines when i put hotkeys for that much spells?

  2. Better Turn to target.

     

    And im lookin for one more script for attack spells only if there are monsters within 3 sqms

    And script that attack with wave spell this side where is more monster in 8 sqms i mean like west are 3 monsters and east are coming 8, so it should turn to east and wave

  3. Any script for turning targeting ON if i get stuck by mobs? I'm using lure script with "true" on ignoring monsters when luring because of that if i do not that the bot will stops on 1 monsters even if i have chosen like 5 or 8 in targeting?

×
×
  • Create New...