Page 3 of 8 FirstFirst 12345 ... LastLast
Results 51 to 75 of 200

Thread: All-In-One RS3 and SRL6 Scripting Tutorial!

  1. #51
    Join Date
    Feb 2014
    Location
    TORONTO, ONTARIO, CANADA
    Posts
    87
    Mentioned
    1 Post(s)
    Quoted
    49 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Ok I just took a look and the map isn't actually black, it's the interface colour:

    Simba Code:
    function isMapGlitched(): boolean;
    begin
      result := countColorTolerance(1774858, minimap.getBounds(), 24) > 15000;
    end;

    Just call fixGlitch() when you want it to check.
    yea works now.. thanks man

  2. #52
    Join Date
    Feb 2014
    Location
    TORONTO, ONTARIO, CANADA
    Posts
    87
    Mentioned
    1 Post(s)
    Quoted
    49 Post(s)

    Default

    Exception in Script: Runtime error: "Access violation" at line 206, column 17 in file "C:\Simba\Includes\SRL-6\lib\interfaces\lodestone.simba"

    get this when trying to teleport via loadstone in a procedure, i have updated srl

  3. #53
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by jayman19981 View Post
    Exception in Script: Runtime error: "Access violation" at line 206, column 17 in file "C:\Simba\Includes\SRL-6\lib\interfaces\lodestone.simba"

    get this when trying to teleport via loadstone in a procedure, i have updated srl
    Please post the code you are trying to use

  4. #54
    Join Date
    Feb 2014
    Location
    TORONTO, ONTARIO, CANADA
    Posts
    87
    Mentioned
    1 Post(s)
    Quoted
    49 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Please post the code you are trying to use
    procedure fixGlitch();
    begin
    if isMapGlitched() then
    begin
    TRSLodestoneScreen.teleportTo(LOCATION_EDGEVILLE);
    wait(randomRange(10000, 15000));
    TRSLodestoneScreen.teleportTo(LOCATION_LUNAR_ISLE) ;
    end else
    writeLn('The map looks normal');
    end;

  5. #55
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by jayman19981 View Post
    procedure fixGlitch();
    begin
    if isMapGlitched() then
    begin
    TRSLodestoneScreen.teleportTo(LOCATION_EDGEVILLE);
    wait(randomRange(10000, 15000));
    TRSLodestoneScreen.teleportTo(LOCATION_LUNAR_ISLE) ;
    end else
    writeLn('The map looks normal');
    end;
    Just get rid of the TRS, it's only used within the include.

    Simba Code:
    begin
      if isMapGlitched() then
      begin
        lodestoneScreen.teleportTo(LOCATION_EDGEVILLE);
        wait(randomRange(10000, 15000));
        lodestoneScreen.teleportTo(LOCATION_LUNAR_ISLE);
      end else
        writeLn('The map looks normal');
    end;

  6. #56
    Join Date
    Feb 2014
    Location
    TORONTO, ONTARIO, CANADA
    Posts
    87
    Mentioned
    1 Post(s)
    Quoted
    49 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Just get rid of the TRS, it's only used within the include.

    Simba Code:
    begin
      if isMapGlitched() then
      begin
        lodestoneScreen.teleportTo(LOCATION_EDGEVILLE);
        wait(randomRange(10000, 15000));
        lodestoneScreen.teleportTo(LOCATION_LUNAR_ISLE);
      end else
        writeLn('The map looks normal');
    end;
    Yep works now.. this fixes the black minimap glitch on rs

  7. #57
    Join Date
    Dec 2009
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Looks like a lot of effort has been put into this tutorial, I'll try using it to help me start with scripting and then post back about how it goes.

  8. #58
    Join Date
    Dec 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Hey, first off thanks for this! I've been hammering all this info into my head and have made quite a bit of progress. I need help with a couple bugs in the script.

    After you use your vexillum to teleport to the clanCamp it doesnt select the "yes" option that comes up in the chat. "TELEPORT TO CLAN CAMP?" "1.yes" "2.No" How would i tell it to say yes? (I made a DTM for "yes" haha, i know its the wrong way to do it, and i failed to even implement it)

    Simba Code:
    procedure teleToClanCamp();
    var
      x, y, vexillumDTM, yes: integer;
      p: TPoint;
      teleTimer: TTimeMarker;
    begin
      if not isLoggedIn() then
        exit;

      gameTabs.openTab(TAB_EQUIPMENT);

      vexillumDTM := DTMFromString('mbQAAAHicY2VgYAhnZmBIAOIYIA4CYj8gngHEU4B4IRAvgLLT2rcCVTOhYEkGTMCIBYMBAAfjBqA=');

      [B][SIZE=2]if findDTM(vexillumDTM, x, y, tabBackPack.getBounds()) then
      begin
        mouse(x, y, 3, 3, MOUSE_MOVE);
        if isMouseOverText(['Clan', 'vex']) then
        begin
          fastClick(MOUSE_RIGHT);
          if chooseOption.select(['Tele'])then
           

          begin
             
           writeLn('We clicked the teleport option');
            teleTimer.start();

            repeat
               wait(randomRange(2000, 3000));
            until (not isLoggedIn())  or (minimap.findSymbol(p, MM_SYMBOL_STORE, minimap.getBounds()) or (teleTimer.getTime() > 20000));[/SIZE]

          end;
        end;
      end else
        writeLn('Failed to find the vex DTM');
    end;

    Also it fails to break out of the loop here, I think the fishing symbol changed or something. until (not isLoggedIn()) or (minimap.findSymbol(p, MM_SYMBOL_STORE, minimap.getBounds()) or (teleTimer.getTime() > 20000));

    I hope this was clear <3
    Last edited by rapid_spitfire; 05-08-2014 at 08:35 PM.

  9. #59
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by rapid_spitfire View Post
    Hey, first off thanks for this! I've been hammering all this info into my head and have made quite a bit of progress. I need help with a couple bugs in the script.

    After you use your vexillum to teleport to the clanCamp it doesnt select the "yes" option that comes up in the chat. "TELEPORT TO CLAN CAMP?" "1.yes" "2.No" How would i tell it to say yes? (I made a DTM for "yes" haha, i know its the wrong way to do it, and i failed to even implement it)

    Also it fails to break out of the loop here, I think the fishing symbol changed or something. until (not isLoggedIn()) or (minimap.findSymbol(p, MM_SYMBOL_STORE, minimap.getBounds()) or (teleTimer.getTime() > 20000));

    I hope this was clear <3
    Ahh they must have added that yes/no option in a recent update. You can just use:

    Simba Code:
    if conversationBox.selectOption(1) then
      writeLn('We selected the first option in the conversation box');

    And yea, the mini-map symbols changed a while back, and I don't think the bitmaps have been updated in SRL yet, so it won't recognise the symbols.

  10. #60
    Join Date
    Dec 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks, that method worked for selecting "yes or no". Just for knowledge sake, how would i use the mouse to click on one of the options?
    I'm new but would you use mcx1, mcy1, mcx2, mcy2?

  11. #61
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by rapid_spitfire View Post
    Thanks, that method worked for selecting "yes or no". Just for knowledge sake, how would i use the mouse to click on one of the options?
    I'm new but would you use mcx1, mcy1, mcx2, mcy2?
    There are a number of ways. You could move the mouse to a point (x, y) and then click:

    Simba Code:
    begin
      mouse(point(50, 50));
      fastClick(MOUSE_LEFT);
    end;

    Or you could just use a MouseBox (moves the mouse to a random place inside a box, and click if you want to). Good for buttons etc.

    Simba Code:
    procedure boxExample();
    var
      myBox: TBox;
    begin
      myBox := intToBox(10, 20, 100, 200);
      mouseBox(myBox, MOUSE_LEFT);
    end;

    Explanation:

    Simba Code:
    procedure boxExample();
    var
      myBox: TBox; // declaring "myBox" variable as a TBox
    begin

      // assigning the myBox variable the following coordinates
      // x1, y1, x2, y2
      //(x1 & y1 top left corner of box, x2, y2 bottom right corner coordinates)
      myBox := intToBox(10, 20, 100, 200);

      // moving the mouse inside the box and left clicking
      // you could have MOUSE_RIGHT or MOUSE_MOVE also
      mouseBox(myBox, MOUSE_LEFT);
    end;

  12. #62
    Join Date
    Dec 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks dude! You're the best. This is what i came up with

    Simba Code:
    procedure teleToClanCamp();
    var
      vexillumDTM, x, y: integer;
      myBox: TBox;
    begin
      if not isLoggedIn() then
        exit;

      gameTabs.openTab(TAB_EQUIPMENT);

      vexillumDTM := DTMFromString('mbQAAAHicY2VgYAhnZmBIAOIYIA4CYj8gngHEU4B4IRAvgLLT2rcCVTOhYEkGTMCIBYMBAAfjBqA=');

      if findDTM(vexillumDTM, x, y, tabBackPack.getBounds()) then
      begin
        mouse(x, y, 3, 3, MOUSE_MOVE);
        if isMouseOverText(['Clan', 'vex']) then
        begin
          fastClick(MOUSE_RIGHT);
          if chooseOption.select(['Tele'])then
           wait(randomRange(200,2400));

         myBox := intToBox(258, 494, 328, 510);
      mouseBox(myBox, MOUSE_LEFT);

      end else
        writeLn('Failed to find the vex DTM');
    end;
      end;

    Another thing, Do you think you could explain this line of code for me a bit, i'm confused with tabBackPack.getBounds() mostly.

    if findDTM(vexillumDTM, x, y, tabBackPack.getBounds());
    Last edited by rapid_spitfire; 05-09-2014 at 08:25 PM.

  13. #63
    Join Date
    Dec 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Hey I've noticed while its mining it clicks on the same spot on the rock until the inv is full (mouse just stays there and clicks again when the rock is off cooldown), is it possible to make the mouse be a bit more random when clicking on the atpa? I have it so it stays at the same rock mining clay. I'm not trying to be a nussance

  14. #64
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by rapid_spitfire View Post

    if findDTM(vexillumDTM, x, y, tabBackPack.getBounds());
    Below are the parameters of that function (if you press ctrl + space in simba the parameters of that function will pop up in a window:



    Simba Code:
    function findDTM(dtm: integer; var x, y: integer; searchBox: TBox): boolean;

    You can see:

    The first parameter is the dtm. In this case it is our vexillumDTM. You can see that this has to be an integer (DTMs are always declared as integers).

    The second parameter is the output variables x and y, also integers. The function stores the coordinatess of the location where it finds the DTM in these 2 variables (which you can then use later, i.e. move the mouse to x, y).

    The third parameter is the search box, which is declared as a TBox. This is the area where you want to search for the DTM. You can make your own TBox to search in (like you did above with that button). The getBounds is a function which automatically returns a TBox around the outside of a particular interface. tabBackPack.getBounds() returns the box around the backpack interface (see picture in tutorial). backScreen.getBounds would return a TBox of the bank screen interface.

    Simba Code:
    myBox := intToBox(258, 494, 328, 510);
    if findDTM(vexillumDTM, x, y, myBox);

    Or you could combine it to one line:

    Simba Code:
    if findDTM(vexillumDTM, x, y, intToBox(258, 494, 328, 510));




    Quote Originally Posted by rapid_spitfire View Post
    Hey I've noticed while its mining it clicks on the same spot on the rock until the inv is full (mouse just stays there and clicks again when the rock is off cooldown), is it possible to make the mouse be a bit more random when clicking on the atpa? I have it so it stays at the same rock mining clay. I'm not trying to be a nussance
    It just clicks the one closest to the player. It will click the 2nd rock if there is no ore on the first rock (unless the first rock spawns too quickly). I haven't looked at this script in 5 months, I'm sure there are a few bugs (and it wasn't meant to be a flawless script, just to act as a tutorial).

  15. #65
    Join Date
    Dec 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks for the quick response. The issue is that it clicks the same spot in the ATPA each time, is there a way to tell the mouse to click in a random spot within the ATPA? This code below is as close as i got (very buggy)

    Simba Code:
    begin
          mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

          if isMouseOverText(['Clay', 'lay'], 500) then
          begin
              GetMousePos(x,y);
          mouse(x, y, 10, 10, MOUSE_MOVE);
            fastClick(MOUSE_LEFT);



            smartImage.clear;
            break;
          end;
        end;

  16. #66
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by rapid_spitfire View Post
    Thanks for the quick response. The issue is that it clicks the same spot in the ATPA each time, is there a way to tell the mouse to click in a random spot within the ATPA? This code below is as close as i got (very buggy)

    Simba Code:
    begin
          mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

          if isMouseOverText(['Clay', 'lay'], 500) then
          begin
              GetMousePos(x,y);
          mouse(x, y, 10, 10, MOUSE_MOVE);
            fastClick(MOUSE_LEFT);



            smartImage.clear;
            break;
          end;
        end;
    Ahh now I understand what you mean. Well you can see I tell it to cilick in the middle of the TPA. Picture those boxes around each rock (like in the tutorial picture), it will move the mouse to the middle of those boxes.

    Simba Code:
    mouse(middleTPA(ATPA[i]), MOUSE_MOVE);

    The middleTPA just returns the middle TPoint in a TPA, (in this case the middle TPoint in ATPA[i]).

    Instead of clicking the middle, you could click anywhere inside the TPA of the rock. You could replace the middleTPA with something like:

    Simba Code:
    var
      rockBounds: TBox;
    begin
      // colour finding TPA stuff etc..

      rockBounds := getTPABounds(ATPA[i]); // Store the TPA bounds in a TBox variable
      mouseBox(rockBounds, MOUSE_MOVE); // Move mouse anywhere in that box

     // other stuff
    end;

  17. #67
    Join Date
    Jan 2013
    Location
    United kingdom
    Posts
    102
    Mentioned
    4 Post(s)
    Quoted
    34 Post(s)

    Default

    Mayor, could you help me please?
    I was setting up the default code. I got it working fine, was able to sign in to my account. However, for some reason it has stopped working.
    I was adding an anti ban to the code, i added it and tried to play the script. It worked but wouldn't log me in like it would before. So i deleted it, and recopied the default code and pasted it. Now it's not working at all, even without the anti ban. I need some help. I'll post a picture. Untitled.jpg

  18. #68
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by beefman View Post
    Mayor, could you help me please?
    I was setting up the default code. I got it working fine, was able to sign in to my account. However, for some reason it has stopped working.
    I was adding an anti ban to the code, i added it and tried to play the script. It worked but wouldn't log me in like it would before. So i deleted it, and recopied the default code and pasted it. Now it's not working at all, even without the anti ban. I need some help. I'll post a picture. Untitled.jpg
    are your graphics settings correct? Check that you are in openGL mode and brightness is up max.

  19. #69
    Join Date
    Jan 2013
    Location
    United kingdom
    Posts
    102
    Mentioned
    4 Post(s)
    Quoted
    34 Post(s)

    Default

    Genius! Thanks for the fast reply. Turns out i had my graphics on Directx instead of openGL

  20. #70
    Join Date
    Dec 2007
    Posts
    289
    Mentioned
    4 Post(s)
    Quoted
    86 Post(s)

    Default

    Thanks for the great overview of RS3/SRL-6 Scripting. This has served as a great refresher for myself.

    Appreciate the hard work - expect to see a script from me soon.

  21. #71
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Quote Originally Posted by honeyhoney View Post
    Thanks for the great overview of RS3/SRL-6 Scripting. This has served as a great refresher for myself.

    Appreciate the hard work - expect to see a script from me soon.
    Welcome back to SRL.
    Tsunami

  22. #72
    Join Date
    Mar 2012
    Posts
    49
    Mentioned
    2 Post(s)
    Quoted
    21 Post(s)

    Default

    Thanks @The Mayor , I just made my first script and it works well after some tweeks that was done after first couple of runs, running good now and I referred to other similar scripts to check my mistake and correct. Working really good and I thank you for all that, I can just make more and get experienced with this in the future

  23. #73
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by johnjoseph09 View Post
    Thanks @The Mayor , I just made my first script and it works well after some tweeks that was done after first couple of runs, running good now and I referred to other similar scripts to check my mistake and correct. Working really good and I thank you for all that, I can just make more and get experienced with this in the future
    Good I usually do the same. I watch the first version of the script run for about 20min and tweak it as it's running until it runs as it should.

  24. #74
    Join Date
    Jun 2014
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    33 Post(s)

    Default

    Code:
    program walkToChest;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    {$I SPS/lib/SPS-RS3.Simba}
    {$i srl-6/lib/misc/srlplayerform.simba}
    
    procedure walkToChest();
    var
       walkToChest: TPointArray;
    begin
      if not isLoggedIn() then
        exit;
    
      walkToChest := [Point(203, 60), Point(198, 101), Point(176, 133), Point(176, 161), Point(174, 182), Point(173, 196)];
    
      if SPS.walkPath(walkToChest) then
        minimap.waitPlayerMoving()
      else
        writeLn('Unable to locate chest');
    
    end;
    
    begin
      clearDebug();
      smartPlugins := ['OpenGL32.dll','d3d9.dll'];
      smartEnableDrawing := true;
      disableSRLDebug := false;
      setupSRL();
      SPS.setup('Chest', RUNESCAPE_OTHER);
         progressReport();
      until false;
    
    end.
    IT executes but doesn't actually move, can't tell what I missed

  25. #75
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Basic View Post
    Code:
    program walkToChest;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    {$I SPS/lib/SPS-RS3.Simba}
    {$i srl-6/lib/misc/srlplayerform.simba}
    
    procedure walkToChest();
    var
       walkToChest: TPointArray;
    begin
      if not isLoggedIn() then
        exit;
    
      walkToChest := [Point(203, 60), Point(198, 101), Point(176, 133), Point(176, 161), Point(174, 182), Point(173, 196)];
    
      if SPS.walkPath(walkToChest) then
        minimap.waitPlayerMoving()
      else
        writeLn('Unable to locate chest');
    
    end;
    
    begin
      clearDebug();
      smartPlugins := ['OpenGL32.dll','d3d9.dll'];
      smartEnableDrawing := true;
      disableSRLDebug := false;
      setupSRL();
      SPS.setup('Chest', RUNESCAPE_OTHER);
         progressReport();
      until false;
    
    end.
    IT executes but doesn't actually move, can't tell what I missed
    1) You never call walkToChest in your main loop, so it will never execute.
    2) In your main loop you have a procedure called progressReport which doesn't appear in your script
    3) You have a 'until false' but no 'repeat'
    4) That won't actually compile because of the above

Page 3 of 8 FirstFirst 12345 ... LastLast

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
  •