SRL Archive - Help

FindText.


Failure

2011-11-21 07:52:30

Hello, I want to use this function in a Private Server if possible.

program New;

{$i SRL/SRL.scar}



var x,y:Integer;




begin



SetupSRL;

MMouse(585, 259, 0, 0);
Wait(100);
Mouse(585, 259, 0, 0, False);
If FindText(x, y, 'Drop', 'Arial', 563, 237, 734, 494) then
WriteLn('Found!');
MMouse(x, y, 0, 0);
end.

The text : http://screensnapr.com/v/BfFhvx.png

It compiles fine, but doesn't work therefore Simba opens a new Tab and gives me this

function CreateBitmapMaskFromText(txt,chars : string) : integer;
begin
result := BitmapFromText(txt,chars);
end;

And I have no clue how to get it to work, since I never used Bitmaps.

Kyle Undefined

2011-11-21 07:57:59

Instead of this
If FindText(x, y, 'Drop', 'Arial', 563, 237, 734, 494) then

Use
ChooseOption('Drop');

Unless you don't want to click the drop option…

Failure

2011-11-21 08:00:08

From: Camo Developer
Instead of this
If FindText(x, y, 'Drop', 'Arial', 563, 237, 734, 494) then

Use
ChooseOption('Drop');

Unless you don't want to click the drop option…


I run it, it goes to there, well to the log but it doesn't drop nor move to the option it simply moves offscreen then, remember this is a Runescape Private Server I'm not sure if that makes a diffrence?

Edit : Doesn't seem to detect the text I done this

begin

SetupSRL;

MMouse(585, 259, 0, 0);
Wait(100);
Mouse(585, 259, 0, 0, False);
If ChooseOption('Drop') then
WriteLn('Works!');
end.

Nothing apperead in the Debug box.

Kyle Undefined

2011-11-21 08:04:28

How bout this?


program New;
{$i SRL/SRL.scar}

var
x, y : Integer;

begin
SetupSRL();
Mouse(585, 259, 0, 0, False);
Wait(RandomRange(250, 500));
ChooseOption('Drop');
end.

Failure

2011-11-21 08:07:08

Nothing, it just moves to the cords, but then it doesn't pick the Drop text?

http://screensnapr.com/v/3FpPmt.png

Kyle Undefined

2011-11-21 08:07:45

Hmm, I honestly have no clue.

Failure

2011-11-21 08:10:45

I hope someone elses knows a method cause it would be so usefull ! :D

Edit : Tested it on real Runescape, it works on that someone knows how to make it work with all textes?

i luffs yeww

2011-11-21 09:44:04

It's definitely because whatever PS you're using isn't using the correct fonts for some reason. There's no reason SRL should include those fonts, as we're not aimed at working on every single private server there is.

Failure

2011-11-21 10:35:55

From: i luffs yeww
It's definitely because whatever PS you're using isn't using the correct fonts for some reason. There's no reason SRL should include those fonts, as we're not aimed at working on every single private server there is.


Makes sense, but I assume it's not hard to have a option to implent custom fonts right, so it will be universal with other games? :)

HT BaaFly

2011-11-21 11:16:44

GetTextAtExWrap(

try that function

use an if statement first to determine if it's on screen

Failure

2011-11-21 11:26:07

From: HT BaaFly
GetTextAtExWrap(

try that function

use an if statement first to determine if it's on screen


the whole GetTextAtExWrap, doesn't work? Might doing something wrong, as I said i'm new to it, could you give me a better example?

HT BaaFly

2011-11-21 11:30:49

function GetTextAtExWrap(const xs,ys,xe,ye, minvspacing, maxvspacing, hspacing,color, tol: integer;const font: string): string;

e.g. for finding the text at a certain location in G.E.:
GetTextAtExWrap(296, 186, 440, 199, 0, 10, 1, 6400255, 5, 'UpChars')

Failure

2011-11-21 11:37:27

Thanks it runs, but I'm getting this in the debug box.

Error: Exception: Font [Drop] not found. at line 15
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]

My code

begin
SetupSRL;
MMouse(587, 257, 0, 0);
Wait(100);
Mouse(587, 257, 0, 0, False);
GetTextAtExWrap(555, 236, 744, 344, 0, 10, 1, 13034990, 5, 'Drop');
end.

Failure

2011-11-21 12:21:37

I might found something intersting

ChooseOptionEx

function ChooseOptionEx(Txt, TextType: string): Boolean;

Finds an option in a popup menu, then clicks on it. Searches for TextType. See ChooseOptionMultiEx for valid options. Default is ‘all’

Will try this as soon I'm on my Pc again.

HT BaaFly

2011-11-21 12:46:10

From: Failure
Thanks it runs, but I'm getting this in the debug box.

Error: Exception: Font [Drop] not found. at line 15
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]

My code

begin
SetupSRL;
MMouse(587, 257, 0, 0);
Wait(100);
Mouse(587, 257, 0, 0, False);
GetTextAtExWrap(555, 236, 744, 344, 0, 10, 1, 13034990, 5, 'Drop');
end.


for the end bit you don't write Drop at the end but the actual font used in the text you're trying to get

Writeln(GetTextAtExWrap(555, 236, 744, 344, 0, 10, 1, 13034990, 5, 'One of the many fonts. e.g. BigChars'));

A list of all fonts recognizable by simba can be found at Simba\Fonts. Try each one until you get to the right one. output should be drop, btw

Home

2011-11-21 12:48:32

Just create a Bitmap about that word.

~Home

Failure

2011-11-21 14:05:54

From: Home
Just create a Bitmap about that word.

~Home


Thanks it worked! :D

Home

2011-11-21 14:50:58

From: Failure
Thanks it worked! :D


Great to hear. Remember if it doesn't find it, you can make a Bitmap part of the word too.


~Home

Failure

2011-11-21 15:10:14

I did used Bitmap to find the "Drop" option, so I assume, I'll be fine now this is very helpful ! :)