Results 1 to 13 of 13

Thread: Help with tut script

  1. #1
    Join Date
    Sep 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with tut script

    While completing a tut on scripting on the forum i came across an error when i start this script. (btw it is a bitmap finding script).

    Code:
    program New;
    
    var
     pickaxe1: integer;
    
    procedure loadbitmap;
    begin
     pickaxe1 := BitmapFromString(29, 30, 'beNpjYCAOMOrJs5oos1lr' +
           'sDvosAO5DKQBRlzI2j/COSrFMzEnILscyDVQUCDeQCNnL1zIzDPQN' +
           'ijaMTwxtKieOGMRBuo7uONCalIswEAAOtg+JA7mBXzAxM0PiDCN1b' +
           'VxhiM5EWZg2AIRxFigs4GIkOGMBBHQqWjGWvqEQEIbj8nAgMKFgLr' +
           'gTkUzFhjaQARkQCKRxOSBcCoQwd0PMRYSekASyI2p7iDaZHQzkX0B' +
           'QZBYABoODBOiEx7CWLiZaEEHNx/oZlgiIdmpeKIGYjgwYRMymRHT+' +
           '/jdATEcr0qEU4EMUnIrA16VJDuVvATAQAVAW6dSz0yEU0mNqQF0Kn' +
           'Vjaug4FWEsdZ0KCQFghUVdp0KMpapTGSCVC1XTKsJYIKK2sVDDqRo' +
           'CaOX8YAUAtihtew==');
     end;
     procedure FBitmap;
     Var
     x, y :integer;
     begin
     FindBitmapToleranceIn(pickaxe1, x, y, 676, 714, 391, 429, 25);
    end;
    begin
    FBitmap;
    end.
    when i press 'Run' i get the following error
    [Runtime Error] : Exception: Access violation at address 006D5C2B in module 'scar.exe'. Read of address 00000000 in line 25 in script
    Any help would be great (h)

  2. #2
    Join Date
    Oct 2007
    Location
    The deep web
    Posts
    2,496
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    it wont run until its finish, add this at the very top

    "{.include srl/srl.scar}"
    and u need a main loop which is this:

    "begin
    setupScript;
    if (not (LoggedIn)) then
    begin
    Loginplayer;
    setangle(true);
    Wait(500 + random(30)) SetChat('on', 1);
    SetChat('friends', 2);
    SetChat('off', 3);
    end;
    repeat
    AntiRandom;
    AntiBanage;
    if not (loggedIn) then
    begin
    logout;
    nextplayer(false);
    LoginPlayer;
    end;
    //end;
    begin
    logout;
    if howManyPlayers = 1 then
    wait(random(60));
    nextplayer(true);
    LoginPlayer;
    end;
    until (false);
    end."
    Did someone say GDK?

  3. #3
    Join Date
    Sep 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im not making a auto im just testing to see if this works,
    but do i really have to add all those to the script for it to work??

    Edit: when i add {.include srl/srl.scar} at the top i get this error
    Line 2: [Error] (16110:1): 'BEGIN' expected in script

  4. #4
    Join Date
    Oct 2007
    Location
    The deep web
    Posts
    2,496
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    what do expect it to do with the bitmap?
    Did someone say GDK?

  5. #5
    Join Date
    Sep 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok, well the tut has told me that this will search for the bitmap that i had selected. which was bitmap of rune pickaxe.

  6. #6
    Join Date
    Sep 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need to put the include underneath your program name, not at the very top:
    Code:
    Program New;
    {.Include Srl/Srl.scar}
    
    Begin//Main Loop
    End.

    Also you made the procedure to load a bitmap but you never actually loaded it in your mainloop. If you only want to call the procedure FBitmap in your mainloop then you need to call LoadBitmap inside of FBitmap, before you tell the script to find your bitmap. If you don't load the bitmap into the variable Pickaxe1 then Pickaxe1 won't have the value of your bitmap and you won't be able to find it as a result.

    Here is how you should call your bitmap:
    Code:
    Program New;
    
    var
      pickaxe1: integer;
    
    procedure loadbitmap;
    begin
      pickaxe1 := BitmapFromString(29, 30, 'beNpjYCAOMOrJs5oos1lr' +
           'sDvosAO5DKQBRlzI2j/COSrFMzEnILscyDVQUCDeQCNnL1zIzDPQN' +
           'ijaMTwxtKieOGMRBuo7uONCalIswEAAOtg+JA7mBXzAxM0PiDCN1b' +
           'VxhiM5EWZg2AIRxFigs4GIkOGMBBHQqWjGWvqEQEIbj8nAgMKFgLr' +
           'gTkUzFhjaQARkQCKRxOSBcCoQwd0PMRYSekASyI2p7iDaZHQzkX0B' +
           'QZBYABoODBOiEx7CWLiZaEEHNx/oZlgiIdmpeKIGYjgwYRMymRHT+' +
           '/jdATEcr0qEU4EMUnIrA16VJDuVvATAQAVAW6dSz0yEU0mNqQF0Kn' +
           'Vjaug4FWEsdZ0KCQFghUVdp0KMpapTGSCVC1XTKsJYIKK2sVDDqRo' +
           'CaOX8YAUAtihtew==');
    end;
    
    procedure FBitmap;
    Var
      x, y :integer;
    begin
      LoadBitmap;//Either call to load it here
      FindBitmapToleranceIn(pickaxe1, x, y, 676, 714, 391, 429, 25);
    end;
    
    begin//Or load it in your Main Loop
      LoadBitmap;
      FBitmap;
    end.
    Also don't forget to free your images, DTMs or BMPs after your use them so they don't eat up your memory:
    Code:
    FreeBitmap(Pickaxe1);
    Free Scripts Pl0x!

  7. #7
    Join Date
    Sep 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yah done that, i alse fixed the access error thingo, i didnt add loadbitmap in main begin and end. but now when i run it it just says successfully executed... is there a way i can get it to tell me that it has accutaly found it on the client ?

  8. #8
    Join Date
    Sep 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by haseotod View Post
    yah done that, i alse fixed the access error thingo, i didnt add loadbitmap in main begin and end. but now when i run it it just says successfully executed... is there a way i can get it to tell me that it has accutaly found it on the client ?
    Yes, you can have it write it to the debug box:

    Code:
    procedure FBitmap;
    Var
      x, y :integer;
    begin
      LoadBitmap;//Either call to load it here
      if FindBitmapToleranceIn(pickaxe1, x, y, 676, 714, 391, 429, 25) then
       begin 
         WriteLn('Found Bitmap');
       end else WriteLn('Bitmap not found');
    end;
    Free Scripts Pl0x!

  9. #9
    Join Date
    Aug 2008
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If you'd use S.M.A.R.T., you're sure that it'll find the client. There are enough tutorials around to learn you about how to set SMART up.

  10. #10
    Join Date
    Sep 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm does not seem to work, could someone try this for me please and see if it works for them.
    Code:
    program RpickaxeFinder;
    {.include srl/srl.scar}
    var
     pickaxe1: integer;
    procedure loadbitmap;
    begin
     pickaxe1 := BitmapFromString(29, 30, 'beNpjYCAOMOrJs5oos1lr' +
           'sDvosAO5DKQBRlzI2j/COSrFMzEnILscyDVQUCDeQCNnL1zIzDPQN' +
           'ijaMTwxtKieOGMRBuo7uONCalIswEAAOtg+JA7mBXzAxM0PiDCN1b' +
           'VxhiM5EWZg2AIRxFigs4GIkOGMBBHQqWjGWvqEQEIbj8nAgMKFgLr' +
           'gTkUzFhjaQARkQCKRxOSBcCoQwd0PMRYSekASyI2p7iDaZHQzkX0B' +
           'QZBYABoODBOiEx7CWLiZaEEHNx/oZlgiIdmpeKIGYjgwYRMymRHT+' +
           '/jdATEcr0qEU4EMUnIrA16VJDuVvATAQAVAW6dSz0yEU0mNqQF0Kn' +
           'Vjaug4FWEsdZ0KCQFghUVdp0KMpapTGSCVC1XTKsJYIKK2sVDDqRo' +
           'CaOX8YAUAtihtew==');
     end;
     procedure FBitmap;
    Var
      x, y :integer;
    begin
      LoadBitmap;//Either call to load it here
      if FindBitmapToleranceIn(pickaxe1, x, y, 557, 592, 206, 246, 25) then
       begin
         WriteLn('Found Bitmap');
       end else WriteLn('Bitmap not found');
    end;
    begin
    loadbitmap;
    FBitmap;
    end.
    Please post what i have done wrong as i really want to get this right lol
    going to bed now so will check when i wake up thanks D

    Btw: thanks for the help so far @leech and jackey boy, @ accure isnt smart completly different though?

  11. #11
    Join Date
    Sep 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Smart is just a runescape client with a lot of benifits over a regular RS client, such as not taking over your mouse.
    Code:
    SetUpSrl
    Put this at the beggining of your main loop, and what is the error that you are having, you said it wasn't working.
    Free Scripts Pl0x!

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

    Default

    Btw, use SCAR Tags when posting code.

    But, run the version with the if statements and it will tell you .
    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

  13. #13
    Join Date
    Sep 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    when i run it, it runs but all it says 'bitmap not found', so its not working and yes i targeted the rs client -.-

    @Nava2- what are u talking about :S

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
  •