View Full Version : Help with looting
Spartan 117
01-17-2014, 05:18 PM
Hi all,
So I am working on a combat script and it is going pretty well right now. The only thing I am having trouble with is the looting part. I have the script where it easily recognizes that there is loot on the ground to pick up, but I do not know how to tell the script to not loot that spot once I do not want anything that is in the lootstack anymore. Does anyone have any suggestions on how to store which loot stacks have already been looted?
Spartan
I've made looter in the past. It does everything you need. It's pretty old, so some SRL functions might be outdated, but algoryth should stay fine. Feel free to implement it or look on the code and use it to make your own looter. Here is it:
http://villavu.com/forum/showthread.php?t=76643&p=948117#post948117
Spartan 117
01-17-2014, 05:52 PM
I've made looter in the past. It does everything you need. It's pretty old, so some SRL functions might be outdated, but algoryth should stay fine. Feel free to implement it or look on the code and use it to make your own looter. Here is it:
http://villavu.com/forum/showthread.php?t=76643&p=948117#post948117
Thanks a lot!
You can use the red mini map dots. Store them as a TPA, have it go through the TPA sorting them closest from the center of the mini map ( assuming that you are not using range or magic) and then transcribe the dots from the mini map to the main screen. After you do that you can setup a box around the pile of loot. Search the box using some basic colors, I usually use bones (it will be a very small box around the loot, so don't worry about it bouncing around the screen) and have it right click on them and search through the pile of loot from a TPA/List of loot that you or the user enter.
I think that I still have a section of code that finds a person in this way. Ill have to see.
Procedure Looting;
var
LootTPA: TPointArray;
L, i:integer;
LootPoint: TPoint;
begin
writeln('looting');
LootTPA := combinetpa(BeforeKillTPA, AfterKillTPA)
cleardoubletpa(LootTPA);
L := High(LootTPA) for i := 0 to L do
begin
writeln('looting2');
LootPoint := MMToMSEx(0, 2, LootTPA[i]);
MMouse(LootPoint.x, LootPoint.y, 1, 1);
ClickMouse2(False);
if WaitOptionMulti(['ater orb', 'Rune helm', 'eaweed', 'attlestaff', 'eath rune', 'charm', 'Snape'], 350) then
begin
FFlag(1);
While IsMoving Do Wait(RandomRange(25, 50));
exit;
end;
end;
SetArrayLength(BeforeKillTPA, 0);
SetArrayLength(AfterKillTPA, 0);
end;
Replace my chooseoption(they only ever drop on thing I wanted at a time) with a record,list,tpa ect. of what you want them to loot and have it repeat the pickup procedure using slight variations of the points until it can't find them anymore..
This is what I wrote to loot, not sure if it works anymore..
Call this before you kill the monster BeforeKillTPA := GetMMDotsOnMS('red');
and call this after AfterKillTPA := GetMMDotsOnMS('red');
Make sure to define all the variables...
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.