PDA

View Full Version : function FindObjectMulti(Text1, Text2, Text3 : String; color1, color2, color3, tolera



WT-Fakawi
06-10-2006, 01:30 AM
FindObjectMulti finds an Object using a maximum three different Uptext values i.e.'Att','tta','ack', using max three different colors. It will try to find the Object Turns times, thus restricting the functions mouse movements. Usefull for non crucial Object finding like Bones / Cows / Goblins / Potatoes.

FindObjectMulti is a small loop in itself. Dont use to high Turns values. 4-10 should be sufficient.

Why three Uptexts and Three Colors?

Well because SCAR OCR's isnt 100% and because The RS Client spreads out


{************************************************* ******************************
function FindObjectMulti(Text1, Text2, Text3 : String; color1, color2, color3, tolerance, Turns : Integer; MultiText, MultiTimes : Boolean) : Boolean;
By: Stupid3ooo / Kernel Klink / Mutant Squirrle / WT-Fakawi
Description: Finds Object From Screen Center
************************************************** *****************************}
function FindObjectMulti(Text1, Text2, Text3 : String; color1, color2, color3, tolerance, Turns : Integer; MultiText, MultiTimes : Boolean) : Boolean;
var
x, y, a, c, i, x1, y1, x2, y2, count: Integer;
begin
if (FindMSColorTol(x, y, color1, tolerance)) or
(FindMSColorTol(x, y, color2, tolerance)) or
(FindMSColorTol(x, y, color3, tolerance)) then
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
break;
a := a + 1;
if (a = 1) then
c := c + 1;
if (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end;
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end;
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end;
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if (FindColorTolerance(x, y, color1, x1, y1, x2, y2, tolerance)) or
(FindColorTolerance(x, y, color2, x1, y1, x2, y2, tolerance)) or
(FindColorTolerance(x, y, color3, x1, y1, x2, y2, tolerance)) then
begin
MMouse(x, y, 0, 0);
if (IsUpText(Text1)) or ((IsUpTextMulti(Text1, Text2, Text3)) and (MultiText)) then
begin
Result := True;
Break;
end;
end;
end;
if (a = 4) then
a := 0;
Count := Count + 1;
until ((Count = Turns) and (MultiTimes)) or ((Result = True) and (MultiTimes))
end;
end;

QQu
06-10-2006, 01:36 AM
I like the function too ;)

Might use it in my Up-Comming Scripts :D

Avaphi
06-10-2006, 01:37 AM
use this in your goblin scheduler... better yet, why not instead of searching for colors always, instead just search for text. It wouldnt have to constantly look for goblin colors ! Which would stop ALOT of lag, I notice my comp lags HARD when I run teh GS.

Cheesehunk
06-10-2006, 10:27 PM
I think it would be good for something like a Miner+Banker.

If the text is 'take','mine', or something else it will pick it up!

Hugolord
06-27-2007, 09:46 AM
ya yay! Fakawi explains the function i used in my yew chopper i love this function very accurate :D!

woops srry about grave digging *sigh* srry guys

Santa_Clause
06-27-2007, 10:45 AM
No-one posts much in members. JAD said it's ok to gravedig...

rkroxpunk
06-29-2007, 09:27 AM
this is part of SRL now isn't it?

Markus
07-01-2007, 08:41 AM
This is part of SRL. This is in the section with tuts about the SRL functions.

Jagex_Fagex
07-06-2007, 12:09 PM
thanks again to fawk for great help :)

n3ss3s
07-06-2007, 12:29 PM
su..su.. Surajd!!!!!! When I was a noob I tried like every of your scripts, I remember you from sythe. You had the nice scar scripter rank :)
Brings back memories... :)

GoF
07-09-2007, 04:49 PM
n3ss3s, note the date of surajds post.. 06-09-2006, 08:36 PM.. And surajd was my idol loooong time ago around sythe :D and I think you (n3ss) were called macrowave back then and you released those.. ehm... was it "clarion" scripts :) So many memories :P

Johura
07-12-2007, 08:58 AM
Cool! I didnt even know SRL had this. Im going to bookmark it. :D