0% found this document useful (0 votes)
268 views9 pages

HK

This document contains Lua code for configuring and running various Tibia botting macros and functions. It includes macros for auto-casting spells, following other players, tracking death counts, opening containers minimized, and reacting to player attacks by sounding alarms or flashing the client window. Storage tables are used to save settings between sessions. Icons are added to trigger macros for different vocations to use combat spells.

Uploaded by

fal.heppys
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
0% found this document useful (0 votes)
268 views9 pages

HK

This document contains Lua code for configuring and running various Tibia botting macros and functions. It includes macros for auto-casting spells, following other players, tracking death counts, opening containers minimized, and reacting to player attacks by sounding alarms or flashing the client window. Storage tables are used to save settings between sessions. Icons are added to trigger macros for different vocations to use combat spells.

Uploaded by

fal.heppys
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
You are on page 1/ 9

macro(100, "Anti Paralyze", nil, function()

if isParalyzed() and storage.autoAntiParalyzeText:len() > 0 then


saySpell(storage.autoAntiParalyzeText)
end
end)
addTextEdit("autoAntiParalyzeText", storage.autoAntiParalyzeText or "utani hur",
function(widget, text)
storage.autoAntiParalyzeText = text
end)

function changeReconnect(enable)
local rwPanel = g_ui.getRootWidget():getChildById('charactersWindow')
local buttonsPanel = rwPanel:getChildById('autoReconnect')
if rwPanel and buttonsPanel then
if buttonsPanel:isOn() ~= enable then
buttonsPanel:onClick()
end
warn('auto reconnect '..(buttonsPanel:isOn() and 'on' or 'off'))
end
end

followName = "autofollow"
if not storage[followName] then storage[followName] = { player = 'name'} end
local toFollowPos = {}

UI.Separator()
UI.Label("Auto Follow")

followTE = UI.TextEdit(storage[followName].player or "name", function(widget,


newText)
storage[followName].player = newText
end)

local followChange = macro(200, "Follow Change", function() end)

local followMacro = macro(20, "Follow", function()


local target = getCreatureByName(storage[followName].player)
if target then
local tpos = target:getPosition()
toFollowPos[tpos.z] = tpos
end
if player:isWalking() then
return
end
local p = toFollowPos[posz()]
if not p then
return
end
if autoWalk(p, 20, { ignoreNonPathable = true, precision = 1 }) then
delay(100)
end
end)

UI.Separator()
onPlayerPositionChange(function(newPos, oldPos)
if followChange:isOff() then return end
if (g_game.isFollowing()) then
tfollow = g_game.getFollowingCreature()

if tfollow then
if tfollow:getName() ~= storage[followName].player then
followTE:setText(tfollow:getName())
storage[followName].player = tfollow:getName()
end
end
end
end)

onCreaturePositionChange(function(creature, newPos, oldPos)


if creature:getName() == storage[followName].player and newPos then
toFollowPos[newPos.z] = newPos
end
end)

setDefaultTab("Tools")
local logoutDeaths = 5
if type(storage["death"]) ~= "table" then storage["death"] = { count = 0 } end
local deathCount = storage["death"].count
UI.Separator()
deathLabel = UI.Label("Death count: " .. deathCount)

if deathCount >= logoutDeaths then


CaveBot:setOff()
warn("Death Count Logout")
schedule(5000, function()
modules.game_interface.tryLogout(false)
end)
end

if deathCount >= 4 then


deathLabel:setColor("red")
elseif deathCount >= 2 then
deathLabel:setColor("orange")
else
deathLabel:setColor("green")
end

UI.Button("Reset Deaths", function()


storage["death"].count = 0
deathLabel:setText("Death count: " .. storage["death"].count)
deathLabel:setColor("green")
end )

local macroDeathCount = macro(10000, "Death Counter", function() end)

onTextMessage(function(mode, text)
if macroDeathCount.isOff() then return end
if text:lower():find("you are dead") then
storage["death"].count = storage["death"].count + 1
deathLabel:setText("Death count: " .. storage["death"].count)
modules.client_entergame.CharacterList.doLogin()
end
end)

UI.Separator()
local openMin = addSwitch("openMin", "Open Minimised", function(widget)
widget:setOn(not widget:isOn())
storage.openMin = widget:isOn()
end, parent)
openMin:setOn(storage.openMin)

onContainerOpen(function(container, previousContainer)
if openMin:isOn() then
if not previousContainer then
local containerPanel = modules.game_interface.getContainerPanel()
local containerWindow = containerPanel:getChildById('container' ..
container:getId())
if containerWindow then
if containerWindow:getId() == "container0" then
containerWindow:setContentHeight(34)
else
containerWindow:minimize()
end
end
end
end
end)

local friendName = "asd"


macro(100, "heal friend", function()
local friend = getPlayerByName(friendName)
if friend and friend:getHealthPercent() < 90 then
say("exura sio \"" .. friendName)
delay(1000)
end
end)

macro(500, "Auto Haste", nil, function()


if not hasHaste() and storage.autoHasteText:len() > 0 then
if saySpell(storage.autoHasteText) then
delay(5000)
end
end
end)
addTextEdit("autoHasteText", storage.autoHasteText or "utani gran hur",
function(widget, text)
storage.autoHasteText = text
end)

macro(5000, "[Auto] Resetar (Lv. 700k)", function()


local boost1 = findItem(6107);
if boost1 and not isInProtectionZone() then
useWith(boost1:getId(), player)
end
end)

local revidar = false


addSwitch("Revidar", "Revidar", function(widget)
revidar = not revidar
widget:setOn(revidar)
end)
onTextMessage(function(mode, text)
if revidar == true and not g_game.getAttackingCreature() and string.find(text,
"You lose") then
local targetName = string.sub(text, string.find(text, " [^ ]*$") + 1, #text -
1)
g_game.attack(getPlayerByName(targetName))
end
end)

local eRingId = 3051


local hpColoca = 80
local hpTira = 99
macro(200, "[Auto] Energy Ring 80%", function()
local dedo = getFinger()
if dedo ~= eRingId then
if findItem(eRingId) and hppercent() < hpColoca then
return g_game.move(findItem(eRingId), {x=65535, y=SlotFinger, z=0}, 1)
elseif dedo and hppercent() > hpTira then
return g_game.move(dedo, {x=65535, y=SlotBack, z=0}, 1)
end
end
end)

addIcon("CvB", {item={id=34016, count=1}, text="Cave"}, macro(100, function(m)


CaveBot.setOn()
schedule(100, function()
if m.isOff() then
CaveBot.setOff()
end
end)
end))

addIcon("TgB", {item={id=34017, count=1}, text="Target"}, macro(100, function(m)


TargetBot.setOn()
schedule(100, function()
if m.isOff() then
TargetBot.setOff()
end
end)
end))

addIcon("RP", {item={id=34017, count=1}, text="RP"}, macro(100, function(m)


if g_game.isAttacking() then
say("exevo mas san")
say("exori con")
say("utevo paladin res")
end
end))

addIcon("EK", {item={id=34017, count=1}, text="EK"}, macro(100, function(m)


if g_game.isAttacking() then
say("exori gran ico")
say("exori gran")
say("exori")
say("exori gran strike")
say("utevo knight res")
end
end))

addIcon("ED", {item={id=34017, count=1}, text="ED"}, macro(100, function(m)


if g_game.isAttacking() then
say("exevo gran mas frigo")
say("exevo tera hur")
say("utevo druid res")
end
end))

local monstrosIgnorados = {
['% emberwing'] = true,
}

local distancia2 = 7 -- distancia para atacar os monstros

addIcon("atacar", {item={id=34017, count=1}, text="ATACAR"}, macro(100, function(m)


local monstros = g_map.getSpectators(g_game.getLocalPlayer():getPosition(), false)
for k,v in pairs(monstros) do
if not isInPz() and v:isMonster() and not g_game.isAttacking()
and not monstrosIgnorados[v:getName():lower()]
and getDistanceBetween(pos(), v:getPosition()) <= distancia2 then
g_game.attack(v)
end
end
end))

local rune = 3155 -- Rune ID


local SD = macro(1000, "TacaSD", function()
local target = g_game.getAttackingCreature()
if g_game.isAttacking() then
useWith(rune, target)
end
end)

addIcon("macroIcon", {text = "SD", item = rune}, SD)

addIcon("MS", {item={id=34017, count=1}, text="MS"}, macro(100, function(m)

local player = g_game.getLocalPlayer()


if not player then
return
end

local position = player:getPosition()


local spectators = g_map.getSpectators(position, false)

local hasPlayersNearby = false


for _, creature in ipairs(spectators) do
if creature:isPlayer() then
hasPlayersNearby = true
break
end
end

if not hasPlayersNearby then


-- Não há jogadores por perto, você pode lançar a magia
print("Não há jogadores por perto, lançando magia...")
-- Coloque aqui o código para lançar a magia

--if g_game.isAttacking() then


say("exevo gran mas flam")
say("exevo vis hur")
say("utevo sorcerer res")
--end

else
-- Há jogadores por perto, não lance a magia
print("Há jogadores por perto, não lançando magia.")
end

local healingSpell = 'Exura Vita'


local hpPercent = 99
if (hppercent() <= hpPercent) then
say(healingSpell)
end

local singleTargetSpell = 'exevo vis hur'


local multiTargetSpell = 'exevo gran mas flam'
local distance = 1
local amountOfMonsters = 1

local specAmount = 0
if not g_game.isAttacking() then
return
end
for i,mob in ipairs(getSpectators()) do
if (getDistanceBetween(player:getPosition(), mob:getPosition()) <=
distance and mob:isMonster()) then
specAmount = specAmount + 1
end
end
if (specAmount >= amountOfMonsters) then
say(multiTargetSpell)
else
say(singleTargetSpell)
end

end))

-- Player Attack / PK on Screen Alarm


-- tags: alert alerts alarms sound

-- START CONFIG
local macroName = "Alarm PK"
local ignoreParty = true
local onlyIfAttacked = true -- true = alert if someone attacks you // false = alert
if any pk appear on screen
-- end of basic config
local flashClient = true
local windowText = "Player Attack"
local soundStyle = "/sounds/alarm.ogg"
-- END CONFIG
-- vBot scripting services: F.Almeida#8019
-- if you like it, consider making a donation:
-- https://www.paypal.com/donate/?
business=8XSU4KTS2V9PN&no_recurring=0&item_name=OTC+AND+OTS+SCRIPTS&currency_code=U
SD

-- ATTENTION:
-- Don't edit below this line unless you know what you're doing.
-- ATENÇÃO:
-- Não mexa em nada daqui para baixo, a não ser que saiba o que está fazendo.
-- ATENCIÓN:
-- No cambies nada desde aquí, solamente si sabes lo que estás haciendo.

macro(100,macroName,function()
for s, spec in pairs(getSpectators(false)) do
if spec ~= player and spec:isPlayer() then
if spec:isTimedSquareVisible() or (not onlyIfAttacked and spec:getSkull() >
2) then
if not ignoreParty or spec:getShield() < 3 then
if modules.game_bot.g_app.getOs() == "windows" and flashClient then
g_window.flash() end
g_window.setTitle(player:getName() .. " - "..windowText)
playSound(soundStyle)
delay(6000)
break
end
end
end
end
end)

local healthId = 6105


local healthId2 = 6090
local healthPercent = 40
macro(200, "Reliquia", function()
if (hppercent() <= healthPercent) then
use(healthId)
use(healthId2)
end
end)

--[[Esconder Magias Laranjas da tela]]--


TH = macro(100, "Esconde Mensagens Laranjas", function() end)
onStaticText(function(thing, text)
if TH.isOff() then return end
if not text:find('says:') then
g_map.cleanTexts()
end
end)

--[[Esconder MAGIAS(SPRITES)]]--
sprh = macro(100, "Escode Sprite Magias", function() end)
onAddThing(function(tile, thing)
if sprh.isOff() then return end
if thing:isEffect() then
thing:hide()
end
end)

--[[Esconder Danos]]--
oant = macro(100, "Esconder Danos", function() end)
onAnimatedText(function(thing, text)
if oant.isOff() then return end
thing:hide()
end)

onTextMessage(function(mode, text)
if mode == 18 or mode == 19 or mode == 20 then
modules.game_textmessage.clearMessages()
end
end)

onMissle(function(missle)
missle:hide()
end)

macro(100, "Cura", function()


local hpPercent = 99
local player = g_game.getLocalPlayer()

if not player then


print("Jogador não encontrado.")
return
end

if player:getHealthPercent() <= hpPercent then


say('exura san')
useWith(7642, player) -- Use a potion (substitua o ID 3155 pelo ID da
potion desejada)

say('exura ico')
useWith(7643, player) -- Use a potion

say('exura vita')
useWith(238, player) -- Use a potion
end
end)

macro(1000, "Atacar-Criaturas", function()


local distancia2 = 7 -- Distância para atacar os monstros
local creatures = g_map.getSpectators(g_game.getLocalPlayer():getPosition(),
false)
for k, v in ipairs(creatures) do
local creatureName = v:getName():lower()
if not isInPz() and v:isMonster() and not g_game.isAttacking() and not
v:isPlayer()
and getDistanceBetween(g_game.getLocalPlayer():getPosition(),
v:getPosition()) <= distancia2 then
if not (creatureName:find("emberwing") or
creatureName:find("skullfrost") or
creatureName:find("grovebeast") or
creatureName:find("thundergiant")) then
g_game.attack(v)
end
end
end
end)

local function toggleCreatureHealth()


local currentState = g_game.getFeature(GameHideCreatureHealth)
g_game.setFeature(GameHideCreatureHealth, not currentState)
if not currentState then
print("Danos das criaturas ocultados.")
else
print("Danos das criaturas exibidos.")
end
end

toggleCreatureHealth() -- Alternar estado inicial

You might also like