Results 1 to 15 of 15

Thread: Finding object problem.

  1. #1
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default Finding object problem.



    This part of my script is driving me crazy.

    Although it clearly doesn't find the sailor, it prints out "Found.". The uptexts are, of course wrong but it still emits a positive result..

    Anyone know why ?

  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    I've realised as well there's been a problem (very) recently with uptexts...

    I use WaitOption() but it just never seems to select the option...

  3. #3
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    I've realised as well there's been a problem (very) recently with uptexts...

    I use WaitOption() but it just never seems to select the option...
    My other case :



    Works perfectly.. Would it only concern NPC uptexts ?

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Happening to me atm.. I just tried running my nature bot.. my god the uptext recognition is totally screwed in castlewars.

    Not sure what's causing it but the font is either broken or all the colours changed :S

    I use the uptext from my waterfiends script now:

    Simba Code:
    {$I SRL/SRL.Simba}

    const
      UptextFS = true;  //UptextFailSafe

    Function FindTextCustom(TextToSearchFor: TStringArray; Box: TBox; Colour, Tolerance: Integer; PrintResult: Boolean; Font: String): boolean;
    var
      Data: string;
      ListOfFonts, AllFonts: TStringArray;
      I, J: Integer;
    begin
      Result:= False;
      AllFonts:= ['BigChars', 'CharsNPC', 'CharsTrade', 'FriendChars', 'LoginChars', 'SmallChars', 'SmallCharsNS', 'StatChars', 'UPChars', 'UpCharsEx', 'XPChars'];

      if (LowerCase(Font) = 'all') then
        ListOfFonts:= AllFonts
      else
        begin
          if (Not InStrArr(Font, AllFonts, false)) then
          begin
            SRL_WARN('FindTextCustom', 'Invalid Font!', 0);
            exit;
          end;
          ListOfFonts:= [Font];
        end;

      For J:= 0 To High(ListOfFonts) do
      begin
        Data:= GetTextAtExWrap(Box.X1, Box.Y1, Box.X2, Box.Y2, 0, 5, 2, Colour, Tolerance, ListOfFonts[J]);
        For I:= 0 To High(TextToSearchFor) do
        begin
          if (TextToSearchFor[I] <> '') then
          begin
            TextToSearchFor[I] := Replace(TextToSearchFor[I], '?', '.');
            Result:= ExecRegExpr('.*'+TextToSearchFor[I]+'.*', Data);
          end;

          if Result then
          begin
            If PrintResult then
              writeln(Data);
            exit;
          end;
        end;
      end;
    end;

    Function FindAllText(Uptexts: TStringArray; Box: TBox; Colours: TIntegerArray; Tolerance: Integer; PrintResults: Boolean; Font: String): Boolean;
    var
      I: Integer;
    begin
      For I:= 0 To High(Colours) do
      begin
        Result:= FindTextCustom(UpTexts, Box, Colours[I], Tolerance, PrintResults, Font);
        If Result then
          exit;
      end;
    end;

    Function UptextsBroken(Uptexts: TStringArray): Boolean;
    var
      ListOfColours: TIntegerArray;
    begin
      If UptextFS then
      begin
        try
        ListOfColours := [14211799, 6667731, 14672351, 1169359, 2721999, 14212565,
                          13751822, 14474972, 13816530, 1803484, 2656464, 3249636,
                          3380704, 2461153, 14803936, 15067364, 13684943, 15198949,
                          15396073, 15593452, 15659246, 14474460, 6338516, 6207445,
                          3552820, 8641269, 8181491, 16645627, 183554, 5941953, 184322,
                          185813];
        Result:= FindAllText(Uptexts, IntToBox(5, 9, 338, 23), ListOfColours, 60, True, 'UpChars');
        except
          Result:= true;
        end;
      end;
    end;

    begin
      SetupSRL;

      If UptextsBroken(['Ring', 'ing']) then
        if UptextsBroken(['ele', 'eleport', 'port']) then
        begin
          //Run some func.
        end;
    end.
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Dervish View Post

    Works perfectly.. Would it only concern NPC uptexts ?
    WaitOption() applies to everything.

  6. #6
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    WaitOption() applies to everything.
    I thought waitoption was for choosing an option ? as in right click options. I've come to the conclusion that UpText recognition works for objects but not NPCs.

  7. #7
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Dervish View Post
    I thought waitoption was for choosing an option ? as in right click options. I've come to the conclusion that UpText recognition works for objects but not NPCs.
    Yes and you can choose an option for almost everything.

    Which means it not just uptext(for NPC's), but text recognition which is broken.

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

    Default

    He's thinking of WaitUpText();
    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.


  9. #9
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    He's thinking of WaitUpText();
    If you're talking about me... nope.

    WaitOption() is broken for me.

    I'll check WaitUpText though...

  10. #10
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    So all text recognition would be broken..? Quite a grave issue, anything I can do ?

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

    Default

    Quote Originally Posted by abu_jwka View Post
    If you're talking about me... nope.

    WaitOption() is broken for me.

    I'll check WaitUpText though...
    He's not choosing an option, he's finding an Object. WaitOption is pointless to use for that and makes no sense.
    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.


  12. #12
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Dervish View Post
    So all text recognition would be broken..? Quite a grave issue, anything I can do ?
    Take a look at the include and see if you can do anything?
    Then send a pull request.

    Otherwise wait...

  13. #13
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Found a temporary solution for my problem : a DTM of the uptext, simple but it works.

    I'm not a good enough scripter to work with text recognition algorithms abu_jwka.

  14. #14
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    He's not choosing an option, he's finding an Object. WaitOption is pointless to use for that and makes no sense.
    I know that. -_-

    I was saying that it's not working for me. I wasn't telling him to use it.

  15. #15
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    I had a similar problem with finding UpText of items in the bank when I was writing my stringer script, may look into just using DTMs of the UpText if this is happening for alot of people.

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
  •