100% found this document useful (1 vote)
769 views2 pages

Tibia Lua Scripts for OTClientV8

The document contains Lua code that defines macros and UI elements in OTClient. It defines macros to exchange money items, send trade channel messages, and stack items. It also defines UI containers and text edits to manage money items and trade messages. Spells are defined and macros cast them on targets within range if mana and level requirements are met.

Uploaded by

D4RK L0F1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
769 views2 pages

Tibia Lua Scripts for OTClientV8

The document contains Lua code that defines macros and UI elements in OTClient. It defines macros to exchange money items, send trade channel messages, and stack items. It also defines UI containers and text edits to manage money items and trade messages. Spells are defined and macros cast them on targets within range if mana and level requirements are met.

Uploaded by

D4RK L0F1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- tools tab

setDefaultTab("Tools")

if type([Link]) ~= "table" then


[Link] = {3031, 3035}
end
macro(1000, "Exchange money", function()
if not [Link][1] then return end
for index, container in pairs(containers) do
if not [Link] then -- ignore monster containers
for i, item in ipairs(container:getItems()) do
if item:getCount() == 100 then
for m, moneyId in ipairs([Link]) do
if item:getId() == [Link] then
return g_game.use(item)
end
end
end
end
end
end
end)

local moneyContainer = [Link](function(widget, items)


[Link] = items
end, true)
moneyContainer:setHeight(35)
moneyContainer:setItems([Link])

[Link]()

macro(60000, "Send message on trade", function()


local trade = getChannelId("advertising")
if not trade then
trade = getChannelId("trade")
end
if trade and [Link]:len() > 0 then
sayChannel(trade, [Link])
end
end)
[Link]([Link] or "I'm using OTClientV8!", function(widget,
text)
[Link] = text
end)

macro(1000, "Stack items", function()


local containers = g_game.getContainers()
local toStack = {}
for index, container in pairs(containers) do
if not [Link] then -- ignore monster containers
for i, item in ipairs(container:getItems()) do
if item:isStackable() and item:getCount() < 100 then
local stackWith = toStack[item:getId()]
if stackWith then
g_game.move(item, stackWith[1], [Link](stackWith[2],
item:getCount()))
return
end
toStack[item:getId()] = {container:getSlotPosition(i - 1), 100 -
item:getCount()}
end
end
end
end
end)

local Spells = {
{name = "utevo gran res sac", cast = true, range = 10, buffSpell = false, manaCost
= 1000, level = 0},}
-- script
macro(100, "Familiar", function()
if not g_game.isAttacking() then
return
end
local target = g_game.getAttackingCreature()
local distance = getDistanceBetween(player:getPosition(), target:getPosition())
for _, spell in ipairs(Spells) do
if mana() >= [Link] and lvl() >= [Link] and distance <= [Link]
and [Link] then
if not hasPartyBuff() or not [Link] then
say([Link])
end
end
end
end)

local Spells = {
{name = "utito tempo san", cast = true, range = 10, buffSpell = false, manaCost =
1000, level = 0},}
-- script
macro(5000, "Utito San", function()
if not g_game.isAttacking() then
return
end
local target = g_game.getAttackingCreature()
local distance = getDistanceBetween(player:getPosition(), target:getPosition())
for _, spell in ipairs(Spells) do
if mana() >= [Link] and lvl() >= [Link] and distance <= [Link]
and [Link] then
if not hasPartyBuff() or not [Link] then
say([Link])
end
end
end
end)

-- tools tab
setDefaultTab("Tools")
if type(storage.moneyItems) ~= "table" then
  storage.moneyItems = {3031, 3035}
end
macro
item:getCount()}
        end
      end
    end
  end
end)
local Spells = {
{name = "utevo gran res sac", cast = true, range =

You might also like