View Full Version : FindText.
Failure
11-21-2011, 12:52 PM
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
11-21-2011, 12:57 PM
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
11-21-2011, 01:00 PM
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
11-21-2011, 01:04 PM
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
11-21-2011, 01:07 PM
Nothing, it just moves to the cords, but then it doesn't pick the Drop text?
http://screensnapr.com/v/3FpPmt.png
Kyle Undefined
11-21-2011, 01:07 PM
Hmm, I honestly have no clue.
Failure
11-21-2011, 01:10 PM
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
11-21-2011, 02:44 PM
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
11-21-2011, 03:35 PM
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
11-21-2011, 04:16 PM
GetTextAtExWrap(
try that function
use an if statement first to determine if it's on screen
Failure
11-21-2011, 04:26 PM
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
11-21-2011, 04:30 PM
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
11-21-2011, 04:37 PM
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
11-21-2011, 05:21 PM
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
11-21-2011, 05:46 PM
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
Just create a Bitmap about that word.
~Home
Failure
11-21-2011, 07:05 PM
Just create a Bitmap about that word.
~Home
Thanks it worked! :D
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
11-21-2011, 08:10 PM
I did used Bitmap to find the "Drop" option, so I assume, I'll be fine now this is very helpful ! :)
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.