Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pick Spear Suport
#1
Lightbulb 
Save community!
I would like some help with this script here, very simple and fast.
Action: He picks up all spears from the ground and throws any one at the open window.

I need 2 new actions on it.
1# I need it to focus only on the desired window, ie the correct bag, ex: "red backpack".

2# I need that before he pulls the spear, he throws any kind of garbage in the character's foot sqm, as if it were the pull trash nerby script.


I would like these 2 actions to be in just 1 script, in this first one below. (Pick Pick Spear)
I am use client 7.4 Tibia.



Script Pick Spear:
Code:
local c = {
pickUp = {3277}, -- Item list to pickup, separated by a comma.
CheckPOS = 1 -- The SQM from your character to check if theres an item.
}
macro(20, "Spear Picker", "", function()
for x = -c.CheckPOS, c.CheckPOS do
for y = -c.CheckPOS, c.CheckPOS do
local tile = g_map.getTile({x = posx() + x, y = posy() + y, z = posz()})
if tile then
local things = tile:getThings()
for _, item in pairs(things) do
if table.find(c.pickUp, item:getId()) then
local containers = getContainers()
for _, container in pairs(containers) do
g_game.move(item, container:getSlotPosition(container:getItemsCount()), item:getCount())
end
end
end
end
end
end
end)

Script Pick Spear to Backpack
Code:
macro(100, "Search for Item", function()
  local z = posz()
  for _, tile in ipairs(g_map.getTiles(z)) do
    if z ~= posz() then return end
    if getDistanceBetween(pos(), tile:getPosition()) <= 7 then
      if tile:getTopLookThing():getId() == 3035 then
        for _, container in pairs(g_game.getContainers()) do
          if container:getName() == 'red backpack' then
            if container:getCapacity() == container:getSize() then
              for _, lootContainer in pairs(container:getItems()) do
                if lootContainer:isContainer() then
                  g_game.open(lootContainer, container)
                end
              end
            end
          end
          g_game.move(tile:getTopLookThing(), container:getSlotPosition(container:getItemsCount()), tile:getTopLookThing():getCount())
        end
      end
    end
  end
end)

Trash pull items script:
Code:
  macro(100, "Pull Nearby Items", function()
    local trashitem = nil
    for _, tile in pairs(g_map.getTiles(posz())) do
        if distanceFromPlayer(tile:getPosition()) == 1 and #tile:getItems() ~= 0 and not tile:getTopUseThing():isNotMoveable() then
            trashitem = tile:getTopUseThing()
            g_game.move(trashitem, pos(), trashitem:getCount())
            return
        end
    end
  end)
end
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)