• 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!

Xenobot Manapercent Code

Mesut Ozil

New Member
Joined
Jul 8, 2016
Messages
27
Reaction score
0
hello maybe someone can help me to find this code

i have this script

local RingID = 3051 -- Ring ID.
local RingOLD = 12737 --The ID of the normal ring you wear.
local EquipHP = 70 -- Equip Ring at % Health.
local UnEquipHP = 90 -- Health % When you UnEquip The ring and put your other one back.


while (true) do
local creature = Creature.GetByID(Self.ID())
if ((creature:HealthPercent() <= EquipHP) and Self.Ring().id == RingOLD) then
Self.Equip(RingID, "ring")
sleep(math.random(300, 300))

elseif ((creature:HealthPercent() >= UnEquipHP)) then
Self.Equip(RingOLD, "ring")
sleep(math.random(200, 300))
end
end



example:
my character now using energy ring when health become 70% it will dequip energy ring and equip health ring and when it come 90% again it will dequip health ring and equip energy ring



the problem now that i need it work with my manapercent not health percent and i don't know manapercent code i changed it from creature:HealthPercent() to creature:ManaPercent() but it didn't work and i got debug message in xenobot ?


any help please?
 
This request/support question belongs on xenobot forums. There you'll be able to get more help with which functions to use and such.
 
No idea if this is going to work.
Pulling random shit out of the air and hoping it works.
Code:
local RingID = 3051 -- Ring ID.
local RingOLD = 12737 --The ID of the normal ring you wear.
local EquipMana = 70 -- Equip Ring at % Health.
local UnEquipMana = 90 -- Health % When you UnEquip The ring and put your other one back.
local manaPercent = math.floor(( Self.Mana() * 100 ) / Self.MaxMana())

while (true) do
    if ((manaPercent <= EquipMana) and Self.Ring().id == RingOLD) then
        Self.Equip(RingID, "ring")
        sleep(math.random(300, 300))
    elseif ((manaPercent >= UnEquipMana)) then
        Self.Equip(RingOLD, "ring")
        sleep(math.random(200, 300))
    end
end
 
No idea if this is going to work.
Pulling random shit out of the air and hoping it works.
Code:
local RingID = 3051 -- Ring ID.
local RingOLD = 12737 --The ID of the normal ring you wear.
local EquipMana = 70 -- Equip Ring at % Health.
local UnEquipMana = 90 -- Health % When you UnEquip The ring and put your other one back.
local manaPercent = math.floor(( Self.Mana() * 100 ) / Self.MaxMana())

while (true) do
    if ((manaPercent <= EquipMana) and Self.Ring().id == RingOLD) then
        Self.Equip(RingID, "ring")
        sleep(math.random(300, 300))
    elseif ((manaPercent >= UnEquipMana)) then
        Self.Equip(RingOLD, "ring")
        sleep(math.random(200, 300))
    end
end
no errors but it didn't work
 
changed it from hp to mp

try

Code:
local ring = 'energy ring'                     -- Name of the ring
local mpperc = {equip = 60, dequip = 90}       -- % HP to equip and % HP to dequip the ring.
local ringbp = "golden backpack"               -- Backpack it puts the ring into, when it's above dequip % HP.
 
Module.New('ring', function()
    local mana = Self.Mana() / Self.MaxMana() * 100
    local finger = Self.Ring().id
    local item = {normal = Item.GetID(ring), active = Item.GetRingActiveID(Item.GetID(ring))}
    if mana <= mpperc.equip then
        if finger ~= item.active then
            process = true
        end
    end
    if process then
        if finger ~= item.active then
            Self.Equip(item.normal, 'ring')
        else
            process = nil
        end
    end
    if mana >= mpperc.dequip then
            Self.Dequip('ring', ringbp)
    end
end)
 
Back
Top