SRL Archive - OSR Outdated Tutorials

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


WT-Fakawi

2006-06-09 21:30:23

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

[PHP]{*******************************************************************************
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;
[/PHP]

QQu

2006-06-09 21:36:27

I like the function too ;)

Might use it in my Up-Comming Scripts :D

Avaphi

2006-06-09 21:37:21

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

2006-06-10 18:27:26

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

2007-06-27 05:46:04

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

2007-06-27 06:45:29

No-one posts much in members. JAD said it's ok to gravedig…

rkroxpunk

2007-06-29 05:27:28

this is part of SRL now isn't it?

Markus

2007-07-01 04:41:23

This is part of SRL. This is in the section with tuts about the SRL functions.

Jagex_Fagex

2007-07-06 08:09:34

thanks again to fawk for great help :)

n3ss3s

2007-07-06 08:29:06

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

2007-07-09 12:49:47

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

2007-07-12 04:58:19

Cool! I didnt even know SRL had this. Im going to bookmark it. :D