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
Change Weapon If More Monsters
#1
hello,


I need simple script for training my knight.

If more then 3 monsters arround, then equip  skull staff and full attack, if 3<= then equip club and switch to full def.
Reply

#2
Hello.

I didn't tested it, but try this:
local MONSTERS = { 'Rat', 'Rotworm' } -- Monsters to count.
local TWO_HANDED_WEAPON = 'war hammer' -- Two handed weapon.
local ONE_HANDED_WEAPON = 'club' -- One handed weapon
local ONE_HANDED_SHIELD = 'dragon shield' -- Shield
local COUNT_EQUIP = 4 -- Count to equip two handed weapon.
local BP_WEAPONS = 'red backpack' -- BP that keep weapons and shield.



local TWO_HANDED_WEAPON_ID = itemid(TWO_HANDED_WEAPON)
local monstersCount = maround(MONSTERS)

local leftHandItem = lhand()
if monstersCount >= COUNT_EQUIP then
    local TWO_HANDED_WEAPON_ID = itemid(TWO_HANDED_WEAPON)
    if leftHandItem.id ~= TWO_HANDED_WEAPON_ID then
        local rightHandItem = rhand()
        if rightHandItem.id ~= 0 then
            moveitems(rightHandItem.id, BP_WEAPONS, 'rhand')
            wait(800, 1200)
            rightHandItem = rhand()
        end

        if leftHandItem.id == 0 and rightHandItem.id == 0 then
            moveitems(TWO_HANDED_WEAPON_ID, 'lhand', BP_WEAPONS)
            wait(800, 1200)
        end
    end

    if attackmode() ~= 1 then
        setattackmode('offensive')
    end
else
    local ONE_HANDED_WEAPON_ID = itemid(ONE_HANDED_WEAPON)
    local ONE_HANDED_SHIELD_ID = itemid(ONE_HANDED_SHIELD)

    if leftHandItem.id ~= ONE_HANDED_WEAPON_ID then
        moveitems(ONE_HANDED_WEAPON_ID, 'lhand', BP_WEAPONS)
        wait(800, 1200)
        leftHandItem = lhand()
    end

    if leftHandItem.id == ONE_HANDED_WEAPON_ID or leftHandItem.id == 0 then
        local rightHandItem = rhand()
        if rightHandItem.id ~= ONE_HANDED_SHIELD_ID then
            moveitems(ONE_HANDED_SHIELD_ID, 'rhand', BP_WEAPONS)
            wait(800, 1200)
        end
    end

    if attackmode() ~= 3 then
        setattackmode('defensive')
    end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016