Page 1 of 2

Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 3:09 pm
by kanta
My wife and I both use the bot. We decided to try the party bot. I'm a scout, she's a priest. We want to farm Life Leecher but are having a problem. I start up the initial script, she starts the party healer script. The problem is that her character doesn't follow into or out of the instance. Once my character ports, hers just stops and stands there. What can we do to get her character to follow?

And another problem. Her character isn't looting at all.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 4:35 pm
by kanta
Ok... no clue what I'm doing wrong but I can't get this to work at all. It heals only randomly. It won't loot. I've been plugging away at this for a few hours now.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 7:54 pm
by lisa
I never designed the healer to actually loot initially, the trouble was that the healer never targets any mobs and therefore doesn't know when they die and doesn't get any of the mobs info, address and such.

With the introduction of lootall() by rock the healer can actually loot aswell now as it can check for dead bodies on the ground regardless of if it actually killed it.
Need to add in some profile options

Code: Select all

<option name="LOOT_ALL"     	  value="true" />

maybe change to loot out of combat

Code: Select all

<option name="LOOT_IN_COMBAT"     value="false" />
Other issue of following into an instance is that in the basic party bot it follows using the in game follow command, when the front character enters an instance it will stop following.

There was a post just recently about following into an instance, the title wasn't about that but it kind of evolved into it lol

try this

Code: Select all

<onload>
while(true) do
partyleader = GetPartyMemberAddress(1)

repeat
lootBodies();
RoMScript("FollowUnit('party1');");
player:update();
until distance(player.X, player.Z, partyleader.X, partyleader.Z) > 300
keyboardHold(settings.hotkeys.MOVE_FORWARD.key) 
yrest(1000);
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key) 
waitForLoadingScreen(5)
end
</onload>

I haven't tested this, might need some tweaking here and there.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 8:05 pm
by kanta
I'll give this a try and see what happens

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 9:23 pm
by kanta
Ok, it still doesn't follow into the instance. Maybe some sort of code would be necessary to detect the zone, and if outside the instance try to follow at a range of 20 or less? Like for farming Origin, Aslan is zone 4 and Origin is zone 116. Can such a thing be done?

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 9:44 pm
by lisa
maybe try adding in a print to make sure we are actually getting the distance value

Code: Select all

player:update();
local dist = distance(player.X, player.Z, partyleader.X, partyleader.Z)
printf(dist.."\n")
until distance(player.X, player.Z, partyleader.X, partyleader.Z) > 300

Code: Select all

<waypoints>
<onload>
while(true) do
partyleader = GetPartyMemberAddress(1)

repeat
lootBodies();
if (not player.Battling) then
RoMScript("FollowUnit('party1');");
end
player:update();
local dist = distance(player.X, player.Z, partyleader.X, partyleader.Z)
printf(Distance to party leader: "..dist.."\n")
until distance(player.X, player.Z, partyleader.X, partyleader.Z) > 300
keyboardHold(settings.hotkeys.MOVE_FORWARD.key) 
yrest(1000);
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key) 
waitForLoadingScreen(5)
end
</onload>
</waypoints>
If it is working then you should see a lot of prints on MM saying the distance, if not then there is an issue with the distance detection.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:05 pm
by kanta
11:4pm - C:/micromacro/scripts/rom/classes/waypointlist.lua:81: Failed to compile and run Lua code for waypointlist onLoad event.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:23 pm
by lisa
printf(Distance to party leader: "..dist.."\n")

missed a "

printf("Distance to party leader: "..dist.."\n")

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:33 pm
by lisa
This is actually a little different to the way i handled it for me own personal use.

What I did was place an icon on the party leader and have the healer look for icons and do different code accordingly.

So for example place a IV on leader and when healer see the IV it then moves forward.
I used to use 3 or 4 icons for different things.
IV was to stop following so I could have distance between the characters for special fights or when leader repairs.
I was to follow again, the leader then of course places the I on mob when starts fight, which worked well.

You get the idea though, unfortunately I can't find my WP at the moment, done a lot of house cleaning through MM files and total reloading MM and rombot, I usually forget to back up waypoints =(

Ohhhhhhh major thought, might be on other PC. lol

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:43 pm
by kanta
Yes, it was printing distance values

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:45 pm
by lisa
Found a little snippet from an old function

Code: Select all

function healing()
	local target = player:getTarget();
	local pawn = CPawn(target.Address);
	local icon = pawn:GetPartyIcon()
if player.Class1 == 5 then -- priest
-- 80% to 95% HP
         	if (95 > target.HP/target.MaxHP*100 and 
            	target.HP/target.MaxHP*100 > 80 and
            	( not target:hasBuff("Regenerate")) ) then
               player:cast("PRIEST_REGENERATE")
          	end
-- 70% to 80% HP
      		if (80 > target.HP/target.MaxHP*100 and 
            target.HP/target.MaxHP*100 > 70) then
                player:cast("PRIEST_URGENT_HEAL") 
            end          
-- 40% to 70% HP
      		if (70 > target.HP/target.MaxHP*100 and 
            target.HP/target.MaxHP*100 > 40) then
                player:cast("PRIEST_GROUP_HEAL") 
            end 
                        
-- 10% to 30% HP
      		if (40 > target.HP/target.MaxHP*100 and 
            target.HP/target.MaxHP*100 > 10) then
                player:cast("PRIEST_SOUL_SOURCE") 
            end
            if 30 > player.HP/player.MaxHP*100 then player:cast("PRIEST_HOLY_AURA") end      
end
end 
	while(true) do
	local target = player:getTarget();
	local pawn = CPawn(target.Address);
	local icon = pawn:GetPartyIcon()
		
		for i,v in ipairs(partymember) do
		if i == 1 then keyboardPress(key.VK_F1); end
		if i == 2 then keyboardPress(key.VK_F2); end
		if i == 3 then keyboardPress(key.VK_F3); end
		if i == 4 then keyboardPress(key.VK_F4); end
		if i == 5 then keyboardPress(key.VK_F5); end
		if i == 6 then keyboardPress(key.VK_F6); end

			partymember[i]:update()
						
			partymember[i]:updateBuffs()
			
			player:checkPotions()
			
			player:checkSkills(true);
			
			partymember[i]:update()
							
			healing()
			
		if settings.profile.options.PARTY_INSTANCE == true then 
		yrest(500) else
		yrest(1000)
		end	
 
		if (not player.Battling) then
		 
			if icon == 4 and stopfollow ~= true then
			keyboardPress(key.VK_S);
			stopfollow = true
			end
			if icon ~= 4 then
			getNameFollow()
			stopfollow = false
			end
		end
	end
 	end
 end
I would probably do it differently now, that is from about 3 months ago.
When healer sees the IV icon on leader it then presses a movement key, backwards, which stops the follow.
In the leaders Wp I had it set the IV icon on itself when I wanted the healer to stop following and then removed the icon when I wanted it to follow again.
Obviously this won't make healer walk into an instance but you get the idea, instead of stop following you can make it walk forward.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:47 pm
by kanta
so.... would there be a way for me to put a mark over my character's head, have the healer see it then move to a certain coordinate?

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:48 pm
by kanta
ok, we posted almost at the same time, I'll look over that code and see what I can do

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 10:50 pm
by lisa
kanta wrote:Yes, it was printing distance values
Awesome, then the distance values are working.

what values dd it print? any over the 300?

might add in another print to see if it detects leader is > 300

Code: Select all

until distance(player.X, player.Z, partyleader.X, partyleader.Z) > 300
printf("Ok party leader is very far away\n")
keyboardHold(settings.hotkeys.MOVE_FORWARD.key)
Yeah sorry about throwing that in there, it will just get you side tracked, maybe just get the original working first. Then you can play with the icons later =)

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 11:09 pm
by kanta
ok, I pasted your snippet in there and changed to the following code in regards to the IV mark

Code: Select all

      if (not player.Battling) then
      
         if icon == 4 and stopfollow ~= true then
         player:moveTo(CWaypoint(-11837, 8644));
         stopfollow = true
         end
         if icon ~= 4 then
         getNameFollow()
         stopfollow = false
         end
and her character promptly runs into the instance. Now I just have to figure out how to add that marking command to my LL farm WP file.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 11:24 pm
by lisa

Code: Select all

sendMacro('SetRaidTarget("target", 1);')
target is a unitid
so for the leader setting it on himself use "player"
1 is the number refering to which icon
1 = I
2 = II
and so on

So what you want is, can do it in the first waypoint when the leader enters instance and also add in a rest to give the healer time to enter.
then remove the icon by setting 1 to the leader.

Code: Select all

sendMacro('SetRaidTarget("player", 4);')
yrest(5000)
sendMacro('SetRaidTarget("player", 1);')
yrest(2000)

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 11:25 pm
by kanta
I spoke too soon. It works the first time the party is formed. Once I exit the instance and try again, it stops working.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 11:30 pm
by lisa
Might be an issue of the characters changing address when they change zone maybe?

If you call the PartyHeals() function again it should repopulate the table with the new addresses.

So when you enter instance call function. when you leave instance call the function.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 11:33 pm
by kanta
How would I call the function on zone change? I'm really sorry, but I'm so lost at this point I wanna cry. :oops:

I understand what you're saying, I just have no idea where to put it and how.

Re: Question for Lisa: Party Bot

Posted: Sat Jun 11, 2011 11:35 pm
by lisa
would mean something like this

Code: Select all

 
        if icon == 4 and stopfollow ~= true then
         player:moveTo(CWaypoint(-11837, 8644));
waitForLoadingScreen(5)
PartyHeals()
         stopfollow = true
         end
         if icon ~= 4 then
         getNameFollow()
         stopfollow = false
         end