SRL Archive - OSR Help

07 Scape UpText fix with Bitmap?


Le_don

2013-02-28 14:32:00

Is there anyway to use a bitmap to detect Uptext?
Here's my bitmap, uploaded as a PNG.
[ATTACH=CONFIG]19447[/ATTACH]

If not is there a way to specify 07 text for the chars?..

Here's my code:

program FindObject;
{$i SRL\SRL.simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}

var
x, y: Integer;

function FindIron(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.31);

if not(FindColorsTolerance(arP, 2174026, MSX1, MSY1, MSX2, MSY2, 7)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 1.91) and (X <= 6.90) and (Y >= 1.65) and (Y <= 5.76) and (Z >= 1.01) and (Z <= 3.05) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if P07_IsUpTextMultiCustom(['Mine', 'ine', 'ne']) then
begin;
ClickMouse2 (mouse_left);
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;


begin
SetupSRL;
FindIron(x, y);
end.

tealc

2013-02-28 14:41:22

if your using

P07_IsUpTextMultiCustom()
it should use 07 font from dannyRS's unofficial include
if it isn't reading the font correctly try

if P07_IsUpTextMultiCustom(['Mine', 'ine', 'ne','Rock','ock'])

Le_don

2013-02-28 14:46:17

From: bob_saget
if your using

P07_IsUpTextMultiCustom()
it should use 07 font from dannyRS's unofficial include
if it isn't reading the font correctly try

if P07_IsUpTextMultiCustom(['Mine', 'ine', 'ne','Rock','ock'])


Yes that still doesn't work, Is it possible to add a 'else' bitmap fallback?

Le_don

2013-02-28 14:55:17

From: bob_saget
check out the folder simba\fonts\P07UPCHARS

I know they're there I just don't really know what to do.

Le_don

2013-02-28 15:01:31

From: bob_saget
Have you tried right clicking then using
P07_ChooseOptionMultiCustom(['Mine', 'ine', 'ne'])


I'll try that to see if I can get basic functionality, but obviously can't keep this for 100% of the time

Wetish

2013-02-28 15:04:09


SRL_EnableNavBar;
if P07_IsUpTextMultiCustom(['Mine', 'ne', 'ock']) then
begin
ClickMouse2(mouse_left);
end;

Le_don

2013-02-28 15:11:41

From: Wetish

SRL_EnableNavBar;
if P07_IsUpTextMultiCustom(['Mine', 'ne', 'ock']) then
begin
ClickMouse2(mouse_left);
end;

Thanks for this!

Anyway to pick the closest to make it seem less random?

From: bob_saget
upchars should be working soon

Wetish's method seems to work reasonably well. Looks a lot like a colour bot in action though..

Sequence

2013-02-28 15:37:36

Did you get the UpText to work?

Otherwise a solution like this might work, but it's far from as good as using UpText.

procedure MineRock;
begin
Mine := BitmapFromString(bitmapstringhere);
If FindBitmap(Mine, x, y) Then
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
FreeBitmap(Mine);
end;

DannyRS

2013-02-28 15:41:25

From: Prayer94
Anyone who is having uptext issues,

I am 90% sure you have two 07upchars folders one being inside the other, remove the first so that you only have one folder 07upchars with the files inside and providing you can solve the anti leech for the script you are using your clicking will now work :)


Check for this error in your setup guys

Le_don

2013-02-28 17:00:56

From: DannyRS
Check for this error in your setup guys

Don't think this is the case, I unzipped the Chars and placed them in Fonts.

Wasn't a second folder inside that folder..