SRL Archive - OSR Help

How to make a good looting function?


l6bustank

2013-05-16 16:10:58

Title says it. I have used a simple TPA function for finding whatever I want to loot. What do you guys use and how do you use it (I mean, is there anything i should pay close attention to etc.)?

Kevin

2013-05-16 16:18:44

There's a variety of techniques, all balancing speed, accuracy, limitations, etc.

For example, tpa can work just fine if you're looking to pick up something every time a drop happens (bones or hides) with no care about checking other people's drops at all. However, if you want to only check the drop pile you just made, there are a few options you could do:
Watch the area below the monster you just killed or
Make an array of the red dots on MM as you make the kill, then check the new array of red dots on the MM for a change which should be your kill and check that pile. (the one I'm gonna do prolly because it can be used to uniquely check other people's drops one time only if done carefully).

l6bustank

2013-05-17 03:43:10

From: Kevin
There's a variety of techniques, all balancing speed, accuracy, limitations, etc.

For example, tpa can work just fine if you're looking to pick up something every time a drop happens (bones or hides) with no care about checking other people's drops at all. However, if you want to only check the drop pile you just made, there are a few options you could do:
Watch the area below the monster you just killed or
Make an array of the red dots on MM as you make the kill, then check the new array of red dots on the MM for a change which should be your kill and check that pile. (the one I'm gonna do prolly because it can be used to uniquely check other people's drops one time only if done carefully).


Some good ideas, thx.
Under watching the moster area, do you mean like plain MS coordinates? And what do you think is the best way for determining the area where the monster is (do you find the bugger with pixelshift / hp bar / anything else)?

al4k

2013-05-17 04:11:47

One method is to constantly check the MS for the full red hp bar of an enemy (shown just before they drop loot).
The drop will always be at a point relative to that bar - assuming same camera angle

i.e.

if FindDTM(RedHPBarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
Mouse(x, y+21, 5, 5);

Kevin

2013-05-17 13:06:21

From: l6bustank
Some good ideas, thx.
Under watching the moster area, do you mean like plain MS coordinates? And what do you think is the best way for determining the area where the monster is (do you find the bugger with pixelshift / hp bar / anything else)?


I do mean plain MS coordinates. I would suggest finding him with the HP Bar similar to what al4k mentions. If you're using melee, then you can limit the search to within x pixels of you and make it more accurate as well.

l6bustank

2013-05-17 13:57:39

Alright, thx both, will use this :)