Hello.
The Bot has no way of knowing it's a two handed weapon, because the game-client doesn't provides such information, it's server-side. I could specify the ids of every two handed item, but that wouldn't be a 100% solution, because there are custom items on the many servers that Kasteria OTBot works on. So I'm going to add a checkbox option in Runemaker for that.
For now, you can use this script. It's something I haven't tested, but I believe it will work.
local CONFIG = {
MANA_CONDITION = 'Mana above', -- Condition to mane runes: Mana above or Mana percent
MANA_RANGE = { Min = 300, Max = 400 }, -- Mana to make rune. Sorts a random value between this range to make rune.
RUNE_SPELL = 'adura vita',
HAND = 'lhand', -- use lhand for left hand and rhand for right hand.
WEAPON_BP = 'red backpack', -- If there is any item on specified hand then move to this container while making runes but move back to hand.
}
local ACTION_MAX_ATTEMPTS = 5
local BLANK_RUNE_ID = 3147
local currentValue = -1
if CONFIG.MANA_CONDITION:lower() == 'mana above' then
currentValue = mp()
else
currentValue = mppc()
end
if RUNE_MANA == nil then
RUNE_MANA = random(CONFIG.MANA_RANGE.Min, CONFIG.MANA_RANGE.Max)
end
if gethanditem == nil then
function gethanditem(hand)
if hand:lower() == 'lhand' then
return lhand()
else
return rhand()
end
end
end
if findblankrune == nil then
function findblankrune()
local containers = getcontainers()
for _, cont in ipairs(containers) do
for __, item in ipairs(cont.items) do
if item.id == BLANK_RUNE_ID then
return cont.index
end
end
end
return -1
end
end
if currentValue >= RUNE_MANA and cancast() then
local blankRuneLocation = findblankrune()
if blankRuneLocation == -1 then
printerror('Could not find a blank rune.')
playsound('default')
flashclient()
else
local itemHand = gethanditem(CONFIG.HAND)
MOVED_WEAPON_ID = 0
for i = 1, ACTION_MAX_ATTEMPTS do
if itemHand.id ~= 0 and itemHand.id ~= BLANK_RUNE_ID then
moveitems(itemHand.id, CONFIG.WEAPON_BP, CONFIG.HAND)
wait(500, 800)
MOVED_WEAPON_ID = itemHand.id
itemHand = gethanditem(CONFIG.HAND)
else
break
end
end
for i = 1, ACTION_MAX_ATTEMPTS do
if itemHand.id == 0 and blankRuneLocation >= 0 then
if moveitems(BLANK_RUNE_ID, CONFIG.HAND, blankRuneLocation, 1) then
wait(500, 800)
itemHand = gethanditem(CONFIG.HAND)
else
blankRuneLocation = findblankrune()
end
else
break
end
end
if itemHand.id == BLANK_RUNE_ID then
while cancast() == false do
wait(100)
end
cast(CONFIG.RUNE_SPELL)
wait(500, 800)
itemHand = gethanditem(CONFIG.HAND)
for i = 1, ACTION_MAX_ATTEMPTS do
if itemHand.id ~= 0 then
moveitems(itemHand.id, blankRuneLocation, CONFIG.HAND, 1)
wait(500, 800)
itemHand = gethanditem(CONFIG.HAND)
else
break
end
end
end
if MOVED_WEAPON_ID > 0 then
for i = 1, ACTION_MAX_ATTEMPTS do
if itemHand.id == 0 then
moveitems(MOVED_WEAPON_ID, CONFIG.HAND, CONFIG.WEAPON_BP)
wait(500, 800)
itemHand = gethanditem(CONFIG.HAND)
else
break
end
end
end
end
end