Jump to content

hello67

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by hello67

  1. Please make macro script

    macro(2500, "destroy boxes chairs", function()

    and

    macro(2500, "scythe wheat", function() >it should be similar because use with function

     


    i have some code from riftbot(?) but rly dont know how to edit it for otcv8 (760) server

     

    Quote

    local FURNITURE_IDS = {2976, 2472, 2524, 2319, 2358} -- list of items to destroy
    local MACHETE_ID = 3305 -- id of weapon or machete to destroy.

    -- DON'T EDIT BELOW

    Module.New("Destroy Furniture", function (mod)

        if Self.isConnected() then
            local pos = Self.Position()
            for x = -1, 1 do
                for y = -1, 1 do
                    local item = Map.GetTopMoveItem(pos.x+x, pos.y+y, pos.z)
                    if table.find(FURNITURE_IDS, item.id) then
                        -- destroy item
                        Self.UseItemWithGround(MACHETE_ID, pos.x+x, pos.y+y, pos.z, math.random(1000, 1500))

                        break
                    end
                end    
            end
        end        
    end)

     

    or

     

    tried...

     

    Quote

    local FURNITURE_IDS = {2976, 2472, 2524, 2319, 2358}
    local MACHETE_ID = 3305

    macro(2500, "Destroy Furniture",  function()
        if g_game.isOnline() then
            local pos = g_game.getLocalPlayer():getPosition()
          for _,tile in pairs(g_map.getTiles(posz())) do
            local tilePosition = tile:getPosition()
            local found = false
            if tilePosition.x == pos.x + 1 and tilePosition.y < pos.y + 1 and tilePosition.y > pos.y - 1  then
              -- right 3 cells
              found = true
            end
            if tilePosition.x == pos.x - 1 and tilePosition.y < pos.y + 1 and tilePosition.y > pos.y - 1  then
              -- left 3 cells
              found = true
            end
            if tilePosition.x == pos.x and (tilePosition.y < pos.y + 1 or tilePosition.y > pos.y - 1)  then
              -- upper and below
              found = true
            end
            if found then
              local topItem = tile:getTopThing()
              if table.find(FURNITURE_IDS, topItem.id) then
                g_game.useInventoryItemWith(MACHETE_ID, topItem)
              end
            end
          end
        end        
    end)

     

     

×
×
  • Create New...