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
Make runes with mana potions in house
#1
Hello

I want to make runes with bought mana potions in house.

I have 1 sqm with 1 backpack full of 20 backpacks with 20 backpacks of mana potions in.

I want to make a LUA script that opens a backpack of mana potions. Drink it, then close it and open next backpack with mana potions.

All while the character makes runes (adori gran flam) as soon as mana allows.

Help please?
Reply

#2
This script will check for mfs, if there's no more mana fluids and there are vials then it will go back to previous windows. If it finds containers (bps, etc.) it will try to open it and check for mfs, if there are no mfs then it will go back to previous window and try next.
local BP_MF = 'red backpack' -- Name, id or index of the container that contains bps of mfs or mfs itself, depending on which will be open when you start the script.


if WINDOW_INDEX == nil then
    WINDOW_INDEX = BP_MF
end

if LAST_BP_INDEX == nil then
    LAST_BP_INDEX = -1
end

if itemcount('mana fluid', WINDOW_INDEX) == 0 and windowcount(WINDOW_INDEX) > 0 then

    if itemcount('vial', WINDOW_INDEX) > 0 then
        higherwindow(WINDOW_INDEX)
        wait(800, 1200)
    end

    local container = getcontainer(WINDOW_INDEX)
    if container ~= nil and container.usedslots > 0 then
        local flag = false
        for _, item in ipairs(container.items) do
            if item.index > LAST_BP_INDEX and itemhasflags(item.id, 4)then
                openitemslot(item.index, container.index)
                wait(800, 1200)
                if itemcount('mana fluid', container.index) == 0 then
                    higherwindow(container.index)
                    wait(800, 1200)
                else
                   LAST_BP_INDEX = item.index
                    flag = true
                    break            
                end
            end
        end

        if not flag then
            playsound('default')
            flashclient()
            printerror('Could not find any bps to open. Maybe already tried to open all bps.')
            LAST_BP_INDEX = -1
        end
    end
end




This script will do the same, but it will try to guess what's the container that has the mfs/bps.

if LAST_BP_INDEX == nil then
    LAST_BP_INDEX = -1
end

if WINDOW_INDEX == nil then
    local containers = getcontainers()
    for _, cont in ipairs(containers) do
        if cont.usedslots > 0 then
            local countBp = 0
            local countVialMf = 0
            for __, item in ipairs(cont.items) do
                if item.id == 2874 then
                    countVialMf = countVialMf + 1
                elseif itemhasflags(item.id, 4) then
                    countBp = countBp + 1
                end
            end

            if countVialMf >= 10 or countBp >= 5 then
                WINDOW_INDEX = cont.index
                break
            end
        end
    end
end

if itemcount('mana fluid', WINDOW_INDEX) == 0 and windowcount(WINDOW_INDEX) > 0 then

    if itemcount('vial', WINDOW_INDEX) > 0 then
        higherwindow(WINDOW_INDEX)
        wait(800, 1200)
    end

    local container = getcontainer(WINDOW_INDEX)
    if container ~= nil and container.usedslots > 0 then
        local flag = false
        for _, item in ipairs(container.items) do
            if item.index > LAST_BP_INDEX and itemhasflags(item.id, 4) then
                openitemslot(item.index, container.index)
                wait(800, 1200)
                if itemcount('mana fluid', container.index) == 0 then
                    higherwindow(container.index)
                    wait(800, 1200)
                else
                   LAST_BP_INDEX = item.index
                    flag = true
                    break            
                end
            end
        end

        if not flag then
            playsound('default')
            flashclient()
            printerror('Could not find any bps to open. Maybe already tried to open all bps.')
            LAST_BP_INDEX = -1
        end
    end
end


If the server you play don't have empty vials then use script below!
local BP_MF = 'red backpack' -- Name, id or index of the container that contains bps of mfs or mfs itself, depending on which will be open when you start the script.


if WINDOW_INDEX == nil then
    WINDOW_INDEX = BP_MF
end

if LAST_BP_INDEX == nil then
    LAST_BP_INDEX = -1
end

if itemcount('mana fluid', WINDOW_INDEX) == 0 and windowcount(WINDOW_INDEX) > 0 then
    local container = getcontainer(WINDOW_INDEX)
    if container ~= nil then
        if container.usedslots == 0 then
            higherwindow(WINDOW_INDEX)
            wait(800, 1200)
        else
            local flag = false
            for _, item in ipairs(container.items) do
                if item.index > LAST_BP_INDEX and itemhasflags(item.id, 4) then
                    openitemslot(item.index, container.index)
                    wait(800, 1200)
                    if itemcount('mana fluid', container.index) == 0 then
                        higherwindow(container.index)
                        wait(800, 1200)
                    else
                       LAST_BP_INDEX = item.index
                        flag = true
                        break            
                    end
                end
            end

            if not flag then
                playsound('default')
                flashclient()
                printerror('Could not find any bps to open. Maybe already tried to open all bps.')
                LAST_BP_INDEX = -1
            end
        end
    end
end

This script will do the same, but it will try to guess what's the container that has the mfs/bps.
if LAST_BP_INDEX == nil then
    LAST_BP_INDEX = -1
end

if WINDOW_INDEX == nil then
    local containers = getcontainers()
    for _, cont in ipairs(containers) do
        if cont.usedslots > 0 then
            local countBp = 0
            local countVialMf = 0
            for __, item in ipairs(cont.items) do
                if item.id == 2874 then
                    countVialMf = countVialMf + 1
                elseif itemhasflags(item.id, 4) then
                    countBp = countBp + 1
                end
            end

            if countVialMf >= 10 or countBp >= 5 then
                WINDOW_INDEX = cont.index
                break
            end
        end
    end
end

if itemcount('mana fluid', WINDOW_INDEX) == 0 and windowcount(WINDOW_INDEX) > 0 then
    local container = getcontainer(WINDOW_INDEX)
    if container ~= nil then
        if container.usedslots == 0 then
            higherwindow(WINDOW_INDEX)
            wait(800, 1200)
        else
            local flag = false
            for _, item in ipairs(container.items) do
                if item.index > LAST_BP_INDEX and itemhasflags(item.id, 4) then
                    openitemslot(item.index, container.index)
                    wait(800, 1200)
                    if itemcount('mana fluid', container.index) == 0 then
                        higherwindow(container.index)
                        wait(800, 1200)
                    else
                       LAST_BP_INDEX = item.index
                        flag = true
                        break            
                    end
                end
            end

            if not flag then
                playsound('default')
                flashclient()
                printerror('Could not find any bps to open. Maybe already tried to open all bps.')
                LAST_BP_INDEX = -1
            end
        end
    end
end
Reply

#3
05:51:33 - LUA Script -> Persistent02: 31: global 'higherwindows' is not callable (a nil value
Reply

#4
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Edited, try again.
Reply

#5
|Only Registered members can see download links. | Click here to buy subscription or here to register.
It opens the next bp that contains 20, but it doesn't end up opening any of the ones that it has inside with more mana
Reply

#6
This script works only with a BP that has 20 bps inside, each bp with mana fluids.
Reply

#7
ahhh okay!! and there is no possibility that I return to the main one to open another 20?
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016