SUGGESTION: Kill aggros, and rest
SUGGESTION: Kill aggros, and rest
Coudl you add to the base macro the following: After killing main target check if you are being attacked and clear the aggressive mobs. Then rest (use potions or just wait) to get enough hp to continue. In what file should I put that code?
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: SUGGESTION: Kill aggros, and rest
You can put this code in your waypoint script, or within your onLeaveCombat event.
waypoint method:
The onLeaveCombat event would work almost exactly the same way, except you place the code inside <onLeaveCombat> and </onLeaveCombat> in your character profile instead.
waypoint method:
Code: Select all
<waypoint x="x" z="z">
player:clearTarget();
local lastHP = player.HP
while(true) do
player:update();
if( player.HP == player.MaxHP ) then break; end; -- Full HP, resume
if( player.HP < lastHP ) then break; end; -- We're taking damage, break
lastHP = player.HP; -- update our 'lastHP' for checking next repetition
if( player:haveTarget() ) then break; end; -- We picked up a target, might be getting attacked
yrest(10);
end
</waypoint>
Re: SUGGESTION: Kill aggros, and rest
Code: Select all
RoM Bot Version 2.38
Attempt to read playerAddress
playerAddr: 0x2BAC6900
playerTarget: 0x0
...dministrator/Desktop/micromacro/scripts/settings.lua:111: XML Parse Error.
File: ...ator/Desktop/micromacro/scripts/profiles/******.xml
Line: 55
Column: 22
Message: not well-formed (invalid token)
Code: Select all
<onLeaveCombat>
player:clearTarget();
local lastHP = player.HP
while(true) do
player:update();
if( player.HP == player.MaxHP ) then break; end; -- Full HP, resume
if( player.HP < lastHP ) then break; end; -- We're taking damage, break
lastHP = player.HP; -- update our 'lastHP' for checking next repetition
if( player:haveTarget() ) then break; end; -- We picked up a target, might be getting attacked
yrest(10);
end
</onLeaveCombat>
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: SUGGESTION: Kill aggros, and rest
I guess that's caused by the '<' character being in the charData section of the XML. It's confusing the less than in the Lua code with an XML tag being opened.
Simple fix would be to reverse it:
Instead of:
Or, you could make that code a function in functions.lua, and call it from onLeaveCombat.
Or, you can replace the '<' in the code with '<'.
Simple fix would be to reverse it:
Code: Select all
if( lastHP > player.HP )
Code: Select all
if( player.HP < lastHP )
Or, you could make that code a function in functions.lua, and call it from onLeaveCombat.
Or, you can replace the '<' in the code with '<'.
Re: SUGGESTION: Kill aggros, and rest
By adding those lines I got a new problem. MY bot will never loot.
EDIT: solved by editing profile.lua
I put this after looting and not before.
EDIT2: How can i set the health values below i want to rest? I'dd like to define new values for HP_LOW_REST and HP_STAND. How to do this?
I tried to use HP_LOW_POTION value:
if( player.HP < settings.profile.options.HP_LOW_POTION ) then keyboardPress(key.VK_EQUAL); break; end;
But it doesn't allow me to use it like that.
EDIT: solved by editing profile.lua
I put this after looting and not before.
Code: Select all
if( type(settings.profile.events.onLeaveCombat) == "function" ) then
local status,err = pcall(settings.profile.events.onLeaveCombat);
if( status == false ) then
local msg = sprintf("onLeaveCombat error: %s", err);
error(msg);
end
end
I tried to use HP_LOW_POTION value:
if( player.HP < settings.profile.options.HP_LOW_POTION ) then keyboardPress(key.VK_EQUAL); break; end;
But it doesn't allow me to use it like that.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: SUGGESTION: Kill aggros, and rest
Just add them into your profile and they will be created, then you can access them through settings.profile.options.HP_LOW_REST and HP_STAND. I would really suggest not bothering with sitting, though. It has been discussed before; everybody thinks it's useless and adds unnecessary complication. You'll begin to see that sitting to heal outside of combat is just not worth it. You really are better off just buying a lot of health potions.aasi888 wrote: EDIT2: How can i set the health values below i want to rest? I'dd like to define new values for HP_LOW_REST and HP_STAND. How to do this?
I tried to use HP_LOW_POTION value:
if( player.HP < settings.profile.options.HP_LOW_POTION ) then keyboardPress(key.VK_EQUAL); break; end;
But it doesn't allow me to use it like that.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 7 guests