SRL Archive - OSR Help

Need fail safe help.


ssshhhaaa

2012-04-24 02:49:03

Ok so ill tell you my problem first.

In my script im clicking the wilderness ditch using.


if findObjCustom(x, y, ['ilderness wall'], [1843493], 30)then
begin
Mouse(x,y,4,4,true);
end;

It most of the time finds the wall and clicks it, but a lot of the time it miss clicks on a NPC or a tree, so i need someway of checking if the chracter as jumped over the ditch or is doing something else and then try to click the ditch again.

Ive tried something like this before but it doesn't seem to work.



if findObjCustom(x, y, ['ilderness wall'], [1843493], 30)then
begin
Mouse(x,y,4,4,true);
end;
if not findObjCustom(x, y, ['ilderness wall'], [1843493], 30)then
begin
MakeCompass('E');
SetAngle(SRL_ANGLE_HIGH);
findObjCustom(x, y, ['ilderness wall'], [1843493], 30)
Mouse(x,y,4,4,true);
end;

But that only works as a fail safe if it doesn't find the colour and so then tries again.

So to sum it up i need something to detect if it has not jumped over the ditch and is instead doing something else (attacking a npc, cutting a tree or is still).

Thank for the help :)

Flight

2012-04-24 02:53:35

I suggest right-clicking and choosing the 'Jump' option (or whatever it is).

TomTuff

2012-04-24 02:54:28

There are a few things you should do differently. First, use better up text.
['ilderness wall']
to
['ilder', 'rness', 'ss wa']

Secondly, do something like


if SomeFunction then
begin
end else
begin
end;

Abu

2012-04-24 02:58:05

Your failsafe wasn't right in the first place.
Should be like this:
if findObjCustom(x, y, ['ilde', 'wall'], [1843493], 30)then
Mouse(x,y,4,4,true)
else
begin
MakeCompass('E');
SetAngle(SRL_ANGLE_HIGH);
findObjCustom(x, y, ['ilde', 'wall'], [1843493], 30)
Mouse(x,y,4,4,true);
end;

ssshhhaaa

2012-04-24 04:11:52

From: Flight
I suggest right-clicking and choosing the 'Jump' option (or whatever it is).


:duh:Why didnt i think of that its so much simpler and more fail proof :/


if findObjCustom(x, y, ['ilde', 'wall'], [1843493], 30)then
Mouse(x,y,4,4,true)
else
begin
MakeCompass('E');
SetAngle(SRL_ANGLE_HIGH);
findObjCustom(x, y, ['ilde', 'wall'], [1843493], 30)
Mouse(x,y,4,4,true);
end;
Thanks ill try something like this but instead right click and choose jump :)

Shatterhand

2012-04-24 07:03:23

For checking wether you passed the wall or not, make the compass to north, and do some color checking under the middle in a fix position.

ssshhhaaa

2012-04-24 07:16:02

From: hunt3rx3
For checking wether you passed the wall or not, make the compass to north, and do some color checking under the middle in a fix position.


Hmm intriguing, I might experiments and test this out a bit. I could add this as an extra fail safe.

Oh and how would you do a colour check on a fixed point on a screen to check if its [aaaaaa] and not [bbbbbb]?

NKN

2012-04-24 20:56:38

Don't check fixed points, very, very bot like, and unreliable. Just have it check the whole screen, more details, might be able to make a better fix.

Shatterhand

2012-04-25 02:32:43

From: NKN
Don't check fixed points, very, very bot like, and unreliable. Just have it check the whole screen, more details, might be able to make a better fix.

How is it bot like to check wether u passed the ditch?

ssshhhaaa

2012-04-25 08:15:31

From: hunt3rx3
How is it bot like to check wether u passed the ditch?


He means checking in an exact position on the wall, that would be considered bot like. It would be better if you moved afew pixels around a centre point though, but i dont know how to do that yet :/