Results 1 to 19 of 19

Thread: FindText.

  1. #1
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default FindText.

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

    Code:
    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

    Code:
    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.

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

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

    Use
    Simba Code:
    ChooseOption('Drop');

    Unless you don't want to click the drop option...
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Camo Developer View Post
    Instead of this
    Simba Code:
    If FindText(x, y, 'Drop', 'Arial', 563, 237, 734, 494) then

    Use
    Simba Code:
    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

    Code:
    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.
    Last edited by Failure; 11-21-2011 at 01:04 PM.

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    How bout this?

    Simba Code:
    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.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  5. #5
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

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

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

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Hmm, I honestly have no clue.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

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

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

  8. #8
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    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.

  9. #9
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    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?

  10. #10
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    GetTextAtExWrap(

    try that function

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

  11. #11
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by HT BaaFly View Post
    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?

  12. #12
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    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')

  13. #13
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

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

    Code:
    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

    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.

  14. #14
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I might found something intersting

    Code:
    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.

  15. #15
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by Failure View Post
    Thanks it runs, but I'm getting this in the debug box.

    Code:
    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

    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

  16. #16
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Just create a Bitmap about that word.

    ~Home

  17. #17
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Home View Post
    Just create a Bitmap about that word.

    ~Home
    Thanks it worked!

  18. #18
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Failure View Post
    Thanks it worked!
    Great to hear. Remember if it doesn't find it, you can make a Bitmap part of the word too.


    ~Home

  19. #19
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •