Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BP checker and strong mana potion checker
#1
Hi could someone help me with this script something like


local UH_backpack = ' brown backpack'
local Smp_backpack = 'blue backpack'
local min_smp = 120
local min_UH_cap = 60

if UH_backpack "cap" is under min_UH_cap or if item smp under min_smp then goto"label refill" or else goto label "continue 1"


second script instead of goto label use alarm

|Only Registered members can see download links. | Click here to buy subscription or here to register.

edit: SMP = strong mana potion
UH = ultimate healing rune
Reply

#2
Hello.

I can only think in two ways to count a container's weight:
1. If you know all items weight and iterate over all items on container. Bot don't have know items weight, so you would need to manually setup.
local CONFIG = {
    { Container = 'brown backpack', MinWeight = 60 }, -- Container Index, id or name and its minimum weight.
    { Container = 'blue backpack', MinWeight = 120 },
}

local ITEMS = {
    { Id = 3031, Weight = 0.1 },
    { Id = 3035, Weight = 0.1 },
}

for _, config in ipairs(CONFIG) do
    local cont = getcontainer(config.Container)
    local weight = 0
    local flag = false
    for __, item in ipairs(cont.items) do
        for ___, itemInfo in ipairs(ITEMS) do
            if item.id == itemInfo.Id then
                flag = true
                weight = weight + itemInfo.Weight
            end
        end
    end

    if flag and weight < config.MinWeight then
        gotolabel('refill')
        return
    end
end

gotolabel('continue 1')

2. Using context menu (right-click + "Look") and checking the message.
local MAIN_BP = 'red backpack' -- Container index, id or name
local CONFIG = {
    { ContainerId = 2854, MinWeight = 60 }, -- ID of container that is inside main bp to check weight. and its minimum weight.
    { ContainerId = 2869, MinWeight = 120 },
}
local weightMessagePattern = 'It weighs (%d*%.?%d+) oz'

for _, config in ipairs(CONFIG) do
    if contextmenucontainer('Look', MAIN_BP, config.ContainerId) then
        local msg = screenmessage(true, '3')
        if msg ~= nil and msg ~= '' then
            local weight_str = string.match(msg, weightMessagePattern)
            if weight_str ~= nil then
                local weight = tonumber(weight_str)
                if weight ~= nil and weight < config.MinWeight then
                    gotolabel('refill')
                    return
                end
            end
        end
    end
end

gotolabel('continue 1')
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016