Page 1 of 2

Looting bot idea.

Posted: Fri May 13, 2011 10:06 am
by Uglich
Hello.
First of all I have to say I don't know how to make this bot.

My idea is to make a bot to loot every dead mob, something like the pet with Magic Perfume (http://www.runesdatabase.com/item/20758 ... gico-1-d-a)

I don't know if this could be posible, because you have to have the bot following your PJ, and at the same time, it needs to be able to move to the death mobs to loot it.

What do you think about this bot idea?
Could it be possible to make?

Thank you.

Re: Looting bot idea.

Posted: Fri May 13, 2011 10:37 am
by rock5
So you want to make a bot that follows you and loots all dead bodies? Other people have done work on party bots so you could look at them for inspiration.

There is even a heal party bot in the repository.
http://www.solarstrike.net/phpBB3/viewt ... =21&t=2002
You could probably use or modify that.

Basically all it needs is a loop that follows and loots, follows and loots etc.

What would make it complex is if you want it to do other things like; assisting you or defending itself.

Re: Looting bot idea.

Posted: Fri May 13, 2011 4:51 pm
by Uglich
Hello.

I just want the bot to loot mobs and follow me. I'll use it in a low level zone, so the bot pj will be safe.
Tomorrow I'll start to make someting (bad, for sure).
I'll be back with a lot of problems.

Thank you

Re: Looting bot idea.

Posted: Sat May 14, 2011 12:40 am
by lisa
I can't remember the function for lootbodies pretty busy atm but if it is lootbodies() then try this as your WP
if it takes to long to loot the bodies and the main bot has moved to far away then it won't be able to follow. You can add a pause after leaving combat on main bots profile if this becomes an issue and it should fix it. Otherwise will need to use the moveto function which should remidy it.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad><![CDATA[
	while(true) do
		if (not player.Battling) then 
lootbodies()
RoMScript("FollowUnit('party1');")
	end
]]></onLoad>
</waypoints>


Re: Looting bot idea.

Posted: Sat May 14, 2011 1:05 am
by rock5
lootBodies was the old userfunction. The in bot function is called "player:lootAll()". Use that instead.

Re: Looting bot idea.

Posted: Sat May 14, 2011 7:59 am
by Uglich
Hello, I was trying to make it work, but the bot don't loot anything.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
	while(true) do
		if (not player.Battling) then
			player:lootAll();
			RoMScript("FollowUnit('party1');");
		end;
	end;
	</onLoad>
</waypoints>
Whith this waypoints, it just follows me.

Lisa, this bot is for being used with other character played by me, not other bot, so, if it's too far away it's not a problem.

Re: Looting bot idea.

Posted: Sat May 14, 2011 8:07 am
by lisa
need to make sure you have LOOT and LOOT_ALL set to true in profile of the bot character, calling that function will also make it check the usual options.

Also should mention it will only check for loot after it leaves combat, so if you keep agroing mobs nonstop then it won't loot.

Could probably try it without the battling check if that is an issue

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
   <onLoad>
   while(true) do

         player:lootAll();
         RoMScript("FollowUnit('party1');");
 
   end;
   </onLoad>
</waypoints>

Re: Looting bot idea.

Posted: Sat May 14, 2011 8:48 am
by Uglich
Hello, this is the looting part of the profile:

Code: Select all

<!-- Loot settings -->
		<option name="LOOT"               	value="true" />
		<option name="LOOT_IN_COMBAT"     	value="true" />
		<option name="LOOT_DISTANCE"      	value="250" />
		<option name="LOOT_PAUSE_AFTER"   	value="0" />		<!-- probability in % for a short rest -->
I think it's ok.

About the code, I've tryed it waiting after the fights, moving near to the dead mob, and still don't move to the lootable mob, and of course don't looting.
I use Lootomatic addon, and "Free for all" in party looting config.

¿Does "player:lootAll()" need some arguments between () ?

Re: Looting bot idea.

Posted: Sat May 14, 2011 9:17 am
by rock5
Ah, lootAll() checks to see if LOOT_ALL in the profile is set. If you don't have it set, it wont loot all. Try adding

Code: Select all

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

Re: Looting bot idea.

Posted: Sat May 14, 2011 9:49 am
by Uglich
Thank you, the bot is working now.
I'll test it for a while, and for sure, will be back with problems.

Re: Looting bot idea.

Posted: Fri Jun 10, 2011 7:26 am
by schwarzepeter
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
while(true) do

lootbodies();
RoMScript("FollowUnit('party1');");

end;
</onLoad>
</waypoints>


i have 2 issuse if i enter portal to instance the following partymember get somtimes normal mode at entering instance and if the main main char disaper in portal the folowing partymember stay infront of portal and don enter it

so my question is a way to set instance to mode easy all time ?
and if partymember lost the main char as target it use keypress W to reach the portal

can anyone help me pls?

Re: Looting bot idea.

Posted: Fri Jun 10, 2011 7:48 am
by lisa
you can make the instance level normal or easy. in game command is

Code: Select all

SetInstanceLevel("easy"); -- normal or easy
bot command is

Code: Select all

RoMScript('SetInstanceLevel("easy");')
If you use Come on In then open up ComeOnIn.lua and find

Code: Select all

		-- Active-Only Events
		if (ComeOnIn.Active==true) then
and add this

Code: Select all

		-- Active-Only Events
		if (ComeOnIn.Active==true) then
			if GetInstanceLevel()~="easy" then
				SetInstanceLevel("easy");
			end;
and that will make it set to easy anytime coi is used.

As for the bit about following.
you could target party1 and if distance is > 500 yards then press forward key.
This would assume you are pointing at the right direction, better would be to send it to coords, you would need to know those coords.
To trouble shoot it even more you could detect your distance to those coords and if < 200 then moveto those coords.

If you do the same instance then you can get the coords for entrance of instance and also a point that moves you into the instance. Then do a check for distance to the first coords and if close then moveto other coords. Shouldn't be hard to do.

Re: Looting bot idea.

Posted: Sat Jun 11, 2011 5:48 am
by schwarzepeter
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
while(true) do

lootBodies();
RoMScript("FollowUnit('party1');");
player:update();
end
if ( distance(player.X, player.Z, partyleader.X, partyleader.Z) > 100) then
keyboardHold(key.VK_W); yrest(1000);keyboardRelease(key.W); end;
</onLoad>
</waypoints>
it dosnt work main char enter the instance but it dont use the keypress wat i dit wrong? mainchar is partyleader :?: :?: :?: :(

Re: Looting bot idea.

Posted: Sat Jun 11, 2011 6:32 am
by lisa

Code: Select all

while(true) do
lootBodies();
RoMScript("FollowUnit('party1');");
player:update();
end
with that code you won't ever leave the loop.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
while(true) do

lootBodies();
RoMScript("FollowUnit('party1');");
player:update();
if ( distance(player.X, player.Z, partyleader.X, partyleader.Z) > 100) then
keyboardHold(key.VK_W); yrest(1000);keyboardRelease(key.W); end;
end

</onLoad>
</waypoints>
You need to do it differently to succeed in this WP though.

Something like this, you might need to determine partyleader though.

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) > 200
keyboardHold(settings.hotkeys.MOVE_FORWARD.key) 
yrest(1000);
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key) 
waitForLoadingScreen(5)
end
</onload>

Re: Looting bot idea.

Posted: Mon Jul 04, 2011 9:34 am
by lalaxy
Hey!

I have same problem like Uglich before. I need a support bot whos following (it works) and looting mobs...But looting is not working...
I have this waypoint:
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
while(true) do

player:lootAll();
RoMScript("FollowUnit('party1');");

end;
</onLoad>
</waypoints>

I have this profile:
<profile>
<options>
<option name="COMBAT_TYPE" value="ranged" />
<option name="COMBAT_DISTANCE" value="150" />
<option name="ANTI_KS" value="true" />
<option name="WAYPOINTS" value="assi.xml" />
<option name="RETURNPATH" value="assi.xml" />
<option name="PATH_TYPE" value="waypoints" />
<option name="WANDER_RADIUS" value="300" />
<option name="WAYPOINT_DEVIATION" value="5" />
<option name="LOOT" value="true" />
<option name="LOOT_ALL" value="true" />
<option name="LOOT_IN_COMBAT" value="false" />
<option name="LOOT_TIME" value="2000" />
<option name="LOOT_DISTANCE" value="275" />
<option name="ENERGY_STORAGE_1" value="mana" />
<option name="ENERGY_STORAGE_2" value="energy" />
<option name="POTION_COOLDOWN" value="15" />
<option name="MAX_FIGHT_TIME" value="30" />
<option name="DOT_PERCENT" value="90" />
</options>
<friends>
<friend name="Green Frog" />
</friends>
<hotkeys>
<hotkey name="MACRO" key="VK_0" />
</hotkeys>
<skills>



<skill name="MAGE_ELECTRIC_BOLT" hotkey="VK_6" priority="100"/>
-- skill name="MAGE_FIREBALL" hotkey="VK_4" priority="99"/>
-- skill name="MAGE_ESSENCE_OF_MAGIC" hotkey="VK_1" priority="100"/>
-- skill name="MAGE_SILENCE" hotkey="VK_1" priority="100"/>
-- skill name="MAGE_DISCHARGE" hotkey="VK_2" priority="100"/>

</skills>
<onDeath>-- Additional Lua code to execute on death
pauseOnDeath(); -- Stop the script</onDeath>
<onLeaveCombat></onLeaveCombat>
<onSkillCast>-- 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.</onSkillCast>
</profile>

...i was in party with assist char, who dont want to loot, and loot settings free for all...and ive killed many mobs with my main char and assistant dont want to loot...
Any idea would be good!
Many thx

Re: Looting bot idea.

Posted: Tue Jul 05, 2011 7:54 pm
by lalaxy
while(true) do


player:update();
if ( distance(player.X, player.Z, partyleader.X, partyleader.Z) > 1000) then
keyboardHold(key.VK_W); yrest(1000);keyboardRelease(key.VK_W); end;
printf("partyleaderrrr : %d \n",partyleader.X)
printf("partyleaderrrr : %d \n",partyleader.Z)
printf("member: %d \n",player.X)
printf("member: %d \n",player.Z)
player:lootAll()
yrest(500);
RoMScript("FollowUnit('party"..partyleaderIndex.."');");
end

Ive found something problem with this...Mybe cause of address changing, but i get to instance , it count wrong or not count the leaders coords...I can attach my output's for example...
Any idea ?

Re: Looting bot idea.

Posted: Tue Jul 05, 2011 9:00 pm
by rock5
lalaxy wrote:Hey!

I have same problem like Uglich before. I need a support bot whos following (it works) and looting mobs...But looting is not working...
Try adding a player update.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
   <onLoad>
   while(true) do
         player:update()
         player:lootAll();
         RoMScript("FollowUnit('party1');");

   end;
   </onLoad>
</waypoints>

Re: Looting bot idea.

Posted: Tue Jul 05, 2011 9:11 pm
by rock5
lalaxy wrote:Ive found something problem with this...Mybe cause of address changing, but i get to instance , it count wrong or not count the leaders coords...I can attach my output's for example...
Any idea ?
Lalaxy, you have everything happening only if distance is more than 1000 and your are not updating the leader info. Try this. And use [ code] tags in the future please.

Code: Select all

while(true) do
		player:update();
		partyleader:update()
		if ( distance(player.X, player.Z, partyleader.X, partyleader.Z) > 1000) then
			keyboardHold(key.VK_W); yrest(1000);keyboardRelease(key.VK_W); end;
			printf("partyleaderrrr  : %d \n",partyleader.X)
			printf("partyleaderrrr  : %d \n",partyleader.Z)
			printf("member: %d \n",player.X)
			printf("member: %d \n",player.Z)
			waitForLoadingScreen()
		end
		player:lootAll()
		yrest(500);
		RoMScript("FollowUnit('party"..partyleaderIndex.."');");
end

Re: Looting bot idea.

Posted: Tue Jul 05, 2011 9:15 pm
by lalaxy
Ive tryed with updating partyleader info too...
Without success...at the address changing it stops counting :S Or sometimeg it will be 0,0

Re: Looting bot idea.

Posted: Tue Jul 05, 2011 9:18 pm
by lalaxy
while(true) do

player:update();
partyleader:update();
if ( distance(player.X, player.Z, partyleader.X, partyleader.Z) > 1000) then
keyboardHold(key.VK_W); yrest(1000);keyboardRelease(key.VK_W); end;
printf("partyleaderrrr : %d \n",partyleader.X)
printf("partyleaderrrr : %d \n",partyleader.Z)
printf("member: %d \n",player.X)
printf("member: %d \n",player.Z)
player:lootAll()
yrest(500);
RoMScript("FollowUnit('party1');");
end

this was the original script, but ive thought *partyleader:update();* its not works....thats why ive missed before...

Counter stops at address changing or go to 0,0...
Ive attached U a screen about the output...
Thx