Insta-death with no debt script question
Posted: Thu Jul 28, 2011 11:03 pm
My L50 has been getting ganked by all the elites in Inferno Gardens in Xaviera. I wanted to add a check to see if the target is elite, and if elite, use the insta-death-with-no-debt script.
I have the following in the L50 profile
but I get the error
When I use
I do not get the error. Unfortunately, if I wait for the logout, my char is usually dead since the elites can hit for 5K+ so the char can be dead within 5-10 seconds before logout can complete.
What am I missing or have wrong in my insta-death-no-debt version? Thanks.
I have the following in the L50 profile
Code: Select all
<onSkillCast><![CDATA[
-- 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
-- e.g.:
--if( 15 > player.HP/player.MaxHP*100 ) then
-- player:cast("PRIEST_SOUL_SOURCE");
--elseif( 25 > player.HP/player.MaxHP*100 ) then
-- player:cast("PRIEST_HOLY_AURA");
-- player:cast("PRIEST_URGENT_HEAL");
-- player:cast("PRIEST_URGENT_HEAL");
if( target.HP == target.MaxHP and target.MaxHP > player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR ) then
RoMScript("SetCameraPosition (0,0,1000000)");
end;
]]></onSkillCast>Code: Select all
D:/micromacro/scripts/rom/classes/player.lua:669: onSkillCast error: [string "..
."]:13: attempt to index global 'target' (a nil value)Code: Select all
<onSkillCast><![CDATA[
-- 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
-- e.g.:
--if( 15 > player.HP/player.MaxHP*100 ) then
-- player:cast("PRIEST_SOUL_SOURCE");
--elseif( 25 > player.HP/player.MaxHP*100 ) then
-- player:cast("PRIEST_HOLY_AURA");
-- player:cast("PRIEST_URGENT_HEAL");
-- player:cast("PRIEST_URGENT_HEAL");
local target = player:getTarget();
if( target.HP == target.MaxHP and target.MaxHP > player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR ) then
player:logout();
end;
]]>
</onSkillCast>What am I missing or have wrong in my insta-death-no-debt version? Thanks.