Log in

View Full Version : refrain a script to right click an already looted loot



zluo
06-12-2012, 09:43 AM
so basically I was thinking of a looter. The monster drops items hidden by the bones, so it will always search for the bones. But how do you refrain the script from already looting something that has already been searched? thanks! not sure if it's complicated but if it is, it doesnt matter. Also Im feeling a bit bad asking so many questions in the help section. would someone be willing to help me through msn and happily answer my questions :p? thanks
msn: mrzluo@hotmail.com

putonajonny
06-12-2012, 09:52 AM
You could grab the position of the minimap dots, then convert them to SPS map positions, then go through each on and use SPS_PosToMM in combination with MMToMS to get a rough position on the Main Screen, then search in a box near there. I do have msn but I'm not on much, best just to PM me..

Runaway
06-12-2012, 04:41 PM
To add onto jonny's idea, you can also blacklist that MM item after you've searched it using a similar method to what I did on the other thread you posted recently. Then when you're doing this:


then go through each on and use SPS_PosToMM in combination with MMToMS to get a rough position on the Main Screen, then search in a box near there.

you do a blacklist check before anything else:


var
BlackList: TBoxArray;
// ^ Global var

var
i, ii: Integer;
Skip: Boolean;
// ^ Local var

// ...

for i := 0 to High(Points) do
begin
Skip := False;
for ii := 0 to High(BlackList) do
begin
if PointInBox(Points[i], BlackList[ii]) then
begin
Skip := True;
Break;
end;
end;
if Skip then
Continue;
// PickupLoot
// ...
end;

Ashaman88
06-12-2012, 06:03 PM
To add onto jonny's idea, you can also blacklist that MM item after you've searched it using a similar method to what I did on the other thread you posted recently. Then when you're doing this:



you do a blacklist check before anything else:


var
BlackList: TBoxArray;
// ^ Global var

var
i, ii: Integer;
Skip: Boolean;
// ^ Local var

// ...

for i := 0 to High(Points) do
begin
Skip := False;
for ii := 0 to High(BlackList) do
begin
if PointInBox(Points[i], BlackList[ii]) then
begin
Skip := True;
Break;
end;
end;
if Skip then
Continue;
// PickupLoot
// ...
end;


Is that assuming your character doesn't move? Will that be able to keep track of the dots moving around in relation to your character moving? Or just work until the next time your character moves?

putonajonny
06-12-2012, 06:22 PM
Is that assuming your character doesn't move? Will that be able to keep track of the dots moving around in relation to your character moving? Or just work until the next time your character moves?

You would convert the minimap point to an SPS point, since that wouldn't be relative it wouldn't matter if you moved...

Ashaman88
06-12-2012, 06:34 PM
You would convert the minimap point to an SPS point, since that wouldn't be relative it wouldn't matter if you moved...

Ah ok i getcha. Then only problem would be if you killed a monster on the same spot while loot is still on the ground right? And unban points after red dot disappears?

Runaway
06-12-2012, 06:50 PM
Ah ok i getcha. Then only problem would be if you killed a monster on the same spot while loot is still on the ground right? And unban points after red dot disappears?

Yeah. You could get fancy though and do a MM item check in a box like this:

IntToBox(MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10)

after you've killed a monster, and if it finds an item there it will check the pile regardless of blacklist. As for unbanning, you could call something like HandleBlackList; that would check the blacklisted points and if there's no MM item dot there anymore it removes it from the list.

putonajonny
06-12-2012, 07:08 PM
Ah ok i getcha. Then only problem would be if you killed a monster on the same spot while loot is still on the ground right? And unban points after red dot disappears?

You mean if you check a spot then a monster is killed on top of it, also instead of just searching a bot around the centre of the minimap, because as you move to get loots you might start to see more, you could get them all, then go through and use MMToMS to check if they are on the MS?

Runaway
06-12-2012, 07:15 PM
You mean if you check a spot then a monster is killed on top of it, also instead of just searching a bot around the centre of the minimap, because as you move to get loots you might start to see more, you could get them all, then go through and use MMToMS to check if they are on the MS?

Err, I don't really understand everything you're saying there. What ashaman meant is that the only issue with the blacklist method would be if you killed a monster and it's loot merged with a pile that you've already checked; meaning the blacklist will prevent you from looting that pile.

By using the box method to get around this, I would only have it check once (before moving anywhere) right after a monster has been successfully killed. if there's a pile of loot in a small area around the MM centerpoint, it will check that for the loot and then blacklist it.

putonajonny
06-12-2012, 07:34 PM
Err, I don't really understand everything you're saying there. What ashaman meant is that the only issue with the blacklist method would be if you killed a monster and it's loot merged with a pile that you've already checked; meaning the blacklist will prevent you from looting that pile.

By using the box method to get around this, I would only have it check once (before moving anywhere) right after a monster has been successfully killed. if there's a pile of loot in a small area around the MM centerpoint, it will check that for the loot and then blacklist it.

Oh right, in my method you would search each one before moving on, then next time you would assume that they were all new loots (because by the time you have killed the monster they would have gone) and you check them all again...

Getdropped
06-13-2012, 12:12 PM
What I did to solve this problem on a few of my scripts is, for example when looting feathers at chicken pens you search for the waitoptions # and if it is like 4 there are loots and if it is like 2 you already looted some of it. Just do a search uptext for the number when there is the loot your at looking for. It works pretty well the only problem is if multiple loots are on the same position it does not work. :/