PDA

View Full Version : Finding Color and UpText



I Pick Axes
10-14-2006, 11:49 PM
procedure JumpStile;
begin
x := 389;
y := 323;
repeat
FindColorTolerance(x,y,StileMS,6,3,510,337,5);
MMouse(x,y,4,4);
until (IsUpText('limb'));
Mouse(x,y,5,5,true);
end;

I intended for it to find the stile (in the cabbage patch) along the fence.
The whole thing is one color, so what it was supposed to do was:

Find a color.
If it's the stile, jump it.
If not, find the next instance of the color.
Until the stile is found.
Loop if not found.

Instead, it just hovers the mouse around one area (a bit too east of the stile), when I want it to mouse over all the pixels of that color.

Help please.

Home
10-15-2006, 12:15 AM
Function JumpStile :boolean;
Var x,y :integer;
begin
x := 389;
y := 323;
repeat
Wait(1+random(1))
Until((FindColorTolerance(x,y,StileMS,6,3,510,337, 5))
if(FindColorTolerance(x,y,StileMS,6,3,510,337,5))t hen
MMouse(x,y,4,4);
if(isuptext('limb'))
then
begin
Mouse(x,y,5,5,true);
Result:=True;
end
else begin
repeat
JumpStile
Until(Result)

end;
end:
end;


I am not home atm :S so no scar i use notebad so i am not sure does it compile :S :P

da_professa
10-15-2006, 02:10 AM
i tried ur script for my problemm... I mean the ending bit to find text.. But it just doesnt seem to click on it.....

I Pick Axes
10-15-2006, 02:17 AM
Well, what I posted here is something I'm trying to get fixed, something broken. Why you are borrowing broken code is beyond me.

But in general, what you do is
Do
FindColorTolerance
-es until you get
IsUpText
something.

If you want a more specific answer, I'd need to know what you were doing.

My question still stands if anyone knows how to make it so I get the stile eventually, and not have FindColorTolerance just go around one area far away from the stile and keep MMouse-ing near there.

IronTeapot
10-15-2006, 04:46 AM
After alot of editing this post try this:


var StileMS: Integer;
{.include srl/srl.scar}
procedure JumpStile;
begin
x := 389;
y := 323;
StileMS:=3161928;
repeat
FindColorSpiral(x,y,StileMS,6,3,510,337);
MMouse(x,y,4,4);
until (IsUpText('limb'));
Mouse(x,y,1,1,true);
end;

begin
SetupSRL;
JumpStile;
End.

It works 95% of the trials. just depends on if it finds the stile or the spot a bit to the right first.

Junior
10-15-2006, 05:01 AM
Ironteapot us isuptextmulti('','','') for better finding
~jR

Home
10-15-2006, 09:18 AM
Sorry :) i didn't get what you meaned :( :wink:


EDIT:

There :)

program dd;
{.include srl/srl.scar}
const StileMS = 2510442 ; //

procedure JumpStile;
begin
x := 389;
y := 323;
repeat
wait(10+Random(10))
FindColorSpiral(x,y,StileMS,6,3,510,337);
MMouse(x,y,0,0);
if(IsUpTextMulti('C', 'limb', 'imb'))
Then Mouse(x,y,1,1,false)
Wait(200+Random(100))
until(Chooseoption(x,y,'Climb'))
end;


begin
SetupSRL;
JumpStile;
End.

I Pick Axes
10-16-2006, 01:14 AM
Oh, wait. I left the word Spiral out. That may be it.
(Just finished homework and going to meddle with the script now.)

IronTeapot
10-16-2006, 02:08 AM
Cool, I hope I helped somewhat. Like you have helped me :)

da_professa
10-16-2006, 06:11 AM
hey! this might help me out also..thx guyz..

YoHoJo
10-16-2006, 06:46 AM
Findboj pl0x?
FindObj(cz,cy,'Text',Color,Toleracne)

Wizzup?
10-16-2006, 07:26 AM
Put a wait between the "mouse" and the UpText.

I Pick Axes
10-16-2006, 09:55 PM
I never got FindObj to work, weirdly. It would mouse over the stile, but looked kinda undecided, because it kept moving around over it.

Wizzup, I'll try that after homework.