Results 1 to 14 of 14

Thread: RSCUpText and RSCOption

  1. #1
    Join Date
    Sep 2006
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default RSCUpText and RSCOption

    Alright, I figured someone might be able to use these

    In order to use these, save it in your includes folder and {.include} it along with {.include srl/srl.scar}


    RSCUpText is called like:

    PHP Code:
    If (RSCUpText('Goblin')) then AttackGoblin
    RSCOption is used like:

    PHP Code:
    RSCOption('What wares'
    These will search for the first 3 letters of the string you enter and either click it(RSCOption) or return True(RSCUpText).

    I only tried it on a few NPC's and didnt have any problems. If anyone has any issues, comments, suggestions, feedback etc. I would love to hear it.

    Enjoy!

    PHP Code:
    //---------------------------------------------------------------//
    //         Procedures and Functions (c) cygo 2009.               //
    //                                                               //
    //         BuildRSCChars : Creates Bitmaps for all letters,      //
    //                         comma, period, and apostrophe.        //
    //         RSCUpText :     Returns True if first 3 letters       //
    //                         of the string are found in UpText.    //
    //         RSCOption :     Will left click the specified         //
    //                         option if first 3 letters are found   //
    //                         in the UpText position.               //
    //---------------------------------------------------------------//


    Procedure BuildRSCChars;
    var 
    RSCC TIntegerArray;
    Begin;
      
    SetArrayLength(RSCC150);
      
    RSCC[39] := BitmapFromString(315'beNpjYMAD/uMADFQHANQjF+k=');
      
    RSCC[44] := BitmapFromString(315'beNpjYKAd+A8GyAwIG04iAAAaiRH' +
           
    'v');
      
    RSCC[46] := BitmapFromString(315'beNpjYKAd+A8GyAycAACu5gv1');

      
    RSCC[65] := BitmapFromString(815'beNpjYKAu+A8DxIjDRdCkqCL+Hxs' +
           
    'gw0zqAAAfWm6S');
      
    RSCC[66] := BitmapFromString(815'beNpjYKAW+I8BkMXRlJEtTn/zqQM' +
           
    'Alqd9gw==');
      
    RSCC[67] := BitmapFromString(815'beNpjYKAu+I8E0ATR2GhqsCqmhTg' +
           
    'u9+BxPxUAAD4wTbM=');
      
    RSCC[68] := BitmapFromString(815'beNpjYKAW+I8K0MTxs5G59BTHZGO' +
           
    '6nzoAAFtycY8=');
      
    RSCC[69] := BitmapFromString(715'beNpjYKAQ/McAcEGsKokXpIOZFAE' +
           
    'AA0xZpw==');
      
    RSCC[70] := BitmapFromString(615'beNpjYCAP/EcFcBFMNcSIUMscBgo' +
           
    'BABc4R7k=');
      
    RSCC[71] := BitmapFromString(815'beNpjYKAu+I8E0ATR2GhqsCrGJY5' +
           
    'sBS67iHEDLmW43EA+AAC2YGKe');
      
    RSCC[72] := BitmapFromString(815'beNpjYKAW+A8GmFzqiqMBOthLHQA' +
           
    'A9+N0jA==');
      
    RSCC[73] := BitmapFromString(315'beNpjYMAD/oMBFRk4AQAwHDXL');
      
    RSCC[74] := BitmapFromString(715'beNpjYKAi+A8G9BRElsUvCGdjNZA' +
           
    'cAADib0e5');
      
    RSCC[75] := BitmapFromString(815'beNpjYKAW+A8GmFxkcaxsrBrhAJc' +
           
    '4fjOJZBN0BtVCBwDhCHSM');
      
    RSCC[76] := BitmapFromString(715'beNpjYKAQ/AeDoSKIDCj1OQCom0G' +
           
    '/');
      
    RSCC[77] := BitmapFromString(1015'beNpjYKAd+A8DWEWIlCWbC2Egk6' +
           
    'TK4hIkKAs3Fk2QJgAAwJOwUA==');
      
    RSCC[78] := BitmapFromString(815'beNpjYKAW+A8GmNz/MECqODIXjYF' +
           
    'LHKtGNLuIEcfkUgoAk/6Geg==');
      
    RSCC[79] := BitmapFromString(915'beNpjYKAR+I8EMMXxs9FE6ClFpKs' +
           
    'wxakJAB8ia5U=');
      
    RSCC[80] := BitmapFromString(815'beNpjYKAW+I8BkMXRlFFdnKC9mBq' +
           
    'JFKcOAADrxWWb');
      
    RSCC[81] := BitmapFromString(915'beNpjYKAR+I8EMMXxs9FEaCqFVYS' +
           
    'gq7B6DTMEyAw7AITmdIw=');
      
    RSCC[82] := BitmapFromString(815'beNpjYKAW+I8BkMXRlJEtjt98Ktq' +
           
    'LVYR8AACFnHeJ');
      
    RSCC[83] := BitmapFromString(815'beNpjYKAi+I8KkAXR1GCKYzWEGPO' +
           
    'J0YjHXkyn4jGEfAAAj9tomA==');
      
    RSCC[84] := BitmapFromString(715'beNpjYKAQ/McAaFJY1Q8qQTIBAGJ' +
           
    'EQb8=');
      
    RSCC[85] := BitmapFromString(815'beNpjYKAW+A8GmNyhIg5nwwEDFQE' +
           
    'ApPBukg==');
      
    RSCC[86] := BitmapFromString(815'beNpjYKAW+P//P6YIHKAJIjOIFKd' +
           
    'EL5o4sttwuZmBugAADzJing==');
      
    RSCC[87] := BitmapFromString(1215'beNpjYKAn+P//PzIbAsgTgQj+Rw' +
           
    'VwETozKPcOSSJ0AgC2YrxE');
      
    RSCC[88] := BitmapFromString(815'beNpjYKAW+A8GmFxc4gTVwAGmLbg' +
           
    'EiXEDGe6kAgAAw99ukg==');
      
    RSCC[89] := BitmapFromString(715'beNpjYKAQ/P//H40LB8giyAysbGQ' +
           
    'RTDU0FSQTAADHJUq2');
      
    RSCC[90] := BitmapFromString(715'beNpjYKAQ/McAWBWQKkJdjcS4k2Q' +
           
    'AAPTbTbM=');
      
    RSCC[97] := BitmapFromString(715'beNpjYKAn+I8E4CJosvgVQ9iYDIK' +
           
    'CaAYiW0QmAAANi1Ot');
      
    RSCC[98] := BitmapFromString(715'beNpjYKAQ/AcDkgSRZf/DAH4FZAj' +
           
    'iMhOr28gBAA9qZZs=');
      
    RSCC[99] := BitmapFromString(715'beNpjYKAn+I8EkEXQ2MiCaHpJFcR' +
           
    'kY9VCDgAAfKtBvw==');
      
    RSCC[100] := BitmapFromString(715'beNpjYKAi+A8GeAThbFwMNEGsKo' +
           
    'kXRDYTly7yAQAmRWWb');
      
    RSCC[101] := BitmapFromString(715'beNpjYKAn+I8EkEXQ2HgE0UxAVo' +
           
    'lmCy42Vi3kAABCclOt');
      
    RSCC[102] := BitmapFromString(415'beNpjYCAS/EcFaIJwNrI4eWzCAA' +
           
    'D/2zvF');
      
    RSCC[103] := BitmapFromString(715'beNpjYKAn+A8GeBhoglhVEi+IbC' +
           
    'YuBZhuQ9aIrAAdAADmFG6S');
      
    RSCC[104] := BitmapFromString(715'beNpjYKAQ/AcDkgSRZf/DAH4FNB' +
           
    'KkCAAA3n5ing==');
      
    RSCC[105] := BitmapFromString(315'beNpjYMAD/oMBVhHyGDgBAPsmL9' +
           
    'E=');
      
    RSCC[106] := BitmapFromString(315'beNpjYMAD/oMBVhHKGSg2AQCugT' +
           
    'jI');
      
    RSCC[107] := BitmapFromString(715'beNpjYKAQ/AcDUgXhbEwGnI1myH' +
           
    '9UgMscghbhch7JAACotGKe');
      
    RSCC[108] := BitmapFromString(315'beNpjYMAD/oMBFRk4AQAwHDXL');
      
    RSCC[109] := BitmapFromString(1115'beNpjYBgS4D8YwBnIbGQFeNRgK' +
           
    'sZq8sAqoDkAAI+xhno=');
      
    RSCC[110] := BitmapFromString(715'beNpjYKAb+A8GyAw4G00cUwGNBC' +
           
    'kCAMz1Vqo=');
      
    RSCC[111] := BitmapFromString(715'beNpjYKAn+I8EkEXQ2LQQxGo7RQ' +
           
    'AAoQVTrQ==');
      
    RSCC[112] := BitmapFromString(715'beNpjYKAb+A8GyAw4G00cUwEZgr' +
           
    'jMxKoFqzsJAAA7v2Wb');
      
    RSCC[113] := BitmapFromString(715'beNpjYKAn+A8GeBhoglhVEi+IbC' +
           
    'YuXZhuIygIBQBSmmWb');
      
    RSCC[114] := BitmapFromString(515'beNpjYKAi+I8E4Fw0WapwSQAAsD' +
           
    'wv0Q==');
      
    RSCC[115] := BitmapFromString(715'beNpjYKAn+I8EkEXQ2Ghq8GjHlM' +
           
    'JlJn7t5AAAcQtNsw==');
      
    RSCC[116] := BitmapFromString(415'beNpjYCAS/P//H85AY0O4mOLEsz' +
           
    'G5+AAAz+E1yw==');
      
    RSCC[117] := BitmapFromString(715'beNpjYKAb+A8GaGyaCv6HATy6yA' +
           
    'cApQ9Wqg==');
      
    RSCC[118] := BitmapFromString(615'beNpjYKAd+P//PzIbAjBFIIIkMf' +
           
    'AbSL6LAZQ8R7k=');
      
    RSCC[119] := BitmapFromString(1015'beNpjYBic4D8YwNlogmgMrILEy' +
           
    'CKTaLZgmkC8LC4uTQAAdIZ6hg==');
      
    RSCC[120] := BitmapFromString(715'beNpjYKAb+A8GaGysgnA2sgimGl' +
           
    'wqSbKIfAAAcQtNsw==');
      
    RSCC[121] := BitmapFromString(615'beNpjYKAd+P//PzIbAjBFIIIkMf' +
           
    'AbiCaCi4sFAABmhlOt');
      
    RSCC[122] := BitmapFromString(615'beNpjYKAd+I8KMKWI5BKvAKtdJA' +
           
    'AAXC47xQ==');
    End;

    Function 
    RSCUpText(RSCText String) : Boolean;
     var
      
    RSCTextArray TStringarray;
      
    ijInteger;
    begin;
     
    Result := False;
     
    BuildRSCChars;
     
    := 0;
     
    := 0;
     
    := 0;
      
    SetArrayLength(RSCTextArray50);
      
    Repeat;
       
    i:=i+1;
       
    Begin
        RSCTextArray
    [i] := StrGet(RSCTexti);
       
    End;
      
    Until(Length(RSCText));
      
    MouseSpeed:=16;
      
    := 1;
      While(
    138) Do
       
    Begin;
        If (
    RSCTextArray[1] = Chr(i)) and (FindBitmapMaskTolerance(RSCC[i], xy1310146417575)) then
         
    While(138) Do
          
    Begin;
           If (
    RSCTextArray[2] = Chr(j)) and (FindBitmapMaskTolerance(RSCC[j], xy1340153417575)) then
            
    While(138) Do
             
    Begin
              
    If (RSCTextArray[3] = Chr(k)) and (FindBitmapMaskTolerance(RSCC[j], xy1370160417575)) then
               Begin
    ;
                
    Result := True;
                
    := 137;
                
    := 137;
                
    := 137;
               
    End;
              
    := 1;
             
    End;
           
    := 1;
          
    End;
         
    := 1;
        
    End;
    end;



    Procedure RSCOption(RSCText String);
     var
      
    RSCTextArray TStringarray;
      
    ijInteger;
    begin;
     
    BuildRSCChars;
     
    := 0;
     
    := 0;
     
    := 0;
      
    SetArrayLength(RSCTextArray50);
      
    Repeat;
       
    i:=i+1;
       
    Begin
        RSCTextArray
    [i] := StrGet(RSCTexti);
       
    End;
      
    Until(Length(RSCText));
      
    MouseSpeed:=16;
      
    MMouse(622,28,10,10);
      
    := 48;
      While(
    138) Do
       
    Begin;
        If (
    RSCTextArray[1] = Chr(i)) and (FindBitmapMaskTolerance(RSCC[i], xy1310146417575)) then
         
    While(138) Do
          
    Begin;
           If (
    RSCTextArray[2] = Chr(j)) and (FindBitmapMaskTolerance(RSCC[j], xy1340153417575)) then
            
    While(138) Do
             
    Begin
              
    If (RSCTextArray[3] = Chr(k)) and (FindBitmapMaskTolerance(RSCC[j], xy1370160417575)) then
               Begin
    ;
                
    Mouse(Random(15), 733True);
                
    := 137;
                
    := 137;
                
    := 137;
               
    End;
              
    := 1;
             
    End;
           
    := 1;
          
    End;
         
    := 1;
       
    End;
    end

  2. #2
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Pretty nice ^^. I don't have the energy to put in the svn , maybe awkward saw will do it. Or someone else who has teh powers!
    I do visit every 2-6 months

  3. #3
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    i will be GLAD to commit these but first you have to test it more, make sure 100% that the chars work on objects, npc's, items actions ect.

    also it would be nice if you can find the entire uptext, intead of the first 3 letters

    or to even just make a find text function, and use that for all the functions
    Last edited by Awkwardsaw; 12-02-2009 at 03:19 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  4. #4
    Join Date
    Sep 2006
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I wanted to search for the whole string, and It wouldnt be that hard to change at all but I cant get GetBitmapSize to work. Everytime I call it scar just goes in to an endless loop and I have to close it. I cant use the same type of searching for a lot of chars as I did for 3 because right now it just searches a box, the first letter area of each option and then searches a box to the right of it a little, and then a box to the right of that a little. Because not all the characters are the same size I cant just increment it the same each time and have it work correctly, and since GetBitmapSize isnt working, I cant give it a specific distance to move the searching area.

  5. #5
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    You could load the text like all the other texts are loaded..
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  6. #6
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Very nice! Good job
    Everything could be written quite much shorter though. I think :P

    Edit: Like:
    SCAR Code:
    procedure BuildRSCChars;
    var
      I: Integer;
      S: TStringArray;
      bmp: TIntegerArray;
    begin
      S := GetFiles(AppPath + 'Fonts\ClassicCharsOld\', 'bmp');
      SetLength(bmp, Length(S));
      for I := 0 to High(S) do
        bmp[I] := LoadBitmap(AppPath + 'Fonts\ClassicCharsOld\' + S[I]);
    end;
    or
    SCAR Code:
    procedure BuildRSCChars;
    var
      I: Integer;
      S: TStringArray;
      bmp: TIntegerArray;
    begin
      S := GetFiles(AppPath + 'Fonts\ClassicCharsOld\', 'bmp');
      SetLength(bmp, 130);
      for I := 0 to High(S) do
        bmp[StrToInt(GetNumbers(S[I]))] := LoadBitmap(AppPath + 'Fonts\ClassicCharsOld\' + S[I]);
    end;
    Below does it your style.

    Quote Originally Posted by Nava2 View Post
    You could load the text like all the other texts are loaded..
    Didn't work. Atleast for me

  7. #7
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Wow just what was needed, im making an auto fighter now, muahaha i will definitly use these.

  8. #8
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Camaro' View Post
    Wow just what was needed, im making an auto fighter now, muahaha i will definitly use these.
    i thought we where making one

    and nava, for some reason the current rsc chars dont work, and we failed when we loaded it our selves

    one more thing, there has to be a way to make those other two functions shorter, and more effecient?
    Last edited by Awkwardsaw; 12-02-2009 at 01:16 PM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  9. #9
    Join Date
    Sep 2006
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could use an array for the loop counter, for each nested loop, and also need to get FindBitmapSize working. Does it work for anyone else?

    And I didnt even see the LoadBitmap function, thats freaking awesome and Ill definately change it.

  10. #10
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Awkwardsaw View Post
    i thought we where making one

    and nava, for some reason the current rsc chars dont work, and we failed when we loaded it our selves

    one more thing, there has to be a way to make those other two functions shorter, and more effecient?
    OF COURSE WE ARE

    We can start tonight if were not busy.

  11. #11
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by cygo View Post
    You could use an array for the loop counter, for each nested loop, and also need to get FindBitmapSize working. Does it work for anyone else?

    And I didnt even see the LoadBitmap function, thats freaking awesome and Ill definately change it.
    Yup I tested and it worked...I dont have much time to this as my family will be moving on saturday..

  12. #12
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Camaro' View Post
    OF COURSE WE ARE

    We can start tonight if were not busy.
    im not busy
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  13. #13
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Going quite off topic but I have auto fighter too :P Ill finish and release it when ever I have the time...

  14. #14
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Does this work for anyone else, or am I the only person having issues.

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
  •