SRL Archive - OSR Help

Checking for charms


shiningwhite

2012-12-24 05:39:28

How would I go about making a loot function that checks as many loot stacks as possible for charms?

The issue is that the monster I want to loot does drop things that cover charms 90% of the time.

Basically, I don't want it to check other piles of loot that I didn't generate, because it is a high traffic area.

J J

2012-12-24 05:45:32

Two options
1) The most accurate option. Make a list of all charm colors and try to find for those colors. If there are any red dots on the minimap within a 40 pixel range of MMCX, MMCY then search for the colors of the other items that are dropped and cover charms. Right click if you find anything and check if the list contains Charms.

2) Another viable option. Make a list of all charm colors and try to find for those colors. If there are any red dots on the minimap within a 40 pixel range of MMCX, MMCY then use MMToMS to convert those points to mainscreen points. Hover the mouse there, check if the uptext contains something to loot, if it does then right click & check if there are charms.

l6bustank

2012-12-27 09:40:17

Doing sth like it in one of my scripts, but it fails to detect the option to loot an item i want. Is it still the OCR issue?

shiningwhite

2013-01-01 23:54:06

How can I keep it from checking piles more than once when it has checked it?

King

2013-01-02 14:59:29

This is exactly my issue with my waterfiend script :P I would love to find the answer!

kyleinkman

2013-01-02 15:56:34

PMed you the code for it

kyleinkman

2013-01-02 16:00:48

with wObject[13] do
begin
name:='Gold Charms';
uptext:=['harm'];
waitTime:=200;
x:= MSCX;
y:= MSCY;
xs:= MSX1;
xe:= MSX2;
ys:= MSY1;
ye:= MSY2-50;
tol:= 2;
dist:= 12;
mouseModX:= 0;
mouseModY:= 0;
mouseRandX:= 1;
mouseRandY:= 1;

color.colorX:= MSCX;
color.colorY:= MSCY;
color.xs:= MSX1;
color.xe:= MSX2;
color.ys:= MSY1;
color.ye:= MSY2-50;
color.CTSModOne:= 0.59;
color.CTSModTwo:= 1.05;
color.startColor:= 6397359;
color.colorTol:= 4;
color.xModS:= 28.01;
color.xModE:= 34.28;
color.yModS:= 30.37;
color.yModE:= 37.11;
color.zModS:= 14.2;
color.zModE:= 17.84;
end;

with wObject[14] do
begin
name:='Crim Charms';
uptext:=['hatm'];
waitTime:=200;
x:= MSCX;
y:= MSCY;
xs:= MSX1;
xe:= MSX2;
ys:= MSY1;
ye:= MSY2-50;
tol:= 2;
dist:= 12;
mouseModX:= 0;
mouseModY:= 0;
mouseRandX:= 1;
mouseRandY:= 1;

color.colorX:= MSCX;
color.colorY:= MSCY;
color.xs:= MSX1;
color.xe:= MSX2;
color.ys:= MSY1;
color.ye:= MSY2-50;
color.CTSModOne:= 0;
color.CTSModTwo:= 0;
color.startColor:= 3821188;
color.colorTol:= 0;
color.xModS:= 12.91;
color.xModE:= 13.11;
color.yModS:= 10.56;
color.yModE:= 10.76;
color.zModS:= 5.28;
color.zModE:= 5.48;
end;

with wObject[15] do
begin
name:='Green Charms';
uptext:=['harm'];
waitTime:=200;
x:= MSCX;
y:= MSCY;
xs:= MSX1;
xe:= MSX2;
ys:= MSY1;
ye:= MSY2-50;
tol:= 2;
dist:= 12;
mouseModX:= 0;
mouseModY:= 0;
mouseRandX:= 1;
mouseRandY:= 1;

color.colorX:= MSCX;
color.colorY:= MSCY;
color.xs:= MSX1;
color.xe:= MSX2;
color.ys:= MSY1;
color.ye:= MSY2-50;
color.CTSModOne:= 0.03;
color.CTSModTwo:= 0.49;
color.startColor:= 8167561;
color.colorTol:= 8;
color.xModS:= 20.08;
color.xModE:= 34.19;
color.yModS:= 25.77;
color.yModE:= 38.95;
color.zModS:= 15.64;
color.zModE:= 34.24;
end;
procedure pickUpGolds();
var
x,y: integer;
begin
wFindObjectMulti([wObject[13],wObject[14],wObject[15]],mouse_left,true,false);
end;