Page 1 of 1

Problem attacking mobs

Posted: Sat Mar 17, 2012 8:46 am
by Caspy
Hello,

I wish to create a bot in which I stand at some waypoint. Mobs will spawn. I kill them, next wave of mobs spawn and I kill them again and so on, until the while-statement is ok.
But I'm having problems killing them to get their loot and thus can't complete the while-statement.

Waypoint looks like:

Code: Select all

<!-- # 13 --><waypoint x="3565" z="4271" y="743">
	   	target = player:getTarget();
   	   	if target ~= nil then
			player:cast("ROGUE_SHADOWSTAB");
			yrest(500);
			player:cast("ROGUE_LOW_BLOW");
			yrest(500);
   	   	end

		while 4 > inventory:itemTotalCount(206138) do 
         		yrest(500);
      			item:update(206138)
      			if item.ItemCount == 4 then
      				break
      			end
      			yrest(300);
   		end			
		yrest(1000);
	</waypoint>
The while loop works, if I manually kill the mobs after gathering 4 items i move to next waypoint. But I can't seem to target the mobs.

Their names are "Demon Dragon Seal" and "Demon Dragon Prison Guard".
I tried adding

Code: Select all

 if target.Name == "Demon Dragon Seal" || "Demon Dragon Prison Guard" then ... end
in the if-statement, but when i reach that waypoint i get a compile error.

I Also tried this code:

Code: Select all

<!-- # 13 --><waypoint x="3565" z="4271" y="743">
		yrest(3000);
		la = player:findNearestNameOrId(102738)
		lb = player:findNearestNameOrId(102779)
    	   		if la then
				player:target(la);
				player:cast("ROGUE_SHADOWSTAB");
				yrest(500);
				player:cast("ROGUE_SHADOWSTAB");
				yrest(500);
				else if lb then
					player:target(lb);
					player:cast("KNIGHT_HOLY_STRIKE");
				end
   	   		end

		while 4 > inventory:itemTotalCount(206138) do 
         		yrest(500);
      			item:update(206138)
      			if item.ItemCount == 4 then
      				break
      			end
      			yrest(300);
   		end			
		yrest(1000);
	</waypoint>
But my character is just standing there, not attacking mobs, even though I have entered combat.

All ideas are welcome. ThQ.

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 9:41 am
by Caspy
Problem solved:

Code: Select all

<!-- # 13 --><waypoint x="3565" z="4271" y="743">
		yrest(3000);

		while 4 > inventory:itemTotalCount(206138) do 
		la = player:findNearestNameOrId(102779)
		lb = player:findNearestNameOrId(102738)
    	   		if la then
				player:target(la);
				player:cast("KNIGHT_HOLY_STRIKE");
			end
			if lb then
				player:target(lb);
				player:cast("ROGUE_SHADOWSTAB");
				yrest(500);
				player:cast("ROGUE_SHADOWSTAB");
				yrest(500);
			end
   	   		
         		yrest(500);
      			item:update(206138)
      			if item.ItemCount == 4 then
      				break
      			end
      			yrest(300);
   		end			
		yrest(1000);
	</waypoint>

Next problem is: I need to loot the Demon Dragon Sealer. But for some reason it won't do that, any ideas? ThQ.
PS. My loot options in profile are like:
<!-- Loot settings -->
<option name="LOOT" value="true" />
<option name="LOOT_IN_COMBAT" value="true" />
<option name="LOOT_DISTANCE" value="100" />
<option name="LOOT_PAUSE_AFTER" value="0" /> <!-- probability in % for a short rest -->

Right, I noticed my bot keeps spamming the skills, even if there are no mobs there, maybe that's why there is no time to loot. Got to change something in the loop. Yet to figure out what..

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 9:55 am
by lisa
add this to your profile options for looting.

Code: Select all

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

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 10:05 am
by Caspy
Hi Lisa,

Adding this did not solve the issue.
Right, I noticed my bot keeps spamming the skills, even if there are no mobs there, maybe that's why there is no time to loot. Got to change something in the loop. Yet to figure out what..
:)

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 10:06 am
by rock5
I think it's because you are manually attacking the mobs so you will need to manually loot them too. Try adding

Code: Select all

player:loot()
or

Code: Select all

player:lootAll()
in the while loop, after the fight.

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 10:31 am
by Caspy
Yup rock5, you're right, this solves the problems about this waypoint. These mobs are pretty annoying though with their 1.5k dot for 15 seconds.

Updated the waypoint a bit, it's safer, clearing target more often so it's easier to keep up with the spawns.

Code: Select all

	<!-- # 13 --><waypoint x="3565" z="4271" y="743">
		yrest(3000);

		while 4 > inventory:itemTotalCount(206138) do 
		la = player:findNearestNameOrId(102779)
		lb = player:findNearestNameOrId(102738)
    	   		if la then
				player:target(la);
				player:cast("KNIGHT_HOLY_STRIKE");
				player:loot();
			end
			if lb then
				player:target(lb);
				player:cast("ROGUE_LOW_BLOW");
				yrest(500);
				player:loot();
			end
   	   		
         		yrest(500);
      			item:update(206138)
      			if item.ItemCount == 4 then
      				break
      			end
      			yrest(300);
   		end			
		yrest(1000);
	</waypoint>
Anyway boss fight is next. Won't be easy either (Geesteeroo) ^.^

Thanks.

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 11:21 am
by Caspy
On a side note:

Could you please add

Code: Select all

<skill name="ROGUE_UNKNOWN_CHOICE" id="495715" energy="20" target="self" type="buff" buffname="..." cooldown="?3 minutes?" />
Buffnames:

Excite: 506868
Blood Boil: 506877
Immortality: 506880

to the itemset skills of rogue?

Or is this not an option cause of the buffname that can differ?

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 11:39 am
by rock5
You should be able to use more than one buff. Try this

Code: Select all

<skill name="ROGUE_UNKNOWN_CHOICE" id="495715" energy="20" target="self" type="buff" buffname="506868,506877,506880" cooldown="180" />
And let us know if it works ok.

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 11:53 am
by Caspy
Right, this works, thought I couldn't Edit that database file. :) Would have tried first otherwise lol.

Thanks a bunch.

Will continue testing another day, done enough for today. Just the boss fight remains, but I noticed I'm closing in on him all the time, instead of standing in 1 spot and hit him.
Got to look into that later.

Re: Problem attacking mobs

Posted: Sat Mar 17, 2012 1:00 pm
by rock5
Caspy wrote:Right, this works, thought I couldn't Edit that database file. Would have tried first otherwise lol.
Well someone has to try setting up and testing new skills so we can add them to the bot.

So, seeing as it is working, I'll add it to my next commit.