SRL Archive - OSR Help

How would i do this?


lolhahauad

2011-11-19 22:07:06

Ok, since im not that much experienced with simba.. how would i do something along these lines?


if(posequals [cords, cords]) then
mouse(x, y, 0, 1, false);

probably easy.. just can't think of it >.<

RISK

2011-11-19 22:14:37

Something like:
if ((X = 0) and (Y = 0)) then
begin
end;

Or are you looking to find an object on the screen and move your mouse to it?

lolhahauad

2011-11-19 22:17:45

Ah thanks.. that might work ;).. let me go test it, hold up :)

what about the opposite? like, if im not in that cords, how would i do that?

RISK

2011-11-19 22:23:27

Then it would be this:
if ((not(X = 0) and (not(Y = 0)))) then
begin
end;

From: lolhahauad
Ah thanks.. that might work ;).. let me go test it, hold up :)

what about the opposite? like, if im not in that cords, how would i do that?

lolhahauad

2011-11-19 22:29:46

Procedure 403;
var x, y:integer;
begin
if ((X = 259) and (Y = 180)) or
((X = 267) and (Y = 183)) then
if findobj(x, y, 'ride', 2041912, 10) then
mouse(x, y, 0, 0, true);
wait(1000);
end;


Shouldn't that work? What im reading is, if the player is in the coords 259, 180 or 267, 103 then the player would find a obj with ride in it and left click it then wait 1 second?

It doesn't seem to work though :/.. yes i did put 403; in my main loop

RISK

2011-11-19 22:32:50

Try this:
procedure Example;
var mX, mY : Integer;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
// Never use the first word of the object you are trying to find; it's slow.
if FindObj(mX, mY, 'ide', 2041912, 10) then
begin
Mouse(mX, mY, 4, 4, True);
Wait(1000); // I suggest you change this.
end;
end;

"FindObj" searches the screen for the object with the parameters you chose. You don't need to specifically locate the coordinates yourself.

lolhahauad

2011-11-20 09:54:55

Well, i kinda want it to be in a specific area before it finds the obj :/.. ;s

So should i use findSprialColorTolerance for that?

DeSnob

2011-11-20 11:20:42

I also had to do something like that. You are correct about FindColor function, although I use a different one. This is what I had to do to correctly find a chicken pen on the minimap using just colors.

FindColorsSpiralTolerance(MMCX, MMCY, TPA, 15660776, MMCX-100, MMCY-100, MMCX+100, MMCY+100, 3);
It will start its search from the middle of the minimap, and search in a box 100 by 100 surrounding it.

Also, don't forget to use ACA to make accurate object finding procedures. You'll need hue and sat mods. This is explained in the Advanced Section of the tutorial forum.

lolhahauad

2011-11-20 11:23:23

From: DeSnob
I also had to do something like that. You are correct about FindColor function, although I use a different one. This is what I had to do to correctly find a chicken pen on the minimap using just colors.

FindColorsSpiralTolerance(MMCX, MMCY, TPA, 15660776, MMCX-100, MMCY-100, MMCX+100, MMCY+100, 3);
It will start its search from the middle of the minimap, and search in a box 100 by 100 surrounding it.

Also, don't forget to use ACA to make accurate object finding procedures. You'll need hue and sat mods. This is explained in the Advanced Section of the tutorial forum.


Hmm.. thats fairly interesting.. I'll see what I can do, thanks for that information btw ;)

DeSnob

2011-11-20 11:25:26

From: lolhahauad
Hmm.. thats fairly interesting.. I'll see what I can do, thanks for that information btw ;)


I gave you the wrong link, but fixed it. Just search for ACA2 or click the link in my post.

lolhahauad

2011-11-20 11:42:47

FindColorsSpiralTolerance(MMCX, MMCY, TPA, 15660776, MMCX-100, MMCY-100, MMCX+100, MMCY+100, 3);

So that means, it'll be searching for a color, of 15660776 in a 100 by 100 box with a color tolerance of 3?

DeSnob

2011-11-20 11:48:19

From: lolhahauad
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 15660776, MMCX-100, MMCY-100, MMCX+100, MMCY+100, 3);

So that means, it'll be searching for a color, of 15660776 in a 100 by 100 box with a color tolerance of 3?


Yes, it'll search in a box surrounding the center of the minimap (MMCX, MMCY) in a 200 by 200 box (sorry, got that wrong before.) with that color and tolerance. :)

E: You can also use MSCX/Y(mainscreen) and MICX/Y(inventory)

Also, for something like this you'll need TPAs/ATPAs.