Jump to content
sleep

Couple Problems could use a veterans eyes.

Recommended Posts

I am new to this and this is my first attempt at something real. The particular section of my code that is throwing errors follows.

 

[scar]

{.includes OSI\OSI.scar}

 

var

x, y: Integer;

 

Begin

Repeat

If FindColors(x, y, 262915, 40, 60, 505, 225) then

begin

Mouse(x, y, 0, 0, True);

Wait(2500);

Until(FindColor(x, y, 16776960, 4, 1, 171, 13) = True);

Mouse(49, 9, 0, 0, True);

Wait(5000);

If FindColor(x, y, 999586, 60, 30, 450, 230) then

begin

Mouse(x, y, 0, 0, True);

Wait(300);

Mouse(425, 270, 0, 0, True);

Wait(300);

Else

Writeln('Not Found C');

Mouse(445, 25, 0, 0, True);

Wait(200);

Mouse(328, 17, 0, 0, False);

Wait(200);

Mouse(328, 285, 0, 0, True);

end;

If FindColor(x, y, 1398488, 60, 30, 450, 230) then

begin

Mouse(x, y, 0, 0, True);

Wait(300);

Mouse(425, 270, 0, 0, True);

wait(300);

end;

If FindColor(x, y, 7697797, 60, 30, 450, 230) then

begin

Mouse(x, y, 0, 0, True);

Wait(300);

Mouse(425, 270, 0, 0, True);

Wait(300);

Else

Writeln('Not Found T');

Mouse(445, 25, 0, 0, True);

Wait(200);

Mouse(328, 17, 0, 0, False);

Wait(200);

Mouse(328, 285, 0, 0, True);

end;

end;

end.

[/scar]

 

 

Basically what I am wanting this part to do is:

 

Find color

Click color

Wait Until Color Appears (x,y)

Find color

click color

click coordinate

Find color

click color

click coordinate

Find color

click color

click coordinate

click coordinate

 

I would appreciate any helpful response, does this look appropriate? Is it messy? What am I doing wrong?

Link to comment
Share on other sites

Well, there was at least plenty of logical/syntax errors.. But I cannot exactly tell what you are trying to do.

Anyways, your code should look something like this instead (this compiles):

 

{.include OSI\OSI.scar}

var
 x, y: Integer;

begin
 repeat
   If FindColor(x, y, 262915, 40, 60, 505, 225) then
   begin
     Mouse(x, y, 0, 0, True);
     Wait(2500);
     Mouse(49, 9, 0, 0, True);
     Wait(5000);
     if FindColor(x, y, 999586, 60, 30, 450, 230) then
     begin
       Mouse(x, y, 0, 0, True);
       Wait(300);
       Mouse(425, 270, 0, 0, True);
       Wait(300);
     end else
     begin
       Writeln('Not Found C');
       Mouse(445, 25, 0, 0, True);
       Wait(200);
       Mouse(328, 17, 0, 0, False);
       Wait(200);
       Mouse(328, 285, 0, 0, True);
     end;
     if FindColor(x, y, 1398488, 60, 30, 450, 230) then
     begin
       Mouse(x, y, 0, 0, True);
       Wait(300);
       Mouse(425, 270, 0, 0, True);
       Wait(300);     
     end;
     if FindColor(x, y, 7697797, 60, 30, 450, 230) then
     begin
       Mouse(x, y, 0, 0, True);
       Wait(300);
       Mouse(425, 270, 0, 0, True);
       Wait(300);
     end else
     begin
       WriteLn('Not Found T');
       Mouse(445, 25, 0, 0, True);
       Wait(200);
       Mouse(328, 17, 0, 0, False);
       Wait(200);
       Mouse(328, 285, 0, 0, True);
     end;
   end; 
 until FindColor(x, y, 16776960, 4, 1, 171, 13);
end.

 

Although, you might be after more loops than just that 1. Meaning loops inside that loop. Not sure.

 

-Jani

Link to comment
Share on other sites

Thanks for helping me see the problems I had!

 

I realized that I was trying to do too much with this. I have since separated it out into two pieces.

[scar]

begin

repeat

If FindColor(x, y, 789259, 80, 25, 491, 150) then

begin

Mouse(x, y, 0, 0, True);

Wait(5000);

end;

until (FindColor(x, y, 16776960, 4, 1, 171, 13) = True);

Mouse(49, 9, 0, 0, True);

Wait(1250);

end;

[/scar]

 

and

 

[scar]

Begin

If FindColor(x, y, 999586, 60, 30, 450, 230) then

begin

Mouse(x, y, 0, 0, True);

Wait(300);

Mouse(425, 245, 0, 0, True);

Wait(1000);

end;

begin

Mouse(425, 215, 0, 0, True);

Wait(300);

Mouse(425, 270, 0, 0, True);

wait(1000);

end;

If FindColor(x, y, 7697797, 60, 30, 450, 230) then

begin

Mouse(x, y, 0, 0, True);

Wait(300);

Mouse(425, 245, 0, 0, True);

Wait(1000);

end;

end;

[/scar]

(Note, in this second set of code I use an exact coordinate because I couldn't find my smelted bars and kept coming across my ores.)

 

This seems to have worked out very well but the biggest problem is going to a specific location using the minimap in PRSC.

 

Any ideas on getting from the bank in al kharid to the furnace?

 

Thanks again Jani!

Link to comment
Share on other sites

This seems to have worked out very well but the biggest problem is going to a specific location using the minimap in PRSC.

 

Any ideas on getting from the bank in al kharid to the furnace?

Nope sorry mate, I can't help you with that..

The thing is, reliable(!) minimap walking is just 1 of those things that I haven't figured out yet. :(

I know that there has been some ancient scripts using minimap walking, but I am not aware of the methods or how reliable the walking was. ..but also, those ancient methods could have been working with perfect north.

 

The distance that you are using is not really all that hard to beat though (comparing to longer paths, like walking from Varrock to Falador), because I think you can already see the furnace from bank? IIRC.

 

-Jani

Link to comment
Share on other sites

I did get it working for furnace to bank, but not super reliably. IIRC everyone used to use minimap images for walking. With the super short distance what I did was find a pixel coordinate that clicked inside the bank from the minimap at all extremes of minimap rotation. This works, but was a bit annoying and it WILL mess up eventually which I suppose is better than nothing, especially considering I haven't come across an ocr/sleeper.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...