Hi all, I tried to equip Spectral Bolt via scripting bot it doesn't work. Windbot version: 2.8.9
What I did:
_a) Inserted the following line on items.xml at the folder tibiadata: <item id="25758" name="spectral bolt" buyPrice="0" weight="0.9" attack="78"/> in the Ammunition section.
_b) Added spectral bolt as projectile in projectiles.xml (<item id="52" name="spectral bolt"/>)
_c) My script for changing bolts is the following:
Any insights? I know that the equipNewAmmo() function is being called because I debuged it using prints. Do I have to edit any other file in windbot folder to "register" the spectral bolt?Code:auto(800) local ChangeAmmo = true local CreateAmmo = true local BpOldAmmo = "glooth backpack" local OldAmmo = "power bolt" --3450 local BpNewAmmo = "glooth backpack" local NewAmmo = 25758 --id --> arrow (25757) bolt (25758) local Sections = {"Hunt"} --{"Hunt"} or {"Floor 1", "Floor 2"} local UseSections = false local ConsiderMonster = false local Monsters = {"Grim Reaper", "Undead Trainer"} local MonstersAround = 2 --=================================== local CheckMonster = getarearunetile(false, unpack(Monsters)) local function NewAmmoType() if NewAmmo == 25757 then newammo = 'exevo gran con hur' elseif NewAmmo == 25758 then newammo = 'exevo gran con vis' end return newammo end local function haveNewAmmo() return itemcount(NewAmmo, BpNewAmmo) > 0 end local function usingNewAmmo() return not (itemcount(NewAmmo, 'belt') <= 0) end local function Create() if CreateAmmo then if cancast(NewAmmoType()) and not $pzone then cast(NewAmmoType()) wait(300,500) end end end local function equipNewAmmo() equipitem(NewAmmo, 'belt', BpNewAmmo, 100) wait(300,500) end local function usingOldAmmo() return not (itemcount(OldAmmo, 'belt') <= 0) end local function equipOldAmmo() equipitem(OldAmmo, 'belt', BpOldAmmo) wait(300,500) end local function haveOldAmmo() return itemcount(OldAmmo, BpOldAmmo) > 0 end if $connected then if table.find(Sections, $wptsection) or not UseSections then if ChangeAmmo then if ConsiderMonster then if CheckMonster.amount >= MonstersAround then if haveNewAmmo() then if not usingNewAmmo() then equipNewAmmo() end elseif not haveNewAmmo() and itemcount(OldAmmo, BpOldAmmo) > 0 then if not usingOldAmmo() then equipOldAmmo() end end elseif CheckMonster.amount < MonstersAround and table.find(Monsters, $attacked.name) == 0 then if haveOldAmmo() then if not usingOldAmmo() then equipOldAmmo() end end end else if haveNewAmmo() then if not usingNewAmmo() then equipNewAmmo() end else Create() if haveNewAmmo() then if not usingNewAmmo() then equipNewAmmo() end elseif not usingOldAmmo() then equipOldAmmo() end end end end else if haveOldAmmo() then if not usingOldAmmo() then equipOldAmmo() end end end end