macro(9500, "Combo XP", function()
if not g_game.isOnline() then return end
local comboItems = {
6547, -- Potion 2x
6548, -- Potion 3x
6549, -- Potion 4x
6551, -- Potion 5x
6541, -- Egg 6x
6542, -- Egg 7x
6543, -- Egg 8x
6544, -- Egg 9x
6545 -- Egg 10x
}
local delay = 350
local function useItemById(id)
local item = findItem(id)
if item then
g_game.use(item)
return true
end
return false
end
for i, id in ipairs(comboItems) do
schedule(i * delay, function()
if g_game.isOnline() then
useItemById(id)
end
end)
end
-- stamina no final
schedule(#comboItems * delay + 1000, function()
if g_game.isOnline() then
useItemById(9087)
end
end)
end)
⚡ Cortar GRAV (Machete)
local config = {
machete = 3308,
WGWallId = 2130
}
function getNearTiles(pos)
if type(pos) ~= "table" then pos = pos:getPosition() end
local tiles = {}
local dirs = {
{-1, 1}, {0, 1}, {1, 1}, {-1, 0}, {1, 0}, {-1, -1}, {0, -1}, {1, -1}
}
for i = 1, #dirs do
local tile = g_map.getTile({
x = pos.x - dirs[i][1],
y = pos.y - dirs[i][2],
z = pos.z
})
if tile then table.insert(tiles, tile) end
end
return tiles
end
addIcon("TramontinaIcon", {item={id=config.machete, count=1}, text="Machete"}, macro(200, function()
for _, t in ipairs(getNearTiles(pos())) do
local topT = t:getTopThing()
if topT and topT:getId() == config.WGWallId then
return useWith(config.machete, topT)
end
end
end))
⚡ Cura Sio Guild / Party
local hpAmigos = 70
local magiacura = 'Exura Sio "'
macro(400, "Curar Party e Guild",function()
local jogadorlocal = g_game.getLocalPlayer()
if jogadorlocal:getHealth()/jogadorlocal:getMaxHealth() > 0.5 then
for i,vida in pairs(g_map.getSpectators(jogadorlocal:getPosition())) do
if vida:getId() ~= jogadorlocal:getId()
and vida:getHealthPercent() <= hpAmigos
and (vida:getShield() == 3 or vida:getEmblem() == 1) then
say(magiacura .. vida:getName())
end
end
end
end)
⚡ Esconder Sprite
sprh = macro(500, "esconder sprite", function() end)
onAddThing(function(tile, thing)
if sprh.isOff() then return end
if thing:isEffect() then
thing:hide()
end
end)
⚡ Esconder Msg Laranja
TH = macro(500, "esconder msg laranja", function() end)
onStaticText(function(thing, text)
if TH.isOff() then return end
if not text:find('says:') then
g_map.cleanTexts()
end
end)
⚡ Follow Player (Sistema Completo)
setDefaultTab("MAIN")
local batTab = addTab("MAIN")
addSeparator("sep", batTab)
Panels.AttackSpell(batTab)
addSeparator("sep", batTab)
Panels.AttackItem(batTab)
addSeparator("sep", batTab)
Panels.AttackLeaderTarget(MainTab)
addSeparator("sep", MainTab)
setDefaultTab("MAIN")
FollowPlayer = {
targetId = nil,
obstaclesQueue = {},
obstacleWalkTime = 0,
currentTargetId = nil,
keyToClearTarget = 'Escape',
walkDirTable = {
[0] = {'y', -1},
[1] = {'x', 1},
[2] = {'y', 1},
[3] = {'x', -1},
},
flags = {
ignoreNonPathable = true,
precision = 0,
ignoreCreatures = true
},
jumpSpell = {
up = 'exani hur "up',
down = 'exani hur "down'
},
defaultItem = 1111,
defaultSpell = 'jump',
customIds = {
{
id = 1948,
castSpell = false
},
{
id = 595,
castSpell = false
},
{
id = 1067,
castSpell = false
},
{
id = 1080,
castSpell = false
},
{
id = 386,
castSpell = true
},
}
};
FollowPlayer.distanceFromPlayer = function(position)
local distx = math.abs(posx() - position.x);
local disty = math.abs(posy() - position.y);
return math.sqrt(distx * distx + disty * disty);
end
FollowPlayer.walkToPathDir = function(path)
if (path) then
g_game.walk(path[1], false);
end
end
FollowPlayer.getDirection = function(playerPos, direction)
local walkDir = FollowPlayer.walkDirTable[direction];
if (walkDir) then
playerPos[walkDir[1]] = playerPos[walkDir[1]] + walkDir[2];
end
return playerPos;
end
FollowPlayer.checkItemOnTile = function(tile, table)
if (not tile) then return nil end;
for _, item in ipairs(tile:getItems()) do
local itemId = item:getId();
for _, itemSelected in ipairs(table) do
if (itemId == itemSelected.id) then
return itemSelected;
end
end
end
return nil;
end
FollowPlayer.shiftFromQueue = function()
g_game.cancelFollow();
table.remove(FollowPlayer.obstaclesQueue, 1);
end
FollowPlayer.checkIfWentToCustomId = function(creature, newPos, oldPos, scheduleTime)
local tile = g_map.getTile(oldPos);
local customId = FollowPlayer.checkItemOnTile(tile, FollowPlayer.customIds);
if (not customId) then return; end
if (not scheduleTime) then
scheduleTime = 0;
end
schedule(scheduleTime, function()
if (oldPos.z == posz() or #FollowPlayer.obstaclesQueue > 0) then
table.insert(FollowPlayer.obstaclesQueue, {
oldPos = oldPos,
newPos = newPos,
tilePos = oldPos,
customId = customId,
tile = g_map.getTile(oldPos),
isCustom = true
});
g_game.cancelFollow();
end
end);
end
FollowPlayer.checkIfWentToStair = function(creature, newPos, oldPos, scheduleTime)
if (g_map.getMinimapColor(oldPos) ~= 210) then return; end
local tile = g_map.getTile(oldPos);
if (tile:isPathable()) then return; end
if (not scheduleTime) then
scheduleTime = 0;
end
schedule(scheduleTime, function()
if (oldPos.z == posz() or #FollowPlayer.obstaclesQueue > 0) then
table.insert(FollowPlayer.obstaclesQueue, {
oldPos = oldPos,
newPos = newPos,
tilePos = oldPos,
tile = tile,
isStair = true
});
g_game.cancelFollow();
end
end);
end
FollowPlayer.checkIfWentToDoor = function(creature, newPos, oldPos)
if (FollowPlayer.obstaclesQueue[1] and FollowPlayer.distanceFromPlayer(newPos) < FollowPlayer.distanceFromPlayer(oldPos)) then return; end
if (math.abs(newPos.x - oldPos.x) == 2 or math.abs(newPos.y - oldPos.y) == 2) then
local doorPos = {
z = oldPos.z
}
local directionX = oldPos.x - newPos.x
local directionY = oldPos.y - newPos.y
if math.abs(directionX) > math.abs(directionY) then
if directionX > 0 then
doorPos.x = newPos.x + 1
doorPos.y = newPos.y
else
doorPos.x = newPos.x - 1
doorPos.y = newPos.y
end
else
if directionY > 0 then
doorPos.x = newPos.x
doorPos.y = newPos.y + 1
else
doorPos.x = newPos.x
doorPos.y = newPos.y - 1
end
end
local doorTile = g_map.getTile(doorPos);
if (not doorTile:isPathable() or doorTile:isWalkable()) then return; end
table.insert(FollowPlayer.obstaclesQueue, {
newPos = newPos,
tilePos = doorPos,
tile = doorTile,
isDoor = true,
});
g_game.cancelFollow();
end
end
FollowPlayer.checkifWentToJumpPos = function(creature, newPos, oldPos)
local pos1 = { x = oldPos.x - 1, y = oldPos.y - 1 };
local pos2 = { x = oldPos.x + 1, y = oldPos.y + 1 };
local hasStair = nil
for x = pos1.x, pos2.x do
for y = pos1.y, pos2.y do
local tilePos = { x = x, y = y, z = oldPos.z };
if (g_map.getMinimapColor(tilePos) == 210) then
hasStair = true;
goto continue;
end
end
end
::continue::
if (hasStair) then return; end
local spell = newPos.z > oldPos.z and FollowPlayer.jumpSpell.down or FollowPlayer.jumpSpell.up;
local dir = creature:getDirection();
if (newPos.z > oldPos.z) then
spell = FollowPlayer.jumpSpell.down;
end
table.insert(FollowPlayer.obstaclesQueue, {
oldPos = oldPos,
oldTile = g_map.getTile(oldPos),
spell = spell,
dir = dir,
isJump = true,
});
g_game.cancelFollow();
end
onCreaturePositionChange(function(creature, newPos, oldPos)
if (FollowPlayer.mainMacro.isOff()) then return; end
if creature:getId() == FollowPlayer.currentTargetId and newPos and oldPos and oldPos.z == newPos.z then
FollowPlayer.checkIfWentToDoor(creature, newPos, oldPos);
end
end);
onCreaturePositionChange(function(creature, newPos, oldPos)
if (FollowPlayer.mainMacro.isOff()) then return; end
if creature:getId() == FollowPlayer.currentTargetId and newPos and oldPos and oldPos.z == posz() and oldPos.z ~= newPos.z then
FollowPlayer.checkifWentToJumpPos(creature, newPos, oldPos);
end
end);
onCreaturePositionChange(function(creature, newPos, oldPos)
if (FollowPlayer.mainMacro.isOff()) then return; end
if creature:getId() == FollowPlayer.currentTargetId and oldPos and g_map.getMinimapColor(oldPos) == 210 then
local scheduleTime = oldPos.z == posz() and 0 or 250;
FollowPlayer.checkIfWentToStair(creature, newPos, oldPos, scheduleTime);
end
end);
onCreaturePositionChange(function(creature, newPos, oldPos)
if (FollowPlayer.mainMacro.isOff()) then return; end
if creature:getId() == FollowPlayer.currentTargetId and oldPos and oldPos.z == posz() and (not newPos or oldPos.z ~= newPos.z) then
FollowPlayer.checkIfWentToCustomId(creature, newPos, oldPos);
end
end);
macro(1, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
if (FollowPlayer.obstaclesQueue[1] and ((not FollowPlayer.obstaclesQueue[1].isJump and FollowPlayer.obstaclesQueue[1].tilePos.z ~= posz()) or (FollowPlayer.obstaclesQueue[1].isJump and FollowPlayer.obstaclesQueue[1].oldPos.z ~= posz()))) then
table.remove(FollowPlayer.obstaclesQueue, 1);
end
end);
macro(100, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
if (FollowPlayer.obstaclesQueue[1] and FollowPlayer.obstaclesQueue[1].isStair) then
local start = now
local playerPos = pos();
local walkingTile = FollowPlayer.obstaclesQueue[1].tile;
local walkingTilePos = FollowPlayer.obstaclesQueue[1].tilePos;
if (FollowPlayer.distanceFromPlayer(walkingTilePos) < 2) then
if (FollowPlayer.obstacleWalkTime < now) then
local nextFloor = g_map.getTile(walkingTilePos); -- workaround para caso o TILE descarregue, conseguir pegar os atributos ainda assim.
if (nextFloor:isPathable()) then
FollowPlayer.obstacleWalkTime = now + 250;
use(nextFloor:getTopUseThing());
else
FollowPlayer.obstacleWalkTime = now + 250;
FollowPlayer.walkToPathDir(findPath(playerPos, walkingTilePos, 1, { ignoreCreatures = false, precision = 0, ignoreNonPathable = true }));
end
FollowPlayer.shiftFromQueue();
return
end
end
local path = findPath(playerPos, walkingTilePos, 50, { ignoreNonPathable = true, precision = 0, ignoreCreatures = false });
if (path == nil or #path <= 1) then
if (path == nil) then
use(walkingTile:getTopUseThing());
end
return
end
local tileToUse = playerPos;
for i, value in ipairs(path) do
if (i > 5) then break; end
tileToUse = FollowPlayer.getDirection(tileToUse, value);
end
tileToUse = g_map.getTile(tileToUse);
if (tileToUse) then
use(tileToUse:getTopUseThing());
end
end
end);
macro(1, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
if (FollowPlayer.obstaclesQueue[1] and FollowPlayer.obstaclesQueue[1].isDoor) then
local playerPos = pos();
local walkingTile = FollowPlayer.obstaclesQueue[1].tile;
local walkingTilePos = FollowPlayer.obstaclesQueue[1].tilePos;
if (table.compare(playerPos, FollowPlayer.obstaclesQueue[1].newPos)) then
FollowPlayer.obstacleWalkTime = 0;
FollowPlayer.shiftFromQueue();
end
local path = findPath(playerPos, walkingTilePos, 50, { ignoreNonPathable = true, precision = 0, ignoreCreatures = false });
if (path == nil or #path <= 1) then
if (path == nil) then
if (FollowPlayer.obstacleWalkTime < now) then
g_game.use(walkingTile:getTopThing());
FollowPlayer.obstacleWalkTime = now + 500;
end
end
return
end
end
end);
macro(100, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
if (FollowPlayer.obstaclesQueue[1] and FollowPlayer.obstaclesQueue[1].isJump) then
local playerPos = pos();
local walkingTilePos = FollowPlayer.obstaclesQueue[1].oldPos;
local distance = FollowPlayer.distanceFromPlayer(walkingTilePos);
if (playerPos.z ~= walkingTilePos.z) then
FollowPlayer.shiftFromQueue();
return;
end
local path = findPath(playerPos, walkingTilePos, 50, { ignoreNonPathable = true, precision = 0, ignoreCreatures = false });
if (distance == 0) then
g_game.turn(FollowPlayer.obstaclesQueue[1].dir);
schedule(50, function()
if (FollowPlayer.obstaclesQueue[1]) then
say(FollowPlayer.obstaclesQueue[1].spell);
end
end)
return;
elseif (distance < 2) then
local nextFloor = g_map.getTile(walkingTilePos); -- workaround para caso o TILE descarregue, conseguir pegar os atributos ainda assim.
if (FollowPlayer.obstacleWalkTime < now) then
FollowPlayer.walkToPathDir(findPath(playerPos, walkingTilePos, 1, { ignoreCreatures = false, precision = 0, ignoreNonPathable = true }));
FollowPlayer.obstacleWalkTime = now + 500;
end
return
elseif (distance >= 2 and distance < 5 and path) then
use(FollowPlayer.obstaclesQueue[1].oldTile:getTopUseThing());
elseif (path) then
local tileToUse = playerPos;
for i, value in ipairs(path) do
if (i > 5) then break; end
tileToUse = FollowPlayer.getDirection(tileToUse, value);
end
tileToUse = g_map.getTile(tileToUse);
if (tileToUse) then
use(tileToUse:getTopUseThing());
end
end
end
end);
macro(100, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
if (FollowPlayer.obstaclesQueue[1] and FollowPlayer.obstaclesQueue[1].isCustom) then
local playerPos = pos();
local walkingTile = FollowPlayer.obstaclesQueue[1].tile;
local walkingTilePos = FollowPlayer.obstaclesQueue[1].tilePos;
local distance = FollowPlayer.distanceFromPlayer(walkingTilePos);
if (playerPos.z ~= walkingTilePos.z) then
FollowPlayer.shiftFromQueue();
return;
end
if (distance == 0) then
if (FollowPlayer.obstaclesQueue[1].customId.castSpell) then
say(FollowPlayer.defaultSpell);
return;
end
elseif (distance < 2) then
local item = findItem(FollowPlayer.defaultItem)
if (FollowPlayer.obstaclesQueue[1].customId.castSpell or not item) then
local nextFloor = g_map.getTile(walkingTilePos); -- workaround para caso o TILE descarregue, conseguir pegar os atributos ainda assim.
if (FollowPlayer.obstacleWalkTime < now) then
FollowPlayer.walkToPathDir(findPath(playerPos, walkingTilePos, 1, { ignoreCreatures = false, precision = 0, ignoreNonPathable = true }));
FollowPlayer.obstacleWalkTime = now + 500;
end
elseif (item) then
g_game.useWith(item, walkingTile);
FollowPlayer.shiftFromQueue();
end
return
end
local path = findPath(playerPos, walkingTilePos, 50, { ignoreNonPathable = true, precision = 0, ignoreCreatures = false });
if (path == nil or #path <= 1) then
if (path == nil) then
use(walkingTile:getTopUseThing());
end
return
end
local tileToUse = playerPos;
for i, value in ipairs(path) do
if (i > 5) then break; end
tileToUse = FollowPlayer.getDirection(tileToUse, value);
end
tileToUse = g_map.getTile(tileToUse);
if (tileToUse) then
use(tileToUse:getTopUseThing());
end
end
end);
addTextEdit("FollowPlayer", storage.FollowPlayerName or "Nome do player", function(widget, text)
storage.FollowPlayerName = text;
end);
FollowPlayer.mainMacro = macro(200, 'Follow Player', function()
local followingPlayer = g_game.getFollowingCreature();
local playerToFollow = getCreatureByName(storage.FollowPlayerName);
if (not playerToFollow) then return; end
if (not findPath(pos(), playerToFollow:getPosition(), 50, { ignoreNonPathable = true, precision = 0, ignoreCreatures = true })) then
if (followingPlayer and followingPlayer:getId() == playerToFollow:getId()) then
delay(1500);
return g_game.cancelFollow();
end
elseif (not followingPlayer and playerToFollow) then
g_game.follow(playerToFollow);
end
end);
macro(50, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
local playerToFollow = getCreatureByName(storage.FollowPlayerName);
if (playerToFollow and FollowPlayer.currentTargetId ~= playerToFollow:getId()) then
FollowPlayer.currentTargetId = playerToFollow:getId();
end
end);
macro(1000, function()
if (FollowPlayer.mainMacro.isOff()) then return; end
local target = g_game.getFollowingCreature();
if (target) then
local targetPos = target:getPosition();
if (not targetPos or targetPos.z ~= posz()) then
g_game.cancelFollow();
end
end
end);
⚡ Target Todos Monstros
macro(1, "Target MOBS", function()
local battlelist = getSpectators()
local closest = 12
local lowesthpc = 101
for key, val in pairs(battlelist) do
if val:isMonster() then
if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest then
closest = getDistanceBetween(player:getPosition(), val:getPosition())
if val:getHealthPercent() < lowesthpc then
lowesthpc = val:getHealthPercent()
end
end
end
end
for key, val in pairs(battlelist) do
if val:isMonster() then
if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest then
if g_game.getAttackingCreature() ~= val and val:getHealthPercent() <= lowesthpc then
g_game.attack(val)
delay(100)
break
end
end
end
end
end)
⚡ Ativar Aura
macro(5000, "AURA 1", function()
if aura ~= false then
aura = false
say("!aura1 on")
end
end)
⚡ Coletar Itens do Chão
local idz = {2644, 3043}
macro(100, "Coletar itens do chão", function()
local z = posz()
for _, tile in ipairs(g_map.getTiles(z)) do
if z ~= posz() then return end
if getDistanceBetween(pos(), tile:getPosition()) <= 10 then
if table.find(idz, tile:getTopLookThing():getId()) then
g_game.move(tile:getTopLookThing(), {x = 65535, y=SlotBack, z=0}, tile:getTopLookThing():getCount())
end
end
end
end)
⚡ Auto Cast (UI Completa)
storage.autoCastText = storage.autoCastText or "!cast on"
storage.autoCastActive = storage.autoCastActive or false
local autoCastMacro = macro(15000, function()
if storage.autoCastText then
say(storage.autoCastText)
end
end)
if not storage.autoCastActive then autoCastMacro.setOff() end
⚡ Stamina Potion
local potionsId = {9087}
local minStaminaHoursLeft = 41
macro(1000, "Stamina Potion", function()
if stamina() < minStaminaHoursLeft * 60 then
for _, potId in ipairs(potionsId) do
if findItem(potId) then
return g_game.use(findItem(potId))
end
end
end
end)
⚡ Auto Mana Shield
macro(100, "Auto Mana Shield", function(m)
if not hasManaShield() then
say("Utamo Vita")
end
schedule(100, function()
if m.isOff() then
say("Exana Vita")
end
end)
end)
⚡ Bug Map
local function checkPos(x, y)
local xyz = g_game.getLocalPlayer():getPosition()
xyz.x = xyz.x + x
xyz.y = xyz.y + y
local tile = g_map.getTile(xyz)
if tile then
return g_game.use(tile:getTopUseThing())
end
end
macro(1, 'Bug Map', function()
if modules.corelib.g_keyboard.isKeyPressed('w') then checkPos(0, -5)
elseif modules.corelib.g_keyboard.isKeyPressed('s') then checkPos(0, 5)
end
end)
⚡ Abrir Bag Principal
macro(1000, "Abrir Bag Principal", function()
local bpItem = getBack()
local bp = getContainer(0)
if not bp and bpItem ~= nil then
g_game.open(bpItem)
end
end)
⚡ Revidar Players
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)
local target = getPlayerByName(targetName)
if target then
g_game.attack(target)
end
end
end)
⚡ Usar Magia de Cura (95%)
macro(200, "Exura Vita 95%", function()
if hppercent() < 95 then
say("exura vita")
end
end)
macro(200, "Auto Arrow 3321", function()
local ammo = getSlot(InventorySlotAmmo)
-- se acabou ou não é o item 3321
if not ammo or ammo.id ~= 3321 then
local item = findItem(3321)
if item then
g_game.move(item, {x = 65535, y = InventorySlotAmmo, z = 0}, item.count)
end
end
end)
⚔️ Travar no Target
macro(200, "Travar no Target", function()
if g_game.isAttacking() then
oldTarget = g_game.getAttackingCreature()
end
if oldTarget and oldTarget:getPosition() then
if not g_game.isAttacking() and getDistanceBetween(pos(), oldTarget:getPosition()) <= 8 then
if oldTarget:getPosition().z == posz() then
g_game.attack(oldTarget)
end
end
end
end)