Hi any 1 can tell me how i switch weapon when loss durbality?
Dont want go to repair itp want only simple switch for another from backpack
Ty for all info
Switch
Re: Switch
Dracon wrote:Hi any 1 can tell me how i switch weapon when loss durbality?
Dont want go to repair itp want only simple switch for another from backpack
Ty for all info
Code: Select all
<onLeaveCombat>
local dura = inventory:getMainHandDurability();
printf("Durability:%s\n", dura);
if( dura < 0.9 ) then
inventory:useItem(itemNameOrId);
end
</onLeaveCombat>
The RoM Bot Online Wiki needs your help!
Re: Switch
Not work fine get this error
/scripts/rom/settings.lua:584: Failed to compile and run Lua code for onLeaveCombat in character profile
Any idea why?
/scripts/rom/settings.lua:584: Failed to compile and run Lua code for onLeaveCombat in character profile
Any idea why?
Re: Switch
No. But the chances are better if you post your profile / event.Dracon wrote:Not work fine get this error
/scripts/rom/settings.lua:584: Failed to compile and run Lua code for onLeaveCombat in character profile
Any idea why?
The RoM Bot Online Wiki needs your help!
Re: Switch
Code: Select all
<profile>
<options>
<option name="HP_LOW" value="85" />
<option name="MP_LOW_POTION" value="40" />
<option name="HP_LOW_POTION" value="55" />
<option name="COMBAT_TYPE" value="melee" />
<option name="COMBAT_DISTANCE" value="150" />
<option name="ANTI_KS" value="true" />
<option name="WAYPOINTS" value="ren.xml" />
<option name="LOOT" value="true" />
<option name="LOOT_TIME" value="800" />
<option name="ENERGY_STORAGE_1" value="rage" />
<option name="ENERGY_STORAGE_2" value="mana" />
<option name="POTION_COOLDOWN" value="15" />
<option name="MAX_FIGHT_TIME" value="30" />
<option name="DOT_PERCENT" value="40" />
<option name="COMBAT_RANGED_PULL" value="true" /> <!-- only important for melees -->
</options>
<friends>
<friend name="Ystra Ferret Cub" />
<friend name="MyOtherCharacter2" />
</friends>
<hotkeys>
<hotkey name="MACRO" key="VK_0" />
</hotkeys>
<skills>
<skill name="ROGUE_THROW" hotkey="VK_2" priority="110" pullonly="true" maxuse="1"/> <!-- throw then surprise -->
<skill name="WARRIOR_SLASH" hotkey="VK_3" modifier="" />
<skill name="WARRIOR_PROBING_ATTACK" hotkey="VK_4" modifier="" />
<skill name="WARRIOR_OPEN_FLANK" hotkey="VK_5" modifier="" />
<skill name="PRIEST_URGENT_HEAL" hotkey="VK_6" modifier="" />
</skills>
<onDeath>
-- Additional Lua code to execute on death
</onDeath>
<onLeaveCombat>
local dura = inventory:getMainHandDurability();
printf("Durability:%s\n", dura);
if( dura < 0.9 ) then
inventory:useItem(Folding-tooth Axe);
end
</onLeaveCombat>
<onSkillCast>
-- Additional Lua code to execute when casting a skill
-- Note: arg1 contains the skill being used.
-- i.e. arg1.Name will be the name of the skill being cast.
</onSkillCast>
</profile>
and i see this in setting meybe problem is here
onDeath = nil,
onLoad = nil,
onLeaveCombat = nil,
onSkillCast = nil,
onLevelup = nil,
EDIT: insert CODE tag (d003232)
Re: Switch
The item name is not a variable. So you need some quotation marks.
btw: pls use code tags for posting code.
Code: Select all
inventory:useItem("Folding-tooth Axe");
The RoM Bot Online Wiki needs your help!
Who is online
Users browsing this forum: No registered users and 3 guests