kasgosc
New Member
- Joined
- Mar 17, 2021
- Messages
- 3
- Reaction score
- 2
-- config
local Spells = {
{name = "azure water", cast = true, range = 10, buffSpell = false, manaCost = 0, level = 0},}
-- script
macro(1, "Spells Attack", 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() >= spell.manaCost and lvl() >= spell.level and distance <= spell.range and spell.cast then
if not hasPartyBuff() or not spell.buffSpell then
say(spell.name)
end
end
end
end)
macro(200, "AOE", function()
say("fireballs")
end)
local revidar = true
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)
macro(200, "Attack GERAL", function()
delay(100)
local spectators = g_map.getSpectators(g_game.getLocalPlayer():getPosition(), false)
for k,v in pairs(spectators) do
if not g_game.isAttacking() and not v:isPlayer() and not v:isNpc() and v:getName():lower() ~= 'VIP Trainer'
and getDistanceBetween(pos(), v:getPosition()) <= 5
and player:getLevel() <= 1500000 and v:getHealthPercent()>=5 then
g_game.attack(v)
end
end
end)
local dropItems = { 3035, 3043 }
local maxStackedItems = 4
local dropDelay = 200
gpAntiPushDrop = macro(dropDelay , "Anti-Push", function ()
antiPush()
end)
onPlayerPositionChange(function()
antiPush()
end)
function antiPush()
if gpAntiPushDrop:isOff() then
return
end
local tile = g_map.getTile(pos())
if tile and tile:getThingCount() < maxStackedItems then
local thing = tile:getTopThing()
if thing and not thing:isNotMoveable() then
for i, item in pairs(dropItems) do
if item ~= thing:getId() then
local dropItem = findItem(item)
if dropItem then
g_game.move(dropItem, pos(), 2)
end
end
end
end
end
end
local function openFromEmpty()
containers = getContainers()
if #containers < 1 and containers[0] == nil then
bpItem = getBack()
if bpItem ~= nil then
g_game.open(bpItem)
end
end
end
openFromEmpty()
macro(200, "Open Main BP", function()
containers = getContainers()
if #containers < 1 and containers[0] == nil then
openFromEmpty()
return
end
end)
local healingSpell = 'exura vita'
local hpPercent = 99
macro(1, "Spell Health", function()
if (hppercent() <= hpPercent) then
say(healingSpell)
end
end)
local healingId = 3169
local hpPercent = 99
macro(1, "Heal HP", function()
if (hppercent() <= hpPercent) then
usewith(healingId, player)
end
end)
local manaId = 3169
local manaPercent = 90
macro(1, "Heal Mana", function()
if (manapercent() <= manaPercent) then
usewith(manaId, player)
end
end)
macro(1000, "Buff", function()
if not hasPartyBuff() then
saySpell("!aura on")
end
end)
macro(100, "Auto Utamo Vita", function()
delay(1)
if not hasManaShield() then
say("utamo vita")
end
end)
local moneyIds = {3043, 3040} --
macro(200, "Exchange", function()
local containers = g_game.getContainers()
for index, container in pairs(containers) do
if not container.lootContainer then -- ignore monster containers
for i, item in ipairs(container:getItems()) do
if item:getCount() == 100 then
for m, moneyId in ipairs(moneyIds) do
if item:getId() == moneyId then
return g_game.use(item)
end
end
end
end
end
end
end)
onTalk(function(name, level, mode, text, channelId, pos)
if name == player:getName() then return end
if mode ~= 1 then return end
if string.find(text, "pt") then
local friend = getPlayerByName(name)
g_game.partyInvite(friend:getId())
end
end)
storage.increasing = true
storage.colors = {3, 2, 1, 0}
macro(232, "Black e White Outfit", function ()
local lastColor = storage.colors[1]
local baseColor = 0
local gap = 19
if lastColor == 6 then
storage.increasing = false
elseif lastColor == 0 and not storage.increasing then
storage.increasing = true
end
if storage.increasing then
table.insert(storage.colors, 1, lastColor + 1)
table.remove(storage.colors, 5)
else
table.insert(storage.colors, 1, lastColor - 1)
table.remove(storage.colors, 5)
end
local head = storage.colors[1] * gap + baseColor
local body = storage.colors[2] * gap + baseColor
local legs = storage.colors[3] * gap + baseColor
local feet = storage.colors[4] * gap + baseColor
local pOutfit = player:getOutfit()
local newColors = { type = pOutfit.type, head = head, body = body, legs = legs, feet = feet, addons = pOutfit.addons, mount = pOutfit.mount}
setOutfit(newColors)
end)
local Spells = {
{name = "azure water", cast = true, range = 10, buffSpell = false, manaCost = 0, level = 0},}
-- script
macro(1, "Spells Attack", 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() >= spell.manaCost and lvl() >= spell.level and distance <= spell.range and spell.cast then
if not hasPartyBuff() or not spell.buffSpell then
say(spell.name)
end
end
end
end)
macro(200, "AOE", function()
say("fireballs")
end)
local revidar = true
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)
macro(200, "Attack GERAL", function()
delay(100)
local spectators = g_map.getSpectators(g_game.getLocalPlayer():getPosition(), false)
for k,v in pairs(spectators) do
if not g_game.isAttacking() and not v:isPlayer() and not v:isNpc() and v:getName():lower() ~= 'VIP Trainer'
and getDistanceBetween(pos(), v:getPosition()) <= 5
and player:getLevel() <= 1500000 and v:getHealthPercent()>=5 then
g_game.attack(v)
end
end
end)
local dropItems = { 3035, 3043 }
local maxStackedItems = 4
local dropDelay = 200
gpAntiPushDrop = macro(dropDelay , "Anti-Push", function ()
antiPush()
end)
onPlayerPositionChange(function()
antiPush()
end)
function antiPush()
if gpAntiPushDrop:isOff() then
return
end
local tile = g_map.getTile(pos())
if tile and tile:getThingCount() < maxStackedItems then
local thing = tile:getTopThing()
if thing and not thing:isNotMoveable() then
for i, item in pairs(dropItems) do
if item ~= thing:getId() then
local dropItem = findItem(item)
if dropItem then
g_game.move(dropItem, pos(), 2)
end
end
end
end
end
end
local function openFromEmpty()
containers = getContainers()
if #containers < 1 and containers[0] == nil then
bpItem = getBack()
if bpItem ~= nil then
g_game.open(bpItem)
end
end
end
openFromEmpty()
macro(200, "Open Main BP", function()
containers = getContainers()
if #containers < 1 and containers[0] == nil then
openFromEmpty()
return
end
end)
local healingSpell = 'exura vita'
local hpPercent = 99
macro(1, "Spell Health", function()
if (hppercent() <= hpPercent) then
say(healingSpell)
end
end)
local healingId = 3169
local hpPercent = 99
macro(1, "Heal HP", function()
if (hppercent() <= hpPercent) then
usewith(healingId, player)
end
end)
local manaId = 3169
local manaPercent = 90
macro(1, "Heal Mana", function()
if (manapercent() <= manaPercent) then
usewith(manaId, player)
end
end)
macro(1000, "Buff", function()
if not hasPartyBuff() then
saySpell("!aura on")
end
end)
macro(100, "Auto Utamo Vita", function()
delay(1)
if not hasManaShield() then
say("utamo vita")
end
end)
local moneyIds = {3043, 3040} --
macro(200, "Exchange", function()
local containers = g_game.getContainers()
for index, container in pairs(containers) do
if not container.lootContainer then -- ignore monster containers
for i, item in ipairs(container:getItems()) do
if item:getCount() == 100 then
for m, moneyId in ipairs(moneyIds) do
if item:getId() == moneyId then
return g_game.use(item)
end
end
end
end
end
end
end)
onTalk(function(name, level, mode, text, channelId, pos)
if name == player:getName() then return end
if mode ~= 1 then return end
if string.find(text, "pt") then
local friend = getPlayerByName(name)
g_game.partyInvite(friend:getId())
end
end)
storage.increasing = true
storage.colors = {3, 2, 1, 0}
macro(232, "Black e White Outfit", function ()
local lastColor = storage.colors[1]
local baseColor = 0
local gap = 19
if lastColor == 6 then
storage.increasing = false
elseif lastColor == 0 and not storage.increasing then
storage.increasing = true
end
if storage.increasing then
table.insert(storage.colors, 1, lastColor + 1)
table.remove(storage.colors, 5)
else
table.insert(storage.colors, 1, lastColor - 1)
table.remove(storage.colors, 5)
end
local head = storage.colors[1] * gap + baseColor
local body = storage.colors[2] * gap + baseColor
local legs = storage.colors[3] * gap + baseColor
local feet = storage.colors[4] * gap + baseColor
local pOutfit = player:getOutfit()
local newColors = { type = pOutfit.type, head = head, body = body, legs = legs, feet = feet, addons = pOutfit.addons, mount = pOutfit.mount}
setOutfit(newColors)
end)