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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FREE Bed mage
#1
Hello.

About the script
This script will do the following:
  1. Connect on characters from time to time.
  2. Check if it has mana to make runes. If it has mana to make runes then reach blanks bps (a backpack with 20 bps with blank runes), search for a blank rune, move to your hand and cast spell. It will keep making runes until you don't have enough mana.
  3. Reach food sqm, eat food.
  4. Reach bed sqm, sleep.
  5. It will play alerts when no more blanks.
This script should be used when you wanna keep blank runes and made runes on floor. If you wanna keep runes on your character then check the script on post below!

How to setup:
Bed location should be the exactly sqm where it should use the bed to sleep.
Blanks location should be the exactly sqm where the bps with bps of blanks are. Warning: It should be a backpack with more 20 bps inside with blank runes.
Made runes will be moved back to same bp than blank rune was, obviously.
Food location should be the exactly sqm where foods are. You can leave it on floor or inside a backpack, you can setup it on script.
Bed time is the time that character should sleep, that depends on you, food (because each food heals for a specific time!) and server, because heal time may change from server to server.
NoRunes are options on what to do when no more blank runes available for that specific character.

local Characters = {{
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Maker 1", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Blanks = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {
        Hand = "lhand",
        Mana = 300,
        Spell = "adori vita vis"
    }, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}, {
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Makers'name 2", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Blanks = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {
        Hand = "lhand",
        Mana = 300,
        Spell = "adori vita vis"
    }, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}, {
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Makers'name 3", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Blanks = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {
        Hand = "lhand",
        Mana = 300,
        Spell = "adori vita vis"
    }, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}}
local LOG_CONSOLE = true -- Print the character's next check time on console? It will print: "CHARACTER's next check in X seconds.".

--[[                  DON'T EDIT BELOW THIS LINE                    --]]
--[[                Bed mage script 0.1 by Arkilys                  --]]
--[[                  
|Only Registered members can see download links. | Click here to buy subscription or here to register.
/> --[[                  DON'T EDIT BELOW THIS LINE                    --]]
LAST_BP = LAST_BP or {}
NEXT_CHECK = NEXT_CHECK or {}
CHARACTERS_IGNORED = CHARACTERS_IGNORED or {}

if findopenedcontainer == nil then
    function findopenedcontainer(lastContainers, currentContainers, openedContainerId)
        if currentContainers == nil then
            currentContainers = getcontainers()
        end
        if openedContainerId == nil then
            openedContainerId = -1
        end

        for _, current in ipairs(currentContainers) do
            local found = false
            for __, last in ipairs(lastContainers) do
                if last.index == current.index then
                    found = true
                    break
                end
            end
            if found == false and (openedContainerId <= 0 or openedContainerId == current.id) then
                return current
            end
        end
        return nil
    end
end

if opencontainer == nil then
    function opencontainer(id, from, newWindow, tries)
        if newWindow == nil then
            newWindow = false
        end
        if tries == nil then
            tries = 3
        end

        local containersBefore = getcontainers()

        local openedContainer = nil
        for j = 1, tries do
            openitem(id, from, newWindow)
            wait(800, 1200)
            local containersCurrent = getcontainers()
            openedContainer = findopenedcontainer(containersBefore, containersCurrent, id)
            if openedContainer ~= nil and openedContainer.index >= 0 then
                break
            end
            containersBefore = containersCurrent
        end
        return openedContainer
    end
end

for i = 1, #Characters do
    local maker = Characters[i]
    local checkCharacter = false
    if NEXT_CHECK[maker.Name] == nil then
        checkCharacter = true
    else
        if runningtime() >= NEXT_CHECK[maker.Name] then
            checkCharacter = true
        end
    end

    if CHARACTERS_IGNORED[maker.Name] ~= nil then
        checkCharacter = false
    end

    if checkCharacter then
        if connected() then
            if name():lower() ~= maker.Name:lower() then
                logout()
                wait(1000)
            else
                closewindows()
                wait(1000)
            end
        end

        if not connected() then
            connect(maker.Account, maker.Password, maker.Name)
            wait(800)
        end

        if connected() then
            if mp() >= maker.Rune.Mana then
                for j = 1, 3 do
                    reachlocation(maker.Blanks.X, maker.Blanks.Y, maker.Blanks.Z, false)
                    wait(1000)
                    mainBP = opencontainer(0, ground(maker.Blanks.X, maker.Blanks.Y, maker.Blanks.Z), true, 3)
                    if mainBP ~= nil and mainBP.index >= 0 then
                        break
                    end
                end

                if mainBP ~= nil and mainBP.index >= 0 then
                    if LAST_BP[maker.Name] == nil then
                        LAST_BP[maker.Name] = 0
                    end

                    local lastBP = LAST_BP[maker.Name]

                    local bpsSlots = {}
                    for j = 1, mainBP.usedslots do
                        local bpItem = mainBP.items[j]
                        if itemhasflags(bpItem.id, 4) then
                            table.insert(bpsSlots, bpItem.index)
                        end
                    end

                    for j = 1, #bpsSlots do
                        local bpSlot = bpsSlots[j]
                        if bpSlot >= lastBP then
                            local containersBefore = getcontainers()
                            local blanksContainer = nil
                            for k = 1, 3 do
                                openitemslot(bpSlot, mainBP.index, true)
                                wait(800, 1200)
                                local containersCurrent = getcontainers()
                                blanksContainer = findopenedcontainer(containersBefore, containersCurrent,
                                    mainBP.items[j].id)
                                if blanksContainer ~= nil and blanksContainer.index >= 0 then
                                    break
                                end
                                containersBefore = containersCurrent
                            end

                            if blanksContainer ~= nil then
                                local manaBreak = false
                                local blank_rune_id = itemid("blank rune")
                                while itemcount(blank_rune_id, blanksContainer.index) > 0 do
                                    moveitems(blank_rune_id, maker.Rune.Hand, blanksContainer.index, 0)
                                    wait(800)

                                    local handRune = {
                                        id = 0,
                                        count = 0
                                    }
                                    local isLefthand = false
                                    if maker.Rune.Hand:lower() == "lhand" then
                                        isLefthand = true
                                        handRune = lhand()
                                    else
                                        handRune = rhand()
                                    end
                                    while handRune.id == blank_rune_id do
                                        cast(maker.Rune.Spell)
                                        wait(1000)
                                        if isLefthand then
                                            handRune = lhand()
                                        else
                                            handRune = rhand()
                                        end
                                    end

                                    moveitems(handRune.id, blanksContainer.index, maker.Rune.Hand, 0)
                                    wait(800)

                                    LAST_BP[maker.Name] = bpSlot

                                    if mp() < maker.Rune.Mana then
                                        manaBreak = true
                                        break
                                    end
                                end
                                if manaBreak == false then
                                    closewindow(blanksContainer.index)
                                    wait(500)
                                    if bpSlot == #bpsSlots then
                                        if maker.OnFail.PLAY_ALERT then
                                            playsound("default")
                                        end
                                        if maker.OnFail.IGNORE_CHARACTER then
                                            CHARACTERS_IGNORED[maker.Name] = true
                                        end
                                        LAST_BP[maker.Name] = 0
                                    end
                                else
                                    break
                                end
                            end
                        end
                    end
                else
                    if maker.OnFail.PLAY_ALERT then
                        playsound("default")
                    end
                    if maker.OnFail.IGNORE_CHARACTER then
                        CHARACTERS_IGNORED[maker.Name] = true
                    end
                    if maker.TalkIfBpNotFound.Enabled then
                        local message = maker.TalkIfBpNotFound.Messages[random(1, #maker.TalkIfBpNotFound.Messages)]
                        if message ~= nil and message ~= '' then
                            say(message)
                        end
                    end
                end
            end

            if posz() == maker.Food.Z then
                local foodBpFound = false
                for j = 1, 3 do
                    if reachlocation(maker.Food.X, maker.Food.Y, maker.Food.Z, false) then
                        wait(1000)
                        if maker.Food.InsideContainer then
                            local foodContainer = opencontainer(0, ground(maker.Food.X, maker.Food.Y, maker.Food.Z),
                                true)
                            if foodContainer ~= nil then
                                eatfood(random(20, 30))
                                foodBpFound = true
                                break
                            end
                        else
                            foodBpFound = true
                            for k = 1, random(20, 30) do
                                useitem(0, maker.Food.X, maker.Food.Y, maker.Food.Z)
                                wait(400)
                                local status_msg = statusmessage()
                                if status_msg ~= nil and status_msg == "You are full." then
                                    break
                                end
                            end
                            break
                        end
                    end
                end
                if foodBpFound == false then
                    if maker.OnFail.PLAY_ALERT then
                        playsound("default")
                    end
                    if maker.OnFail.IGNORE_CHARACTER then
                        CHARACTERS_IGNORED[maker.Name] = true
                    end
                    if maker.TalkIfBpNotFound.Enabled then
                        local message = maker.TalkIfBpNotFound.Messages[random(1, #maker.TalkIfBpNotFound.Messages)]
                        if message ~= nil and message ~= '' then
                            say(message)
                        end
                    end
                end
            end

            if posz() == maker.Bed.Z then
                for j = 1, 3 do
                    reachlocation(maker.Bed.X, maker.Bed.Y, maker.Bed.Z, false)
                    wait(1000)
                    useitem(0, maker.Bed.X, maker.Bed.Y, maker.Bed.Z)
                    wait(400)
                    if not connected() then
                        break
                    end
                end
            else
                print(maker.Name .. " is on a different Z position than bed, so just logouted.")
                playsound("default")
                flashclient()
                logout()
            end

            local nextTime = random(maker.BedTime.Min, maker.BedTime.Max)
            NEXT_CHECK[maker.Name] = runningtime() + nextTime

            if LOG_CONSOLE then
                print(maker.Name .. "'s next check in", nextTime, "seconds.")
            end
        end
    end
end
[spoiler]Old code...
local Characters = {
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Maker 1", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 2", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 3", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  }
}
local LOG_CONSOLE = true -- Print the character's next check time on console? It will print: "CHARACTER's next check in X seconds.".

--[[                  DON'T EDIT BELOW THIS LINE                    --]]
--[[                Bed mage script 0.1 by Arkilys                  --]]
--[[                 
|Only Registered members can see download links. | Click here to buy subscription or here to register.
                  --]]
--[[ __________           .___    _____                             --]]
--[[ \______   \ ____   __| _/   /     \ _____     ____   ____      --]]
--[[  |    |  _// __ \ / __ |   /  \ /  \\__  \   / ___\_/ __ \     --]]
--[[  |    |   \  ___// /_/ |  /    Y    \/ __ \_/ /_/  >  ___/     --]]
--[[  |______  /\___  >____ |  \____|__  (____  /\___  / \___  >    --]]
--[[         \/     \/     \/          \/     \//_____/      \/     --]]
--[[ ___.              _____         __           .__  .__          --]]
--[[ \_ |__ ___.__.   /  _  \_______|  | _____.__.|  | |__| ______  --]]
--[[  | __ <   |  |  /  /_\  \_  __ \  |/ <   |  ||  | |  |/  ___/  --]]
--[[  | \_\ \___  | /    |    \  | \/    < \___  ||  |_|  |\___ \   --]]
--[[  |___  / ____| \____|__  /__|  |__|_ \/ ____||____/__/____  >  --]]
--[[      \/\/              \/           \/\/                  \/   --]]
--[[                  DON'T EDIT BELOW THIS LINE                    --]]
LAST_BP = LAST_BP or {}
NEXT_CHECK = NEXT_CHECK or {}
CHARACTERS_IGNORED = CHARACTERS_IGNORED or {}

for i = 1, #Characters do
  local maker = Characters[i]
  local checkCharacter = false
  if NEXT_CHECK[maker.Name] == nil then
    checkCharacter = true
  else
    if runningtime() >= NEXT_CHECK[maker.Name] then
      checkCharacter = true
    end
  end

  if CHARACTERS_IGNORED[maker.Name] ~= nil then
    checkCharacter = false
  end

  if checkCharacter then
    if connected() then
      if name():lower() ~= maker.Name:lower() then
        logout()
        wait(1000)
      else
        closewindows()
        wait(1000)
      end
    end

    if not connected() then
      connect(maker.Account, maker.Password, maker.Name)
      wait(800)
    end

    if connected() then
      if mp() >= maker.Rune.Mana then
        local winCount = windowcount()
        for j = 1, 3 do
          reachlocation(maker.Blanks.X, maker.Blanks.Y, maker.Blanks.Z, false)
          wait(1000)
          openitem(0, ground(maker.Blanks.X, maker.Blanks.Y, maker.Blanks.Z), true)
          wait(1000)
          if windowcount() ~= winCount then
            break
          end
        end

        local mainBP = getcontainer(winCount)

        if mainBP.index >= 0 then
          if LAST_BP[maker.Name] == nil then
            LAST_BP[maker.Name] = 0
          end

          local lastBP = LAST_BP[maker.Name]

          local bpsSlots = {}
          for j = 1, mainBP.usedslots do
            local bpItem = mainBP.items[j]
            if itemhasflags(bpItem.id, 4) then
              table.insert(bpsSlots, bpItem.index)
            end
          end

          for j = 1, #bpsSlots do
            local bpSlot = bpsSlots[j]
            if bpSlot >= lastBP then
              local winCount = windowcount()
              for x = 1, 3 do
                openitemslot(bpSlot, mainBP.index, true)
                wait(1000)
                if windowcount() ~= winCount then
                  break
                end
              end

              local manaBreak = false
              local blank_rune_id = itemid("blank rune")
              while itemcount(blank_rune_id, (mainBP.index + 1)) > 0 do
                moveitems(blank_rune_id, maker.Rune.Hand, (mainBP.index + 1), 0)
                wait(800)

                local handRune = {id = 0, count = 0}
                local isLefthand = false
                if maker.Rune.Hand:lower() == "lhand" then
                  isLefthand = true
                  handRune = lhand()
                else
                  handRune = rhand()
                end
                while handRune.id == blank_rune_id do
                  cast(maker.Rune.Spell)
                  wait(1000)
                  if isLefthand then
                    handRune = lhand()
                  else
                    handRune = rhand()
                  end
                end

                moveitems(handRune.id, (mainBP.index + 1), maker.Rune.Hand, 0)
                wait(800)

                LAST_BP[maker.Name] = bpSlot

                if mp() < maker.Rune.Mana then
                  manaBreak = true
                  break
                end
              end

              if manaBreak == false then
                closewindow((mainBP.index + 1))
                wait(500)
                if bpSlot == #bpsSlots then
                  if maker.NoRunes.PLAY_ALERT then
                    playsound("default")
                  end
                  if maker.NoRunes.IGNORE_CHARACTER then
                    CHARACTERS_IGNORED[maker.Name] = true
                  end
                  LAST_BP[maker.Name] = 0
                end
              else
                break
              end
            end
          end
        end
      end

      if posz() == maker.Food.Z then
        for j = 1, 3 do
          if reachlocation(maker.Food.X, maker.Food.Y, maker.Food.Z, false) then
            wait(1000)
            if maker.Food.InsideContainer then
              local winCount = windowcount()
              for k = 1, 3 do
                openitem(0, ground(maker.Food.X, maker.Food.Y, maker.Food.Z), true)
                wait(1000)
                if windowcount() ~= winCount then
                  break
                end
              end
              eatfood(random(20, 30))
            else
              for k = 1, random(20, 30) do
                useitem(0, maker.Food.X, maker.Food.Y, maker.Food.Z)
                wait(400)
                local status_msg = statusmessage()
                if status_msg ~= nil and status_msg == "You are full." then
                  break
                end
              end
            end
          end
        end
      end

      if posz() == maker.Bed.Z then
        for j = 1, 3 do
          reachlocation(maker.Bed.X, maker.Bed.Y, maker.Bed.Z, false)
          wait(1000)
          useitem(0, maker.Bed.X, maker.Bed.Y, maker.Bed.Z)
          wait(400)
          if not connected() then
            break
          end
        end
      else
        print(maker.Name .. " is on a different Z position than bed, so just logouted.")
        playsound("default")
        flashclient()
        logout()
      end

      local nextTime = random(maker.BedTime.Min, maker.BedTime.Max)
      NEXT_CHECK[maker.Name] = runningtime() + nextTime

      if LOG_CONSOLE then
        print(maker.Name .. "'s next check in", nextTime, "seconds.")
      end
    end
  end
end
[/spoiler]

keywords: bedmage, bed mage, rune bed, rune house, bed making
Reply

#2
This script is also a bedmage script, however, it should be used for who wants to keep blank runes on the character, not on floor.
local MoveBlanksToHand = false
local Characters = {{
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Maker 1", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Blanks = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {
        Hand = "lhand",
        Mana = 300,
        Spell = "adori vita vis"
    }, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}, {
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Makers'name 2", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Blanks = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {
        Hand = "lhand",
        Mana = 300,
        Spell = "adori vita vis"
    }, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}, {
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Makers'name 3", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Blanks = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {
        Hand = "lhand",
        Mana = 300,
        Spell = "adori vita vis"
    }, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}}
local LOG_CONSOLE = true -- Print the character's next check time on console? It will print: "CHARACTER's next check in X seconds.".

--[[                  DON'T EDIT BELOW THIS LINE                    --]]
--[[                Bed mage script 0.1 by Arkilys                  --]]
--[[                  
|Only Registered members can see download links. | Click here to buy subscription or here to register.
/> --[[                  DON'T EDIT BELOW THIS LINE                    --]]
LAST_BP = LAST_BP or {}
NEXT_CHECK = NEXT_CHECK or {}
CHARACTERS_IGNORED = CHARACTERS_IGNORED or {}

if findopenedcontainer == nil then
    function findopenedcontainer(lastContainers, currentContainers, openedContainerId)
        if currentContainers == nil then
            currentContainers = getcontainers()
        end
        if openedContainerId == nil then
            openedContainerId = -1
        end

        for _, current in ipairs(currentContainers) do
            local found = false
            for __, last in ipairs(lastContainers) do
                if last.index == current.index then
                    found = true
                    break
                end
            end
            if found == false and (openedContainerId <= 0 or openedContainerId == current.id) then
                return current
            end
        end
        return nil
    end
end

if opencontainer == nil then
    function opencontainer(id, from, newWindow, tries)
        if newWindow == nil then
            newWindow = false
        end
        if tries == nil then
            tries = 3
        end

        local containersBefore = getcontainers()

        local openedContainer = nil
        for j = 1, tries do
            openitem(id, from, newWindow)
            wait(800, 1200)
            local containersCurrent = getcontainers()
            openedContainer = findopenedcontainer(containersBefore, containersCurrent, id)
            if openedContainer ~= nil and openedContainer.index >= 0 then
                break
            end
            containersBefore = containersCurrent
        end
        return openedContainer
    end
end

for i = 1, #Characters do
    local maker = Characters[i]
    local checkCharacter = false
    if NEXT_CHECK[maker.Name] == nil then
        checkCharacter = true
    else
        if runningtime() >= NEXT_CHECK[maker.Name] then
            checkCharacter = true
        end
    end

    if CHARACTERS_IGNORED[maker.Name] ~= nil then
        checkCharacter = false
    end

    if checkCharacter then
        if connected() then
            if name():lower() ~= maker.Name:lower() then
                logout()
                wait(1000)
            else
                closewindows()
                wait(1000)
            end
        end

        if not connected() then
            connect(maker.Account, maker.Password, maker.Name)
            wait(800)
        end

        if connected() then
            if mp() >= maker.Rune.Mana then
                local mainBP = nil
                if windowcount() == 0 then
                    local backItem = back()
                    if backItem.id > 0 then
                        mainBP = opencontainer(backItem.id, 'back', false, 3)
                    end
                else
                    mainBP = getcontainers()[1]
                end

                if mainBP ~= nil and mainBP.index >= 0 then
                    if LAST_BP[maker.Name] == nil then
                        LAST_BP[maker.Name] = 0
                    end

                    local lastBP = LAST_BP[maker.Name]

                    local bpsSlots = {}
                    for j = 1, mainBP.usedslots do
                        local bpItem = mainBP.items[j]
                        if itemhasflags(bpItem.id, 4) then
                            table.insert(bpsSlots, bpItem.index)
                        end
                    end

                    for j = 1, #bpsSlots do
                        local bpSlot = bpsSlots[j]
                        if bpSlot >= lastBP then
                            local containersBefore = getcontainers()
                            local blanksContainer = nil
                            for k = 1, 3 do
                                openitemslot(bpSlot, mainBP.index, true)
                                wait(800, 1200)
                                local containersCurrent = getcontainers()
                                blanksContainer = findopenedcontainer(containersBefore, containersCurrent,
                                    mainBP.items[j].id)
                                if blanksContainer ~= nil and blanksContainer.index >= 0 then
                                    break
                                end
                                containersBefore = containersCurrent
                            end

                            if blanksContainer ~= nil then
                                local manaBreak = false
                                local blank_rune_id = itemid("blank rune")
                                while itemcount(blank_rune_id, blanksContainer.index) > 0 do
                                    if MoveBlanksToHand then
                                        moveitems(blank_rune_id, maker.Rune.Hand, blanksContainer.index, 0)
                                        wait(800)

                                        local handRune = {
                                            id = 0,
                                            count = 0
                                        }
                                        local isLefthand = false
                                        if maker.Rune.Hand:lower() == "lhand" then
                                            isLefthand = true
                                            handRune = lhand()
                                        else
                                            handRune = rhand()
                                        end
                                        while handRune.id == blank_rune_id do
                                            cast(maker.Rune.Spell)
                                            wait(1000)
                                            if isLefthand then
                                                handRune = lhand()
                                            else
                                                handRune = rhand()
                                            end
                                        end

                                        moveitems(handRune.id, blanksContainer.index, maker.Rune.Hand, 0)
                                        wait(800)
                                    else
                                        cast(maker.Rune.Spell)
                                        wait(1000)
                                    end

                                    LAST_BP[maker.Name] = bpSlot

                                    if mp() < maker.Rune.Mana then
                                        manaBreak = true
                                        break
                                    end
                                end
                                if manaBreak == false then
                                    closewindow(blanksContainer.index)
                                    wait(500)
                                    if bpSlot == #bpsSlots then
                                        if maker.OnFail.PLAY_ALERT then
                                            playsound("default")
                                        end
                                        if maker.OnFail.IGNORE_CHARACTER then
                                            CHARACTERS_IGNORED[maker.Name] = true
                                        end
                                        LAST_BP[maker.Name] = 0
                                    end
                                else
                                    break
                                end
                            end
                        end
                    end
                else
                    if maker.OnFail.PLAY_ALERT then
                        playsound("default")
                    end
                    if maker.OnFail.IGNORE_CHARACTER then
                        CHARACTERS_IGNORED[maker.Name] = true
                    end
                    if maker.TalkIfBpNotFound.Enabled then
                        local message = maker.TalkIfBpNotFound.Messages[random(1, #maker.TalkIfBpNotFound.Messages)]
                        if message ~= nil and message ~= '' then
                            say(message)
                        end
                    end
                end
            end

            if posz() == maker.Food.Z then
                local foodBpFound = false
                for j = 1, 3 do
                    if reachlocation(maker.Food.X, maker.Food.Y, maker.Food.Z, false) then
                        wait(1000)
                        if maker.Food.InsideContainer then
                            local foodContainer = opencontainer(0, ground(maker.Food.X, maker.Food.Y, maker.Food.Z),
                                true)
                            if foodContainer ~= nil then
                                eatfood(random(20, 30))
                                foodBpFound = true
                                break
                            end
                        else
                            foodBpFound = true
                            for k = 1, random(20, 30) do
                                useitem(0, maker.Food.X, maker.Food.Y, maker.Food.Z)
                                wait(400)
                                local status_msg = statusmessage()
                                if status_msg ~= nil and status_msg == "You are full." then
                                    break
                                end
                            end
                            break
                        end
                    end
                end
                if foodBpFound == false then
                    if maker.OnFail.PLAY_ALERT then
                        playsound("default")
                    end
                    if maker.OnFail.IGNORE_CHARACTER then
                        CHARACTERS_IGNORED[maker.Name] = true
                    end
                    if maker.TalkIfBpNotFound.Enabled then
                        local message = maker.TalkIfBpNotFound.Messages[random(1, #maker.TalkIfBpNotFound.Messages)]
                        if message ~= nil and message ~= '' then
                            say(message)
                        end
                    end
                end
            end

            if posz() == maker.Bed.Z then
                for j = 1, 3 do
                    reachlocation(maker.Bed.X, maker.Bed.Y, maker.Bed.Z, false)
                    wait(1000)
                    useitem(0, maker.Bed.X, maker.Bed.Y, maker.Bed.Z)
                    wait(400)
                    if not connected() then
                        break
                    end
                end
            else
                print(maker.Name .. " is on a different Z position than bed, so just logouted.")
                playsound("default")
                flashclient()
                logout()
            end

            local nextTime = random(maker.BedTime.Min, maker.BedTime.Max)
            NEXT_CHECK[maker.Name] = runningtime() + nextTime

            if LOG_CONSOLE then
                print(maker.Name .. "'s next check in", nextTime, "seconds.")
            end
        end
    end
end
[spoiler]
local MoveBlanksToHand = false
local Characters = {
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Maker 1", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 2", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 3", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  }
}
local LOG_CONSOLE = true -- Print the character's next check time on console? It will print: "CHARACTER's next check in X seconds.".

--[[                  DON'T EDIT BELOW THIS LINE                    --]]
--[[                Bed mage script 0.1 by Arkilys                  --]]
--[[                  
|Only Registered members can see download links. | Click here to buy subscription or here to register.
/> --[[                  DON'T EDIT BELOW THIS LINE                    --]]
LAST_BP = LAST_BP or {}
NEXT_CHECK = NEXT_CHECK or {}
CHARACTERS_IGNORED = CHARACTERS_IGNORED or {}

for i = 1, #Characters do
  local maker = Characters[i]
  local checkCharacter = false
  if NEXT_CHECK[maker.Name] == nil then
    checkCharacter = true
  else
    if runningtime() >= NEXT_CHECK[maker.Name] then
      checkCharacter = true
    end
  end

  if CHARACTERS_IGNORED[maker.Name] ~= nil then
    checkCharacter = false
  end

  if checkCharacter then
    if connected() then
      if name():lower() ~= maker.Name:lower() then
        logout()
        wait(1000)
      else
        closewindows()
        wait(1000)
      end
    end

    if not connected() then
      connect(maker.Account, maker.Password, maker.Name)
      wait(800)
    end

    if connected() then
      if mp() >= maker.Rune.Mana then
        local winCount = windowcount()
        if winCount == 0 then
          for j = 1, 3 do
            openitem(back().id, "back")
            wait(1000)
            if windowcount() ~= winCount then
              break
            end
          end
        end

        local mainBP = getcontainer(winCount)

        if mainBP.index >= 0 then
          if LAST_BP[maker.Name] == nil then
            LAST_BP[maker.Name] = 0
          end

          local lastBP = LAST_BP[maker.Name]

          local bpsSlots = {}
          for j = 1, mainBP.usedslots do
            local bpItem = mainBP.items[j]
            if itemhasflags(bpItem.id, 4) then
              table.insert(bpsSlots, bpItem.index)
            end
          end

          for j = 1, #bpsSlots do
            local bpSlot = bpsSlots[j]
            if bpSlot >= lastBP then
              local winCount = windowcount()
              for x = 1, 3 do
                openitemslot(bpSlot, mainBP.index, true)
                wait(1000)
                if windowcount() ~= winCount then
                  break
                end
              end

              local manaBreak = false
              local blank_rune_id = itemid("blank rune")
              while itemcount(blank_rune_id, (mainBP.index + 1)) > 0 do
                if MoveBlanksToHand then
                  moveitems(blank_rune_id, maker.Rune.Hand, (mainBP.index + 1), 0)
                  wait(800)

                  local handRune = {id = 0, count = 0}
                  local isLefthand = false
                  if maker.Rune.Hand:lower() == "lhand" then
                    isLefthand = true
                    handRune = lhand()
                  else
                    handRune = rhand()
                  end
                  while handRune.id == blank_rune_id do
                    cast(maker.Rune.Spell)
                    wait(1000)
                    if isLefthand then
                      handRune = lhand()
                    else
                      handRune = rhand()
                    end
                  end

                  moveitems(handRune.id, (mainBP.index + 1), maker.Rune.Hand, 0)
                  wait(800)
                else
                  cast(maker.Rune.Spell)
                  wait(1000)
                end

                LAST_BP[maker.Name] = bpSlot

                if mp() < maker.Rune.Mana then
                  manaBreak = true
                  break
                end
              end

              if manaBreak == false then
                closewindow((mainBP.index + 1))
                wait(500)
                if bpSlot == #bpsSlots then
                  if maker.NoRunes.PLAY_ALERT then
                    playsound("default")
                  end
                  if maker.NoRunes.IGNORE_CHARACTER then
                    CHARACTERS_IGNORED[maker.Name] = true
                  end
                  LAST_BP[maker.Name] = 0
                end
              else
                break
              end
            end
          end
        end
      end

      if posz() == maker.Food.Z then
        for j = 1, 3 do
          if reachlocation(maker.Food.X, maker.Food.Y, maker.Food.Z, false) then
            wait(1000)
            if maker.Food.InsideContainer then
              local winCount = windowcount()
              for k = 1, 3 do
                openitem(0, ground(maker.Food.X, maker.Food.Y, maker.Food.Z), true)
                wait(1000)
                if windowcount() ~= winCount then
                  break
                end
              end
              eatfood(random(20, 30))
            else
              for k = 1, random(20, 30) do
                useitem(0, maker.Food.X, maker.Food.Y, maker.Food.Z)
                wait(400)
                local status_msg = statusmessage()
                if status_msg ~= nil and status_msg == "You are full." then
                  break
                end
              end
            end
          end
        end
      end

      if posz() == maker.Bed.Z then
        for j = 1, 3 do
          reachlocation(maker.Bed.X, maker.Bed.Y, maker.Bed.Z, false)
          wait(1000)
          useitem(0, maker.Bed.X, maker.Bed.Y, maker.Bed.Z)
          wait(400)
          if not connected() then
            break
          end
        end
      else
        print(maker.Name .. " is on a different Z position than bed, so just logouted.")
        playsound("default")
        flashclient()
        logout()
      end

      local nextTime = random(maker.BedTime.Min, maker.BedTime.Max)
      NEXT_CHECK[maker.Name] = runningtime() + nextTime

      if LOG_CONSOLE then
        print(maker.Name .. "'s next check in", nextTime, "seconds.")
      end
    end
  end
end
[/spoiler]
Reply

#3
how to make this have more than 3 characters?
Reply

#4
Just add another by duplicating a characters entry.
Example:
local Characters = {
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Maker 1", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 2", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 3", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  }
}

to

local Characters = {
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Maker 1", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 2", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 3", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  },
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 3", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  }
}

Notice that i just added a "comma" and character entry.
,
  {
    Account = "123456", --Character's account
    Password = "mypass321", --Character's password
    Name = "Makers'name 3", --Character's name.
    Bed = {X = 12345, Y = 12345, Z = 5}, -- Bed's location where you gonna use to go sleep.
    Blanks = {X = 12345, Y = 12345, Z = 5}, -- Blank's backpack location. It must be 01 backpack with 20 blank runes backpacks inside.
    Rune = {Hand = "lhand", Mana = 300, Spell = "adori vita vis"}, -- Rune to make and hand. ALWAYS LEAVE THE HAND EMPTY!
    Food = {X = 12345, Y = 12345, Z = 5, InsideContainer = true}, --Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {Min = 300, Max = 400}, -- Time to wait between each 'sleep', in SECONDS.
    NoRunes = {PLAY_ALERT = true, IGNORE_CHARACTER = true}
  }
Reply

#5
Bedmage for Burst Arrows.
local Characters = {{
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Maker 1", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Ammo = {
        Mana = 480,
        Spell = 'exevo con flam',
        ItemId = 2546,
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Mana and spell to make the ammo. The ammo id and location with a bp to drop it.
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    NoSlots = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- What should do when you are out of available slots to drop ammo on a bp?
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- What script should do when script fails to open burst bp or food bp. This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}, {
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Maker 2", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Ammo = {
        Mana = 480,
        Spell = 'exevo con flam',
        ItemId = 2546,
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Mana and spell to make the ammo. The ammo id and location with a bp to drop it.
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    NoSlots = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- What should do when you are out of available slots to drop ammo on a bp?
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- What script should do when script fails to open burst bp or food bp. This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}, {
    Account = "123456", -- Character's account
    Password = "mypass321", -- Character's password
    Name = "Maker 3", -- Character's name.
    Bed = {
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Bed's location where you gonna use to go sleep.
    Ammo = {
        Mana = 480,
        Spell = 'exevo con flam',
        ItemId = 2546,
        X = 12345,
        Y = 12345,
        Z = 5
    }, -- Mana and spell to make the ammo. The ammo id and location with a bp to drop it.
    Food = {
        X = 12345,
        Y = 12345,
        Z = 5,
        InsideContainer = true
    }, -- Food's backpack location. You can leave a backpack with food inside or leave food on floor and set 'InsideContainer' as false.
    BedTime = {
        Min = 300,
        Max = 400
    }, -- Time to wait between each 'sleep', in SECONDS.
    NoSlots = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- What should do when you are out of available slots to drop ammo on a bp?
    OnFail = {
        PLAY_ALERT = true,
        IGNORE_CHARACTER = true
    }, -- What script should do when script fails to open burst bp or food bp. This option does not works for food when directly on floor.
    TalkIfBpNotFound = {
        Enabled = true,
        Messages = {'?', 'wtf', 'hello?'}
    }
}}
local LOG_CONSOLE = true -- Print the character's next check time on console? It will print: "CHARACTER's next check in X seconds.".

--[[                  DON'T EDIT BELOW THIS LINE                    --]]
--[[                Bed mage script 0.1 by Arkilys                  --]]
--[[                  
|Only Registered members can see download links. | Click here to buy subscription or here to register.
/> --[[                  DON'T EDIT BELOW THIS LINE                    --]]
LAST_BP = LAST_BP or {}
NEXT_CHECK = NEXT_CHECK or {}
CHARACTERS_IGNORED = CHARACTERS_IGNORED or {}

if findopenedcontainer == nil then
    function findopenedcontainer(lastContainers, currentContainers, openedContainerId)
        if currentContainers == nil then
            currentContainers = getcontainers()
        end
        if openedContainerId == nil then
            openedContainerId = -1
        end

        for _, current in ipairs(currentContainers) do
            local found = false
            for __, last in ipairs(lastContainers) do
                if last.index == current.index then
                    found = true
                    break
                end
            end
            if found == false and (openedContainerId <= 0 or openedContainerId == current.id) then
                return current
            end
        end
        return nil
    end
end

if opencontainer == nil then
    function opencontainer(id, from, newWindow, tries)
        if newWindow == nil then
            newWindow = false
        end
        if tries == nil then
            tries = 3
        end

        local containersBefore = getcontainers()

        local openedContainer = nil
        for j = 1, tries do
            openitem(id, from, newWindow)
            wait(800, 1200)
            local containersCurrent = getcontainers()
            openedContainer = findopenedcontainer(containersBefore, containersCurrent, id)
            if openedContainer ~= nil and openedContainer.index >= 0 then
                break
            end
            containersBefore = containersCurrent
        end
        return openedContainer
    end
end

if searchforitem == nil then
    function searchforitem(id)
        local slots = {'rhand', 'lhand', 'belt'}
        for _, slot in ipairs(slots) do
            local item = getequip(slot)
            if item ~= nil and item.id == id then
                return slot
            end
        end

        local containers = getcontainers()
        for _, cont in ipairs(containers) do
            for __, item in ipairs(cont.items) do
                if item ~= nil and item.id == id then
                    return cont.index
                end
            end
        end
        return nil
    end
end

for i = 1, #Characters do
    local maker = Characters[i]
    local checkCharacter = false
    if NEXT_CHECK[maker.Name] == nil then
        checkCharacter = true
    else
        if runningtime() >= NEXT_CHECK[maker.Name] then
            checkCharacter = true
        end
    end

    if CHARACTERS_IGNORED[maker.Name] ~= nil then
        checkCharacter = false
    end

    if checkCharacter then
        if connected() then
            if name():lower() ~= maker.Name:lower() then
                logout()
                wait(1000)
            else
                closewindows()
                wait(1000)
            end
        end

        if not connected() then
            connect(maker.Account, maker.Password, maker.Name)
            wait(800)
        end

        if connected() then
            if mp() >= maker.Ammo.Mana then
                for j = 1, 3 do
                    reachlocation(maker.Ammo.X, maker.Ammo.Y, maker.Ammo.Z, false)
                    wait(1000)
                    mainBP = opencontainer(0, ground(maker.Ammo.X, maker.Ammo.Y, maker.Ammo.Z), true, 3)
                    if mainBP ~= nil and mainBP.index >= 0 then
                        break
                    end
                end

                if mainBP ~= nil and mainBP.index >= 0 then
                    local lastCapacity = cap()
                    while mp() >= maker.Ammo.Mana do
                        if cancast() == false then
                            wait(2000)
                        end
                        if cast(maker.Ammo.Spell) then
                            wait(1000)
                            local curentCapacity = cap()
                            if curentCapacity ~= lastCapacity then
                                lastCapacity = curentCapacity
                                local itemLocation = searchforitem(maker.Ammo.ItemId)
                                while itemLocation ~= nil do
                                    if moveitems(maker.Ammo.ItemId, mainBP.index, itemLocation, 100) then
                                        wait(800)
                                        itemLocation = searchforitem(maker.Ammo.ItemId)
                                    else
                                        if maker.NoSlots.PLAY_ALERT then
                                            playsound("default")
                                        end
                                        if maker.NoSlots.IGNORE_CHARACTER then
                                            CHARACTERS_IGNORED[maker.Name] = true
                                        end
                                        break
                                    end
                                end
                            end
                        end
                    end
                else
                    if maker.OnFail.PLAY_ALERT then
                        playsound("default")
                    end
                    if maker.OnFail.IGNORE_CHARACTER then
                        CHARACTERS_IGNORED[maker.Name] = true
                    end
                    if maker.TalkIfBpNotFound.Enabled then
                        local message = maker.TalkIfBpNotFound.Messages[random(1, #maker.TalkIfBpNotFound.Messages)]
                        if message ~= nil and message ~= '' then
                            say(message)
                        end
                    end
                end
            end

            if posz() == maker.Food.Z then
                local foodBpFound = false
                for j = 1, 3 do
                    if reachlocation(maker.Food.X, maker.Food.Y, maker.Food.Z, false) then
                        wait(1000)
                        if maker.Food.InsideContainer then
                            local foodContainer = opencontainer(0, ground(maker.Food.X, maker.Food.Y, maker.Food.Z),
                                true)
                            if foodContainer ~= nil then
                                eatfood(random(20, 30))
                                foodBpFound = true
                                break
                            end
                        else
                            foodBpFound = true
                            for k = 1, random(20, 30) do
                                useitem(0, maker.Food.X, maker.Food.Y, maker.Food.Z)
                                wait(400)
                                local status_msg = statusmessage()
                                if status_msg ~= nil and status_msg == "You are full." then
                                    break
                                end
                            end
                            break
                        end
                    end
                end
                if foodBpFound == false then
                    if maker.OnFail.PLAY_ALERT then
                        playsound("default")
                    end
                    if maker.OnFail.IGNORE_CHARACTER then
                        CHARACTERS_IGNORED[maker.Name] = true
                    end
                    if maker.TalkIfBpNotFound.Enabled then
                        local message = maker.TalkIfBpNotFound.Messages[random(1, #maker.TalkIfBpNotFound.Messages)]
                        if message ~= nil and message ~= '' then
                            say(message)
                        end
                    end
                end
            end

            if posz() == maker.Bed.Z then
                for j = 1, 3 do
                    reachlocation(maker.Bed.X, maker.Bed.Y, maker.Bed.Z, false)
                    wait(1000)
                    useitem(0, maker.Bed.X, maker.Bed.Y, maker.Bed.Z)
                    wait(400)
                    if not connected() then
                        break
                    end
                end
            else
                print(maker.Name .. " is on a different Z position than bed, so just logouted.")
                playsound("default")
                flashclient()
                logout()
            end

            local nextTime = random(maker.BedTime.Min, maker.BedTime.Max)
            NEXT_CHECK[maker.Name] = runningtime() + nextTime

            if LOG_CONSOLE then
                print(maker.Name .. "'s next check in", nextTime, "seconds.")
            end
        end
    end
end
Reply

#6
Thanks but it doesnt work for me. Cant copy paste here idk why. But it says like this :
23:15:36 - LUA Script -> Persistent01:8:'}' expected (to close '{' at line 2)near 'ammo'
Reply

#7
The error above is due to some bad editing you made, because I just ran it and didn't returned any error.
Reply

#8
I tried just to start it with your settings and still get this error message, didnt change anything.
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Undecided" title="Undecided" class="smilie smilie_20" />
Reply

#9
You are probably copying something wrong... Try now, i just changed it, so it's easier to copy.
Reply

#10
If i have more characters and the character list needs to be scrolled down to login last character bot doesn't scroll the character list and logins character that is last visible in the list
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016