Mushroomstamp wrote:I'll try the lootall() command... does it not need a semicolon after it?
As far as I know the semicolon does nothing in LUA. I think people use it because they were used to using it in other languages and maybe because they think it reads better. I mostly never use it.
Mushroomstamp wrote:I hadn't thought about messing with the pause time but I will now.
I always thought 'rest' accepted seconds but it looks like it accepts ms. So 'rest(1)' only pauses for 1/1000th of a second. I think it needs to be bigger than that.
Mushroomstamp wrote:Although, I have a new problem. What's wrong with this code?
Code: Select all
player:findTarget("Androlier's Shadow");
local target = player:getTarget();
if(target.Name == "Androlier's Shadow") then
player:cast("WARRIOR_SURPRISE_ATTACK");
end
I found this in another thread but I get a "failure to compile lua code for waypoint" error. I'm trying to target Shadow & attack it. I also tried...
Code: Select all
player:target_NPC("Androlier's Shadow");
player:cast("WARRIOR_SURPRISE_ATTACK");
...which sorta worked, but it doesn't cast Surprise Attack... it calls it in the MM window, but it doesn't actually happen.
Maybe it doesn't like the appostrophe. Try "Androlier\'s Shadow" instead, for both issues.
Mushroomstamp wrote:Ranged pull and autouse for Surprise Attack at false wouldn't cause this right?
I don't think so.
Mushroomstamp wrote:I think that might work with some more testing, but I figured there would be a more appropriate command to target an enemy.
There is no specially designed function to target an enemy by name. target_NPC will target the mob but will also move in close and then effectively double click it and attack it. target_Object might not double click but it still moves in close. I think you need to first find it then target it.
Code: Select all
as = player:findNearestNameOrId("Androlier\'s Shadow")
if as then
player:target(as)
player:update() -- Needed to update player.TargetPtr
player:cast("WARRIOR_SURPRISE_ATTACK");
end
See if that works.