• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

scripts/macros for kondras otclientv8 bot

Hello, does anyone have the script for swap ring and amulet ? plasma/might and plasma amulet/ssa
Post automatically merged:

Hello, does anyone have the script for swap ring and amulet ? plasma/might and plasma amulet/ssa
Lua:
local EQUIP_DELAY = 300
local EQUIP_ACTION = "equip"
local UNEQUIP_ACTION = "unequip"
local HP = "hp"
local MANA = "mana"

--[[
SlotHead - Head
SlotNeck - Amulet
SlotBack - Backpack
SlotBody - Armor
SlotRight - Right Hand
SlotLeft - Left Hand 
SlotLeg - Legs
SlotFeet - Boots
SlotFinger - Ring
SlotAmmo - Ammo
--]]

local SET = {
  {slot = SlotNeck, action = EQUIP_ACTION, value = 35, activeId = 12516, unactiveId = 12509, hpOrMana = HP},
  {slot = SlotNeck, action = UNEQUIP_ACTION, value = 85, activeId = 12516, unactiveId = 12509, hpOrMana = MANA},
  {slot = SlotFinger, action = EQUIP_ACTION, value = 35, activeId = 3086, unactiveId = 3049, hpOrMana = HP}, 
  {slot = SlotFinger, action = UNEQUIP_ACTION, value = 85, activeId = 3086, unactiveId = 3049, hpOrMana = MANA}, 
}

local function equipItemToSlot(slot, action, activeId, unactiveId)
  local slotId = getSlot(slot) and getSlot(slot):getId() or nil
  if (not slotId and action ~= UNEQUIP_ACTION) or (action == EQUIP_ACTION and slotId ~= activeId) or (action == UNEQUIP_ACTION and slotId == activeId) then
    if g_game.getClientVersion() <= 860 then
      if action == EQUIP_ACTION then
        moveToSlot(unactiveId, slot)
      else
        moveToSlot(getSlot(slot), SlotBack)
      end
      return true
    else
      g_game.equipItemId(unactiveId)
      return true
    end
  end
  return false
end

local function isConditionSatisfy(item)
  local hpOrMana = item.hpOrMana == HP and hppercent() or item.hpOrMana == MANA and manapercent()
  return (item.action == EQUIP_ACTION and hpOrMana < item.value) or (item.action == UNEQUIP_ACTION and hpOrMana > item.value)
end

local function hasHigherPriority(itemInSet, itemInMap)
  if itemInSet.action == EQUIP_ACTION then
    if itemInMap.value > itemInSet.value then
      if isConditionSatisfy(itemInSet) then
        return true
      end
    end
  else
    if itemInMap.value < itemInSet.value then
      if isConditionSatisfy(itemInSet) then
        return true
      end
    end
  end
  return false
end

local function getHighestPriorityItems()
  local items = {}
  for i, item in pairs(SET) do
    local itemInMap = items[item.slot]
    if (not itemInMap and isConditionSatisfy(item)) or (itemInMap and hasHigherPriority(item, itemInMap)) then
      items[item.slot] = item
    end
  end
  return items
end

macro(100, "Equipper -[860 ~ 1200]+", function()
  local items = getHighestPriorityItems()
  for i, item in pairs(items) do
    if equipItemToSlot(item.slot, item.action, item.activeId, item.unactiveId) then
      delay(EQUIP_DELAY)
      return
    end
  end
end)

you should join the official otcv8 discord there are several scripts
 
Guys I'm looking for script :
When no player use aoe,
When player use target spell.

All from here and from google doesnt work
 
Good evening forum. Do you have any script for combo leader, or combobot?
otcv8 and vBot_4.8 brings one by default in "bot server"

you just need to know how to use it
note: only works with otcv8 . not elfbot
 
any script to buy items in market?
Lua:
function:[[

delay(10000)

 

  -- Falar c/ NPC

schedule(200, function()

  local spectators = g_map.getSpectators(g_game.getLocalPlayer():getPosition(), false)

  for k,v in pairs(spectators) do

       if not g_game.isAttacking() and v:isNpc() then

  NPC.say("hi")

  schedule(1000, function() NPC.say("trade") end)

   if NPC.isTradeOpen then

     schedule(2000, function() NPC.buy(123456, 100) end)

         schedule(3000, function() NPC.closeTrade() end)

             schedule(4000, function() NPC.say("bye") end)

   end

  end

 end

end)

delay(1000)

return true


]]

OR
Lua:
local npc = getCreatureByName("Npc Name")
local idpot = 3131
local potcount = 1000

if npc then
  if not NPC.isTrading() then
    say("hi")
    schedule(1000, function() NPC.say("trade") end)
  else
    schedule(1000, function() NPC.buy(idpot, 100) end)
  end
  delay(2000)
end

if player:getItemsCount(potid) <= potcount then
  return "retry"
end
return true
 
Last edited:
Lua:
function:[[

delay(10000)

 

  -- Falar c/ NPC

schedule(200, function()

  local spectators = g_map.getSpectators(g_game.getLocalPlayer():getPosition(), false)

  for k,v in pairs(spectators) do

       if not g_game.isAttacking() and v:isNpc() then

  NPC.say("hi")

  schedule(1000, function() NPC.say("trade") end)

   if NPC.isTradeOpen then

     schedule(2000, function() NPC.buy(123456, 100) end)

         schedule(3000, function() NPC.closeTrade() end)

             schedule(4000, function() NPC.say("bye") end)

   end

  end

 end

end)

delay(1000)

return true


]]

OR
Lua:
local npc = getCreatureByName("Npc Name")
local idpot = 3131
local potcount = 1000

if npc then
  if not NPC.isTrading() then
    say("hi")
    schedule(1000, function() NPC.say("trade") end)
  else
    schedule(1000, function() NPC.buy(idpot, 100) end)
  end
  delay(2000)
end

if player:getItemsCount(potid) <= potcount then
  return "retry"
end
return true
not to buy supplies from npc but buying from depo/market... For example: buy items to imbu :D
 
I want a script to attack with exori gran con AND exori con when gran con is on cd.
Tnks
 
hello, since there's quite many people making use of otclientv8, i thought it would be nice to have a place where people can share macros and what not, since right now they're only posted in discord which isn't a good place to find scripts

collection of scripts i found, some are made by me, some are made by thaenz (i don't know if he has a otland acct), some are made by others:


Automatically equip energy shield when you're below a certiain amount of health percent:
Lua:
--[[
  1. Start the script with your normal ring on
  2. make sure the backpack with e-rings
     are always open
]]
local energy_ring = 3051; -- Your energy ring
local energy_ring_equiped = 3088; -- Ring changes id when equiped
local original_ring = getFinger(); -- Your original ring
local healthp_for_energy = 50;
local healthp_for_original = 80;
local manap_for_original = 25;

macro(1000, "e-ring", function()
  if (manapercent() <= manap_for_original and getFinger():getId() ~= original_ring:getId()) then
    g_game.equipItem(original_ring);
  elseif (hppercent() <= healthp_for_energy and manapercent() >= manap_for_original and getFinger():getId() ~= energy_ring) then
      local ring = findItem(energy_ring);
      if (ring) then
          g_game.equipItem(ring);
      end
  elseif (hppercent() >= healthp_for_original and getFinger():getId() ~= original_ring:getId()) then
      g_game.equipItem(original_ring);
  end
end)

Automatically walk to an item on your screen (used on my ots to walk into flames which spawns monsters, but can be useful for other ots too)
Lua:
macro(1000, "open monster flames",  function()
  for i, tile in ipairs(g_map.getTiles(posz())) do
      for u,item in ipairs(tile:getItems()) do
          if (item:getId() == 25058) then
            autoWalk(tile:getPosition(), 100, {ignoreNonPathable = true})
          end
        end
    end
end)

Automatically follow a player with X name:
Lua:
local playerToFollow = 'Lunia'
macro(1000, "auto follow",  function()
    if g_game.isFollowing() then
        return
    end
    for _, followcreature in ipairs(g_map.getSpectators(pos(), false)) do
        if (followcreature:getName() == playerToFollow and getDistanceBetween(pos(), followcreature:getPosition()) <= 8) then
            g_game.follow(followcreature)
        end
    end
end)

Hold target:
Lua:
local oldTarget
macro(200, "hold target",  function()
    if g_game.isAttacking() then
        oldTarget = g_game.getAttackingCreature()
    end
    if (oldTarget and not g_game.isAttacking() and getDistanceBetween(pos(), oldTarget:getPosition()) <= 8) then
        g_game.attack(oldTarget)
    end
end)

Mana restore (can be good if you wanna edit it more, or just spam it faster):
Lua:
local manaId = 268
local manaPercent = 80
macro(200, "faster mana potting",  function()
  if (manapercent() <= manaPercent) then
    usewith(manaId, player)
  end
end)


Health restore:
Lua:
local healthId = 268
local healthPercent = 80
macro(200, "faster health potting",  function()
  if (hppercent() <= healthPercent) then
    usewith(healthId, player)
  end
end)

Healing with spells:
Lua:
local healingSpell = 'Exura gran san'
local hpPercent = 99
macro(50, "faster healing",  function()
  if (hppercent() <= hpPercent) then
    say(healingSpell)
  end
end)

Automatically use an item on your screen (used on my ots for opening boxes that spawn randomly)
Lua:
macro(2500, "open monster boxes",  function()
  for i, tile in ipairs(g_map.getTiles(posz())) do
    for u,item in ipairs(tile:getItems()) do
      if (item and item:getId() == 9586) then
        g_game.use(item)
        return
      end
    end 
  end
end)

Cast aoe spell when more than X monsters on the screen, else use single target spell: (there's also a version where it doesn't cast aoe spells if there are players on screen if somebody needs)
Lua:
local singleTargetSpell = 'exori gran star'
local multiTargetSpell = 'exevo mas row'
local distance = 3
local amountOfMonsters = 4

macro(250, "multi target spell",  function()
    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)

Rainbow outfit (should probably be improved by taking your current outfit type, but this also works if you know the outfit looktype)
Lua:
local outfit = {
  head = 0,
  body = 1,
  legs = 2,
  feet = 3,
  type = 143, -- outfit id
  auxType = 0,
  addons = 3, -- 1, 2, or 3 for all
  mount = 0, -- mount id
}

macro(100, "RainbowOutfit",  function()
  outfit.head = (outfit.head + 1) % 133;
  outfit.body = (outfit.body + 1) % 133;
  outfit.legs = (outfit.legs + 1) % 133;
  outfit.feet = (outfit.feet + 1) % 133;
  setOutfit(outfit);
end)

Automatically cast utamo vita when below X health, and deactivate again when you're below X mana (useful for paladin on ots with custom mana shield)
Lua:
local castBelowHp = 40
local deactiveBelowMana = 40
macro(100, "advanced manashield",  function()
  if (hppercent() <= castBelowHp and manapercent() >= deactiveBelowMana and not hasManaShield()) then
    say('utamo vita')
  end
  if (manapercent() <= deactiveBelowMana and  hppercent() >= castBelowHp and hasManaShield()) then
      say('utamo vita')
  end
end)

Automatically convert gold coins:
Lua:
macro(500, "replace coins", function()
  for i, container in pairs(getContainers()) do
    for j, item in ipairs(container:getItems()) do
      if item:getCount() == 100 and item:getId() == 3031 then
        g_game.use(item)
        return
      end
    end
  end
end)

Automatically cast exura sio on a friend:
Lua:
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)


And post requests of things you want here, and somebody can probably create it, u should also join otcv8 discord where people are talking about the bot and macros: Join the OTClientV8 Discord Server! (https://discord.gg/feySup6)
I would like to know if there is any script to use first an attack spell (exevo mas san) and then use a rune (avalanche) to hunt
 
Hello guys.
I was wondering if there is any targeting script that could be modified to attack from 100% till 2% hp or something like that.
I'd apreciate the help.
Thanks.
 
So I took this AOE script and what I'm trying to make it do is use an AOE. If that AOE is exhausted. Then use the other Aoe. Once its no longer exhausted. Use the first AOE spell again and repeat. Ive come up with this And it works, but it is super spammy. Is there a way to introduce Exhaust timer.? OR maybe make it wait? I feel like right now the script is going to RETURN both spells. And which every works and is not exhausted will work. Starting with the first AOE "say". Any help on this? I'm not a coder. But I can usually get things to work.


Lua:
UI.Separator()
local distance = 8
local amountOfMonsters = 1
addTextEdit("NeedSafe", storage.NeedSafe or "NeedSafe", function(widget, text1)
storage.NeedSafe = text1
end)
addTextEdit("SpellAtack", storage.SpellAtack or "fire", function(widget, text2)
storage.SpellAtack = text2
end)
macro(105, "Spells",  function()
    local isSafe = true;
    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
        if (mob:isPlayer() and (player:getName() ~= mob:getName()) and (storage.NeedSafe) == "NeedSafe") then
            isSafe = false;
        end
    end
    if (specAmount >= amountOfMonsters) and isSafe then
        if ((storage.SpellAtack) == "fire" or (storage.SpellAtack) == "earth") then
            return say("Exevo Gran Max mort"), say("Exevo Mas Flam")
        end
    end
end)
UI.Separator()
 
Hi, I have a script request - I hope I'm explaining it right.

I need the 'kick item' version of the 'anti push' script, but not by ID, but by item name.

I play on a server with items such as:
Plate Legs
[RARE] Plate Legs
[Legendary] Plate Legs

Each of them has the SAME ID and is collected from the autoloot after adding Plate Legs.

I would like the script to throw an item called PLATE LEGS out of my backpack, and leave the rest that I do not enter (raro etc.).
 
Hi, I have a script request - I hope I'm explaining it right.

I need the 'kick item' version of the 'anti push' script, but not by ID, but by item name.

I play on a server with items such as:
Plate Legs
[RARE] Plate Legs
[Legendary] Plate Legs

Each of them has the SAME ID and is collected from the autoloot after adding Plate Legs.

I would like the script to throw an item called PLATE LEGS out of my backpack, and leave the rest that I do not enter (raro etc.).
1687500603868.png
1687500629512.png

Join the OTClientV8 Discord Server! (https://discord.gg/feySup6)

 
local singleTargetSpell = 'exori gran star' local multiTargetSpell = 'exevo mas row' local distance = 3 local amountOfMonsters = 4 macro(250, "multi target spell", function() 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)
hello need spell with safe area
 
Hello everyone, below is a great list of scripts

DANCE ICON

Lua:
dancing = addIcon("dancing",

{outfit={mount=0,feet=0,legs=0,body=176,type=128,auxType=0,addons=3,head=48}, hotkey="", text="Dance"}, macro(10, "Dance", function()

   turn(math.random(0,2))

end))

dancing:breakAnchors()

dancing:move(1200, 220)

HOLD TARGET ICON

Lua:
local targetID = nil



-- escape when attacking will reset hold target

onKeyPress(function(keys)

    if keys == "Escape" and targetID then

        targetID = nil

    end

end)



addIcon("Hold Target", {item={id=3547 , count=1}, text="HoldTGT"}, macro(100, function(m)

    -- if attacking then save it as target, but check pos z in case of marking by mistake on other floor

    if target() and target():getPosition().z == posz() and not target():isNpc() then

        targetID = target():getId()

    elseif not target() then

        -- there is no saved data, do nothing

        if not targetID then return end



        -- look for target

        for i, spec in ipairs(getSpectators()) do

            local sameFloor = spec:getPosition().z == posz()

            local oldTarget = spec:getId() == targetID

          

            if sameFloor and oldTarget then

                attack(spec)

            end

        end

    end

end))

ORGANIZE BACKPACKS

Lua:
contPanelName = "renameContainers"

if type(storage[contPanelName]) ~= "table" then

    storage[contPanelName] = {

        enabled = false,

        purse = true,

        all = true,

        list = {

            {

                value = "Main Backpack",

                enabled = true,

                item = 9601,

                min = false,

            },

            {

                value = "Runes",

                enabled = true,

                item = 2866,

                min = true,

            },

            {

                value = "Money",

                enabled = true,

                item = 2871,

                min = true,

            },

            {

                value = "Purse",

                enabled = true,

                item = 23396,

                min = true,

            },

            {

                value = "Lootbag",

                enabled = false,

                item = 30264,

                min = true,

            },

        }

    }

end



local renameContui = setupUI([[

Panel

  height: 38



  BotSwitch

    id: title

    anchors.top: parent.top

    anchors.left: parent.left

    text-align: center

    width: 130

    !text: tr('Minimise Containers')



  Button

    id: editContList

    anchors.top: prev.top

    anchors.left: prev.right

    anchors.right: parent.right

    margin-left: 3

    height: 17

    text: Setup



  Button

    id: reopenCont

    !text: tr('Reopen Containers')

    anchors.left: parent.left

    anchors.top: prev.bottom

    anchors.right: parent.right

    height: 17

    margin-top: 2



  ]])

renameContui:setId(contPanelName)



g_ui.loadUIFromString([[

BackpackName < Label

  background-color: alpha

  text-offset: 18 0

  focusable: true

  height: 16



  CheckBox

    id: enabled

    anchors.left: parent.left

    anchors.verticalCenter: parent.verticalCenter

    width: 15

    height: 15

    margin-top: 2

    margin-left: 3



  $focus:

    background-color: #00000055



  Button

    id: state

    !text: tr('M')

    anchors.right: remove.left

    margin-right: 5

    width: 15

    height: 15



  Button

    id: remove

    !text: tr('x')

    !tooltip: tr('Remove')

    anchors.right: parent.right

    margin-right: 15

    width: 15

    height: 15



ContListsWindow < MainWindow

  !text: tr('Container Names')

  size: 435 166

  @onEscape: self:hide()



  TextList

    id: itemList

    anchors.left: parent.left

    anchors.top: parent.top

    size: 180 83

    margin-top: 3

    margin-bottom: 3

    margin-left: 3

    vertical-scrollbar: itemListScrollBar



  VerticalScrollBar

    id: itemListScrollBar

    anchors.top: itemList.top

    anchors.bottom: itemList.bottom

    anchors.right: itemList.right

    step: 14

    pixels-scroll: true



  VerticalSeparator

    id: sep

    anchors.top: parent.top

    anchors.left: itemList.right

    anchors.bottom: separator.top

    margin-top: 3

    margin-bottom: 6

    margin-left: 10



  Label

    id: lblName

    anchors.left: sep.right

    anchors.top: sep.top

    width: 70

    text: Name:

    margin-left: 10

    margin-top: 3



  TextEdit

    id: contName

    anchors.left: lblName.right

    anchors.top: sep.top

    anchors.right: parent.right



  Label

    id: lblCont

    anchors.left: lblName.left

    anchors.top: contName.bottom

    width: 70

    text: Container:

    margin-top: 20



  BotItem

    id: contId

    anchors.left: lblCont.right

    anchors.top: contName.bottom

    margin-top: 12



  Button

    id: addItem

    anchors.right: contName.right

    anchors.top: contName.bottom

    margin-top: 5

    text: Add

    width: 40

    font: cipsoftFont



  HorizontalSeparator

    id: separator

    anchors.right: parent.right

    anchors.left: parent.left

    anchors.bottom: closeButton.top

    margin-bottom: 8



  CheckBox

    id: all

    anchors.left: parent.left

    anchors.bottom: parent.bottom

    text: Open All

    tooltip: Opens all containers in main backpack.

    width: 90

    height: 15

    margin-top: 2

    margin-left: 3



  CheckBox

    id: purse

    anchors.left: prev.right

    anchors.bottom: parent.bottom

    text: Open Purse

    tooltip: Opens Store/Charm Purse

    width: 90

    height: 15

    margin-top: 2

    margin-left: 3



  Button

    id: closeButton

    !text: tr('Close')

    font: cipsoftFont

    anchors.right: parent.right

    anchors.bottom: parent.bottom

    size: 45 21

    margin-top: 15

]])



function findItemsInArray(t, tfind)

    local tArray = {}

    for x,v in pairs(t) do

        if type(v) == "table" then

            local aItem = t[x].item

            local aEnabled = t[x].enabled

                if aItem then

                    if tfind and aItem == tfind then

                        return x

                    elseif not tfind then

                        if aEnabled then

                            table.insert(tArray, aItem)

                        end

                    end

                end

            end

        end

    if not tfind then return tArray end

end



local lstBPs

function openBackpacks()

    if not storage[contPanelName].all then

         lstBPs = findItemsInArray(storage[contPanelName].list)

    end



    for _, container in pairs(g_game.getContainers()) do g_game.close(container) end

    schedule(1000, function()

        bpItem = getBack()

        if bpItem ~= nil then

            g_game.open(bpItem)

        end

    end)



    schedule(2000, function()

        local delay = 1



        local nextContainers = {}

        containers = getContainers()

        for i, container in pairs(g_game.getContainers()) do

            for i, item in ipairs(container:getItems()) do

                if item:isContainer() then

                    if item:isContainer() and storage[contPanelName].all or (lstBPs and table.contains(lstBPs,item:getId())) then

                        table.insert(nextContainers, item)

                    end

                end

            end

        end

        if #nextContainers > 0 then

            for i = 1, #nextContainers do

                schedule(delay, function()

                    g_game.open(nextContainers, nil)

                end)

                delay = delay + 250

            end

        end



        if storage[contPanelName].purse then

            schedule(delay+200, function()

                local item = getPurse()

                if item then

                    use(item)

                end

            end)

            -- only use this if you play evolunia or similar

            schedule(delay+200, function()

                if not getContainerByItem(30264) then

                    return g_game.talk("!lootbag")

                end

            end)

        end

    end)



end



rootWidget = g_ui.getRootWidget()

if rootWidget then

    contListWindow = UI.createWindow('ContListsWindow', rootWidget)

    contListWindow:hide()



    renameContui.editContList.onClick = function(widget)

        contListWindow:show()

        contListWindow:raise()

        contListWindow:focus()

    end



    renameContui.reopenCont.onClick = function(widget)

        openBackpacks()

    end



    renameContui.title:setOn(storage[contPanelName].enabled)

    renameContui.title.onClick = function(widget)

        storage[contPanelName].enabled = not storage[contPanelName].enabled

        widget:setOn(storage[contPanelName].enabled)

    end



    contListWindow.closeButton.onClick = function(widget)

        contListWindow:hide()

    end



    contListWindow.purse.onClick = function(widget)

        storage[contPanelName].purse = not storage[contPanelName].purse

        contListWindow.purse:setChecked(storage[contPanelName].purse)

    end

    contListWindow.purse:setChecked(storage[contPanelName].purse)



    contListWindow.all.onClick = function(widget)

        storage[contPanelName].all = not storage[contPanelName].all

        contListWindow.all:setChecked(storage[contPanelName].all)

        label.enabled:setTooltip(storage[contPanelName].all and 'Opens all containers in main backpack.' or 'Opens listed containers from main backpack.')

    end

    contListWindow.all:setChecked(storage[contPanelName].all)



    local refreshContNames = function(tFocus)

        local storageVal = storage[contPanelName].list

        if storageVal and #storageVal > 0 then

            for i, child in pairs(contListWindow.itemList:getChildren()) do

                child:destroy()

            end

            for _, entry in pairs(storageVal) do

                local label = g_ui.createWidget("BackpackName", contListWindow.itemList)

                label.onMouseRelease = function()

                    contListWindow.contId:setItemId(entry.item)

                    contListWindow.contName:setText(entry.value)

                end

                label.enabled.onClick = function(widget)

                    entry.enabled = not entry.enabled

                    label.enabled:setChecked(entry.enabled)

                    label.enabled:setTooltip(entry.enabled and 'Disable' or 'Enable')

                    label.enabled:setImageColor(entry.enabled and '#00FF00' or '#FF0000')

                end

                label.remove.onClick = function(widget)

                    table.removevalue(storage[contPanelName].list, entry)

                    label:destroy()

                end

                label.state:setChecked(entry.min)

                label.state.onClick = function(widget)

                    entry.min = not entry.min

                    label.state:setChecked(entry.min)

                    label.state:setColor(entry.min and '#00FF00' or '#FF0000')

                    label.state:setTooltip(entry.min and 'Open Minimised' or 'Do not minimise')

                end



                label:setText(entry.value)

                label.enabled:setChecked(entry.enabled)

                label.enabled:setTooltip(entry.enabled and 'Disable' or 'Enable')

                label.enabled:setImageColor(entry.enabled and '#00FF00' or '#FF0000')

                label.state:setColor(entry.min and '#00FF00' or '#FF0000')

                label.state:setTooltip(entry.min and 'Open Minimised' or 'Do not minimise')



                if tFocus and entry.item == tFocus then

                    tFocus = label

                end

            end

            if tFocus then contListWindow.itemList:focusChild(tFocus) end

        end

    end

    contListWindow.addItem.onClick = function(widget)

        local id = contListWindow.contId:getItemId()

        local trigger = contListWindow.contName:getText()



        if id > 100 and trigger:len() > 0 then

            local ifind = findItemsInArray(storage[contPanelName].list, id)

            if ifind then

                storage[contPanelName].list[ifind] = { item = id, value = trigger, enabled = storage[contPanelName].list[ifind].enabled, min = storage[contPanelName].list[ifind].min}

            else

                table.insert(storage[contPanelName].list, { item = id, value = trigger, enabled = true, min = false })

            end

            contListWindow.contId:setItemId(0)

            contListWindow.contName:setText('')

            contListWindow.contName:setColor('white')

            contListWindow.contName:setImageColor('#ffffff')

            contListWindow.contId:setImageColor('#ffffff')

            refreshContNames(id)

        else

            contListWindow.contId:setImageColor('red')

            contListWindow.contName:setImageColor('red')

            contListWindow.contName:setColor('red')

        end

    end

    refreshContNames()

end



onContainerOpen(function(container, previousContainer)

    if renameContui.title:isOn() then

        if not previousContainer then

            if not container.window then return end

            containerWindow = container.window

            containerWindow:setContentHeight(34)

            local storageVal = storage[contPanelName].list

            if storageVal and #storageVal > 0 then

                for _, entry in pairs(storageVal) do

                    if entry.enabled and string.find(container:getContainerItem():getId(), entry.item) then

                        if entry.min then

                            containerWindow:minimize()

                        end

                        containerWindow:setText(entry.value)

                    end

                end

            end

        end

    end

end)



openBackpacks()

MANA TRAINING

Lua:
UI.Label("Mana training")

if type(storage.manaTrain) ~= "table" then

  storage.manaTrain = {on=false, title="MP%", text="utevo lux", min=80, max=100}

end



local manatrainmacro = macro(1000, function()

  if TargetBot and TargetBot.isActive() then return end -- pausa o treino enquanto target estiver on

  local mana = math.min(100, math.floor(100 * (player:getMana() / player:getMaxMana())))

  if storage.manaTrain.max >= mana and mana >= storage.manaTrain.min then

    say(storage.manaTrain.text)

  end

end)

manatrainmacro.setOn(storage.manaTrain.on)



UI.DualScrollPanel(storage.manaTrain, function(widget, newParams)

  storage.manaTrain = newParams

  manatrainmacro.setOn(storage.manaTrain.on)

end)

UI.Separator()

MW IN FRONT OF TARGET

Lua:
mwfrente = "hotkeymwf"

if not storage[mwfrente] then

 storage[mwfrente] = { hkf = ''}

end

UI.Label("Hotkey MW Frente Target:")

UI.TextEdit(storage[mwfrente].hkf, function(widget, newText)

    storage[mwfrente].hkf = newText

end)



local mwallId = 3180 -- Mwall ID

local squaresThreshold = 2 -- quantidade de sqm a tacar MW frente do char

onKeyUp(function(keys)

if (keys ~= storage[mwfrente].hkf) then return end

local target = g_game.getAttackingCreature() or g_game.getFollowingCreature()

      if target then

      local targetPos = target:getPosition()

      local targetDir = target:getDirection()

      local mwallTile

      if targetDir == 0 then -- north

        targetPos.y = targetPos.y - squaresThreshold

        mwallTile = g_map.getTile(targetPos)

        useWith(mwallId, mwallTile:getTopUseThing())

      elseif targetDir == 1 then -- east

        targetPos.x = targetPos.x + squaresThreshold

        mwallTile = g_map.getTile(targetPos)

        useWith(mwallId, mwallTile:getTopUseThing())

      elseif targetDir == 2 then -- south

        targetPos.y = targetPos.y + squaresThreshold

        mwallTile = g_map.getTile(targetPos)

        useWith(mwallId, mwallTile:getTopUseThing())

      elseif targetDir == 3 then -- west

        targetPos.x = targetPos.x - squaresThreshold

        mwallTile = g_map.getTile(targetPos)

        useWith(mwallId, mwallTile:getTopUseThing())

      end

   end

end)

UI.Separator()

ANTI PUSH

Lua:
local dropItems = { 3492, 3590, 3031 }

local maxStackedItems = 5

local dropDelay = 10



addIcon("AntiPush", {item={id=3031,count=100}, movable=true, hotkey="Insert", text="AntiPush"},

macro(dropDelay , "", function()

  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(), 1)

            end

        end

      end

    end

  end

end))

CUT WILD

Lua:
local tools = {9596} -- IDs das machadinhas e picaretas

local WILD_GROWTH_ID = 2130 -- ID do Wild Growth

macro(50, "Cortar Wild Growth", "5", function()

local playerPos = player:getPosition() -- Posição do personagem

local tilesAroundPlayer = getNearTiles(playerPos) -- Tiles ao redor do personagem



if isInPz() then return end



for _, toolId in ipairs(tools) do

local tool = findItem(toolId)



if tool then

  for i = 1, #tilesAroundPlayer do

    local tile = tilesAroundPlayer

    

    if tile:getTopUseThing() and tile:getTopUseThing():getId() == WILD_GROWTH_ID then

      useWith(tool, tile:getTopUseThing())

      return

    end

  end

end

end

end)

STOP TARGET PLAYER ON SCREEN



Lua:
local distancetostop = 4 -- distância para parar a cave



macro(100, "Stop Target Player na Tela", function()

    local pos = pos()

    for _, spec in ipairs(getSpectators()) do

        if spec ~= player and spec:isPlayer() then

            local specPos = spec:getPosition()

            if specPos then

         distance = getDistanceBetween(pos, specPos)

               if distance < distancetostop then

                    TargetBot.setOff() return

                end

            end

        end

    end

    TargetBot.setOn()

end)

DEATH COUNT

Lua:
local logoutDeaths = 2 -- numero de mortes

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, "Contador de Mortes", 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)

ANTI RED SKULL

Lua:
local rsAlarm = false



function alarmChangeIcon(change)

    if change then

        g_window.setIcon('/images/alertclienticon')

    else

        g_window.setIcon('/images/clienticon')

    end

end





antiRSm = macro(1000, "Red Skull Safe", function()

    if antiRSm.isOn() and rsAlarm then

    playSound("/sounds/Player_Attack.ogg")

    delay(1000)

    return

    end

end)



local frags = 0

onTextMessage(function(mode, text)

    if not antiRSm.isOn() then return end

    if not text:lower():find("warning! the murder of") then return end

    say("Oh seu idiota, eu tenho anti red agora.")

    frags = frags + 1

    if killsToRs() < 2 or frags > 0 then

        AttackBot.setActiveProfile(1)

        alarmChangeIcon(true)

        rsAlarm = true

    end

end)

REPLY PM AFK

Lua:
local afkMsg = false

addSwitch("afkMsg", "Responder PM AFK", function(widget)

    afkMsg = not afkMsg

    widget:setOn(afkMsg)

end)



onTalk(function(name, level, mode, text, channelId, pos) --quando receber uma pm vai responder com a mensagem escolhida abaixo

    if mode == 4 and afkMsg == true then

        g_game.talkPrivate(5, name, storage.afkMsg)

        delay(5000)

    end

end)

UI.TextEdit(storage.afkMsg or "Estou AFK no momento.", function(widget, newText)

storage.afkMsg = newText

end)

EXIVA LAST TARGET

Lua:
local KEY = "F12"



hotkey(KEY, "Exiva Ultimo Target", function()

  if not target then return end

  say('exiva "' .. target:getName())

end)



mwfrente = "hotkeymwf"

if not storage[mwfrente] then

 storage[mwfrente] = { hkf = ''}

end

UI.Label("Hotkey MW Frente Target:")

UI.TextEdit(storage[mwfrente].hkf, function(widget, newText)

    storage[mwfrente].hkf = newText

end)
all credit is to the community, I'm just sharing some useful scripts I've found these past few months. have fun :D
 
Last edited:
PARTY LEADER HUNT

Lua:
local infoTime = 0

local talkTime = 0

local maxLevel = 0

local minLevel = 0

local justForInfo = true

local canSeeInfo = true

local partyMembersCount = 0



local partyLeaderHuntWidget = macro(1000, "Party Leader Hunt", function()

  if not player:isPartyLeader() then

    justForInfo = true

    partyMembersCount = 0

    return

  end

  if justForInfo and canSeeInfo then

    sayChannel(getChannelId("pt"), "!party info")

    return

  end

  if talkTime > 0 then

    talkTime = talkTime - 1

  end

  if player:getShield() == 10 then

    infoTime = infoTime + 1

    if infoTime >= 20 then

      sayChannel(getChannelId("pt"), "!party info")

      infoTime = 0

    end

  else

    infoTime = 0

  end

end)



addLabel("maxLevel", "Max Level:")

addTextEdit("maxLevel", storage.maxLevel or "", function(widget, text)

  if tonumber(text) then

    maxLevel = tonumber(text)

  else

    sayChannel(getChannelId("pt"), "!party info")

  end

  storage.maxLevel = tonumber(text)

end)



addLabel("minLevel", "Min Level:")

addTextEdit("minLevel", storage.minLevel or "", function(widget, text)

  if tonumber(text) then

    minLevel = tonumber(text)

  else

    sayChannel(getChannelId("pt"), "!party info")

  end

  storage.minLevel = tonumber(text)

end)



onTalk(function(name, level, mode, text, channelId, pos)

  if partyLeaderHuntWidget:isOn() then

    if name == player:getName() then return end

    if text:lower():find("time007") or (text:lower():find("pt") and not text:lower():find("!time007")) then

      for _, spec in ipairs(getSpectators()) do

        if spec:getName() == name then

          if spec:isPartyMember() then return end

          if spec:getShield() == 2 then

            g_game.talkPrivate(5, name, name .. ", TÁ INVITADO CORNO")

            return

          end

          if level > maxLevel or level < minLevel then

            g_game.talkPrivate(5, name, name .. ",voce e fraco te falta odio!!! min level " .. minLevel .. " max " .. maxLevel)

            return

          end

          if partyMembersCount >= 30 then

            g_game.talkPrivate(5, name, name .. ", Tem 30 já, rlx o cu q jaja tu entra.")

            return

          end

          g_game.partyInvite(spec:getId())

        end

      end

    end

  end

end)



onLoginAdvice(function(text)

  if partyLeaderHuntWidget:isOn() then

    local explode1 = string.explode(text, "*")

    local explode2 = string.explode(explode1[8], ":")[2]

    if not storage.maxLevel then

      maxLevel = math.ceil(tonumber(string.explode(explode1[4], ":")[2])*3/2)

    else

      maxLevel = storage.maxLevel

    end

    if not storage.minLevel then

      minLevel = math.ceil(tonumber(string.explode(explode1[3], ":")[2])*2/3)

    else

      minLevel = storage.minLevel

    end

    partyMembersCount = tonumber(string.explode(explode1[2], ":")[2])

    if justForInfo then

      justForInfo = false

      return

    end

    if explode2:find(",") then

      local names = string.explode(explode2, ",")

      for i = 1, #names do

        canSeeInfo = false

        schedule(700 * i, function()

          if i == #names then

            canSeeInfo = true

          end

          sayChannel(getChannelId("pt"), "!party kick," .. names)

        end)

      end

    elseif explode2 ~= "" then

      schedule(1000, function() sayChannel(getChannelId("party"), "!party kick," .. explode2) end)

    end

  end

end)



onCreatureAppear(function(creature)

  if partyLeaderHuntWidget:isOn() then

    if not creature:isPlayer() then return end

    if creature:isLocalPlayer() then return end

    if creature:getShield() == 2 then return end

    if creature:isPartyMember() then return end

    if talkTime == 0 and partyMembersCount < 30 then



      talkTime = 90

    end

  end

end)



onTextMessage(function(mode, text)

  if partyLeaderHuntWidget:isOn() then

    if text:lower():find("you are now the leader of the party.") or text:lower():find("has joined the party.") or (text:lower():find("has left the party.") and canSeeInfo) then

      justForInfo = true

    end

  end

end)


AUTO ACCEPT PARTY

Lua:
macro(1000,"Auto Accept Party",function()

  if player:getShield() > 2 then return end -- already in a party

  for s, spec in pairs(getSpectators(false)) do

    if spec:getShield() == 1 then

      g_game.partyJoin(spec:getId())

      delay(1000)

    end

  end

end)

all credit is to the community, I'm just sharing some useful scripts I've found these past few months. have fun :D
 
Last edited:
Back
Top