Page 4 of 6 FirstFirst ... 23456 LastLast
Results 76 to 100 of 139

Thread: How to script for a RSPS - Beginner level

  1. #76
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    one last question.

    Code:
     if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5)
    would that be the same for actual coordinates with bitmap, the MSX1, MSY1 etc.
    Or does it only work for colours? Because I can't get my bitmap clicking to work. Its a trade option, so
    I can't use colour. All my bitmaps are freed, everything compiles correctly with no errors, just the bitmap isn't found.

    Code:
    Procedure FindStore;
    var
    x, y: Integer;
    begin
    if FindColorTolerance(x, y, 1454656, MSX1, MSY1, MSX2, MSY2, 5) then
    begin
     mmouse(x, y,1,1);
      wait(250);
      ClickMouse(X, Y, mouse_Right)
      wait(450);
      if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
       begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
      end;
    end;

  2. #77
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Leekeleek View Post
    one last question.

    Code:
     if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5)
    would that be the same for actual coordinates with bitmap, the MSX1, MSY1 etc.
    Or does it only work for colours? Because I can't get my bitmap clicking to work. Its a trade option, so
    I can't use colour. All my bitmaps are freed, everything compiles correctly with no errors, just the bitmap isn't found.

    Code:
    Procedure FindStore;
    var
    x, y: Integer;
    begin
    if FindColorTolerance(x, y, 1454656, MSX1, MSY1, MSX2, MSY2, 5) then
    begin
     mmouse(x, y,1,1);
      wait(250);
      ClickMouse(X, Y, mouse_Right)
      wait(450);
      if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
       begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
      end;
    end;
    Your not using the right function to find a bitmap. It's FindBitmapToleranceIn(martin, x, y, X1, Y1, X2, Y2, TOL) I would suggest 100-150 for the tolerance. Also you don't need to wait 450, you can wait around 100-200 to be much faster

  3. #78
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Your not using the right function to find a bitmap. It's FindBitmapToleranceIn(martin, x, y, X1, Y1, X2, Y2, TOL) I would suggest 100-150 for the tolerance. Also you don't need to wait 450, you can wait around 100-200 to be much faster
    How small should the bitmap be? It is for sure a 24 bitmap, I'm saving it properly, the string is correct..
    it still won't click trade.

  4. #79
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Leekeleek View Post
    How small should the bitmap be? It is for sure a 24 bitmap, I'm saving it properly, the string is correct..
    it still won't click trade.
    Can you show me a screeny of what your trying to click? It's hard to explain in words

  5. #80
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Can you show me a screeny of what your trying to click? It's hard to explain in words



    Thanks again dude.

    I have it looking like this.

  6. #81
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Leekeleek View Post


    Thanks again dude.

    I have it looking like this.
    Cut out the top and bottom and side and get more width, like this:



    - Make sure it's in 24-bitmap format
    - Make sure you declare it and free it
    - Make sure you use a tolerance of 100-150
    -Use the correct client dimensions, MSX1, MSY1, MSX2, MSY2 are for the latest Runescape and probably won't be the same for the RSPS. You want to enter in the coords of the top left corner for example:



    and the bottom right corner for example:


  7. #82
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Cut out the top and bottom and side and get more width, like this:



    - Make sure it's in 24-bitmap format
    - Make sure you declare it and free it
    - Make sure you use a tolerance of 100-150
    -Use the correct client dimensions, MSX1, MSY1, MSX2, MSY2 are for the latest Runescape and probably won't be the same for the RSPS. You want to enter in the coords of the top left corner for example:



    and the bottom right corner for example:

    Declaring it is? like declaring that its a integer?
    Or did I miss a step. Its freed. I'll let you know how it works out.

  8. #83
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Leekeleek View Post
    Declaring it is? like declaring that its a integer?
    Or did I miss a step. Its freed. I'll let you know how it works out.
    ehh did you read the part of the guide on bitmaps? :/

  9. #84
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    ehh did you read the part of the guide on bitmaps? :/
    Yeah I did. I got it working haha, sorry I just didn't mean what you meant by declare.

    I definitely am interested in learning more well I'm done bugging you for now!

  10. #85
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Leekeleek View Post
    Yeah I did. I got it working haha, sorry I just didn't mean what you meant by declare.

    I definitely am interested in learning more well I'm done bugging you for now!
    Anytime

  11. #86
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Anytime
    How do I check when inventory is full? Quick example?

  12. #87
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Leekeleek View Post
    How do I check when inventory is full? Quick example?
    It's a bit tricky for a beginner tbh :d

  13. #88
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    It's a bit tricky for a beginner tbh :d
    Not really, take the required functions from srl5, then just change cords and possibly colours (it uses the black outline) and it should work fine.

    Also with the mine rock why not make your own font set: http://villavu.com/forum/showthread.php?t=60451 ?

  14. #89
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by The Killer View Post
    Not really, take the required functions from srl5, then just change cords and possibly colours (it uses the black outline) and it should work fine.

    Also with the mine rock why not make your own font set: http://villavu.com/forum/showthread.php?t=60451 ?
    Not making a font set just to click 1 option lol

  15. #90
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Not making a font set just to click 1 option lol
    Why not? its good practise to use reliable methods, and you could probably get away with just doing a few letters :P (and not to mention you could try the eoc and 07 current fonts since they may work.

  16. #91
    Join Date
    Aug 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Not making a font set just to click 1 option lol

    Code:
    program LeekSuperKebabs;
    {$define sr15}
    {$loadlib sps}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    
    var
    i:Integer;
    martin:Integer;
    Superkebab:Integer;
    InvKebab:Integer;
    SK:Integer;
    WalkDTM:Integer;
    
      Procedure StealKebab;
    var
    x, y: Integer;
    begin
    FindColorTolerance(x, y, 3304784 , 7, 11, 746, 491, 5);
    Mouse(x, y, 0, 0, True);
    wait (500);
    end;
    
    Procedure FindStore;
    var
    x, y: Integer;
    begin
    if FindColorTolerance(x, y, 7625091, 7, 11, 746, 491, 5) then
    begin
     mmouse(x, y,1,1);
      wait(250);
      ClickMouse(X, Y, mouse_Right)
      wait(250);
      if  FindBitmapToleranceIn(martin, x, y, 7, 11, 746, 491,100) then
       begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
          wait(4000);
        end;
      end;
    end;
    
    
    Procedure SellKebabs;
    var
    x, y: Integer;
    begin
    if FindDTM(SK, x, y, 557, 217, 733, 462) then
    begin
     mmouse(x, y,1,1);
      clickmouse2(mouse_Right);
      wait(3000);
      if  FindBitmapToleranceIn(Superkebab, x, y, 7, 11, 746, 491,100) then
       begin
          mmouse(x, y,1,1);
          wait(1500);
          ClickMouse(X, Y, mouse_Left)
        end;
      end;
    end;
    
       Procedure CloseDat;
    var
    x, y: Integer;
    begin
    if FindColorTolerance(x, y, 5268590, 7, 11, 746, 491, 5) then
    begin
     mmouse(x, y,1,1);
     wait(1000);
      ClickMouse(X, Y, mouse_Left)
      ClickDTMRotatedIn(WalkDTM, 7, 11, 746, 491, -Pi, Pi, Pi/30, [], mouse_Left);
    Wait(2500);
    while (IsMoving) do
    wait(100);
    end;
     end;
    
    
    Begin
    SetUpSRL;
    SK := DTMFromString('mWAAAAHicY2FgYMhgYmBIA+JsIE4CYh5GBgZBIOYHYm4gXjUhnmFSdRAY75mfycAJ1IOMGdEwCAAApx4IJg==');
    WalkDTM := DTMFromString('mQwAAAHicY2ZgYAhlYmCIgOIoID8aiCOAWGc3F8OW1SsYNGdxM4gA+TDMiISBAAD2lwYh');
    
    
    
    
    MouseSpeed := 15;
    
       Superkebab :=   BitmapFromString(141, 8, 'meJzVVkkOwjAM5CG5c+ANlThz5G' +
            'Vc+Asv4FsQNaplvEymbVSJyIc0zNiJx7aYbvdyvlR7vt7VTvOqn7L' +
            'JTPBmn2HC87ravpoPcX18qvFXGmsSfTh4A35aZJLskUReJu/Wc0O6' +
            'POcwaf5CpkypMNuMTGVpgYzbDgE9VEqfmF/bZ0YhwSaTDAu42hC6K' +
            '5NXyg+oVTKFbrVM4hbQwzc2fLg3ucXneq5m6RVAN0R2VRLPy5SllN' +
            'xjmcygK3O7MfTwjaP2YN4aAO82lJvBr5XJpNT8xxgiE0/fLwdoDRC' +
            'xm3O+EpirdmWS8s7kkIW7zEvj8eV37ulwYQetzQnIVdYaoDCy+bmt' +
            'y3bKZIpcs0xD8TIZbuY2Gzu6eg0GlDQYVqY7SJl0wWBXTOjuVUP7A' +
            'nmyz6w=');
    
     martin :=  BitmapFromString(52, 10, 'meJzNVEkSgDAI4yHePfhe/+IL/B' +
            'bq1CICpsv0YIdDiRmMTSoRrdt+FuU1zUtHyZBKPjFfpfge6Rg7Uhu' +
            'zaX+lzRbUltpUhmNA/wgPCT31GyEAbRI/3YaaSYUW88N03UHXSLY7' +
            '1GbuhT4HoMHgwOviXcDa/OFUavAf0qqteG5hIJv24L80StuXp/V4q' +
            'zbxVNL40EIX3qsbB28xyAH+k8Vm');
    
             InvKebab :=    BitmapFromString(31, 14, 'meJydktsrBGEYxslMM5dr17VDDi' +
            'XnLefNWSvHJESbtLW0NDkLISESUlIipZRCSolSLsSFcuHChf/Hb+Y' +
            'b09q141BPb8/3zfv+9pl31u2pc38qNiameuZAcd4r8TeK41Lui1Mc' +
            'p6rzQXU+qa5nDDeyP04ekPSKOGqSMmUeFcc5s137D56RHVDJyfnur' +
            '3Dv8hkQwTeZhkymJsljkjKrVzloMA2j9zvvGWxYvaia3hfkSHiRf7' +
            'Fl+7Zp40p1vamuFzNwUMfCJKSQCR+QjJ5XvTnh3Xf4CPxbsgWnoX7' +
            'pFNUtnqDmzWsLqzOFNEPAP5fWunPXuH5Zu3AcuZBQOMCauSPaqHwC' +
            'XhPh+TnGkY4Nmsn1rxN/Qx6x52ixLTjAysk9gcUwVa5tUVHF+C433' +
            'IsejuJpaXDNwlrk3NLqSDjNAiJmGSwOLJUMrmBQ2fAGDVQ8lzwq7J' +
            '+3CRwGZ4RZEQkjxgt80+6+WQwN4oYjlzarCEsexicbHkh+70Rup4b' +
            'yukfxVHxOx1DkKuzhFt8KDA1OZrMfZbUFstsHqfjfrMJmP5AJCRla' +
            'hteXVtuVXt+D7P8V0TKH8UPJqVUdSWVNKZ5W+1UI8o9wwef1RWawi' +
            'SXef68iGj9Uf13FB6maRU0=');
    
    repeat
    for i := 0 to 110 do
    begin
    StealKebab;
    end;
    until (true);
    Findstore;
    SellKebabs;
    CloseDat;
    
    FreeBitmap(Superkebab);
    FreeBitmap(martin);
    FreeBitmap(InvKebab);
    FreeDTM(SK);
    FreeDTM(WalkDTM);
    end.
    I was away for a couple days so didn't have time to figure it out, but this ended up working just as well. My very last problem I promise you sir Is there any possible way you could edit this
    so the entire thing loops? As in I mean the script restarts again once all methods are completed, like once everything is executed it starts back at StealKebab, then does everything else, then repeats from start over and over? I know its just repeat and then until (false); I have that there but how do I do it for the entire script.

    Also any links for beginners to look at

  17. #92
    Join Date
    Dec 2006
    Posts
    69
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    alright, this is my second attempt at making a script. I'm working on making a ess miner out of it eventually. the clicking of the ess rock works fine, but once i try and add in the walking the script compiles still but just does absolutely nothing.. what haven't i done?



    Program ChopTree;
    {$i srl/srl.simba}
    Procedure ClickTree;
    var
    X,Y:Integer;
    begin
    if FindColorTolerance(X, Y, 9539991, 316, 144, 350, 170, 5) then
    begin
    mmouse(x, y,1,1);
    wait(250);
    ClickMouse(X, Y, mouse_Left)
    end;
    end;
    var
    DTM_1:integer;
    begin
    MouseSpeed := 15;
    DTM_1 := DTMFromString('mWAAAAHicY2FgYIhmYmCIBOJYII4CYlWgmC YQawGxEhDH6vLAsbudCwM/AypgRMMgAAAMqgSw');

    ClickDTMRotatedIn(DTM_1, MMX1,MMY1, MMX2,MMY2, -Pi, Pi, Pi/30, [], mouse_Left);
    Wait(2500);
    while (IsMoving) do
    wait(100);

    FreeDTM(DTM_1);
    end.

    begin
    MouseSpeed := 15;
    SetupSRL;
    ClickTree;
    end.

  18. #93
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by sureshot12345 View Post
    alright, this is my second attempt at making a script. I'm working on making a ess miner out of it eventually. the clicking of the ess rock works fine, but once i try and add in the walking the script compiles still but just does absolutely nothing.. what haven't i done?
    try changing the MMX1 vars to the coords of the minimap

  19. #94
    Join Date
    Nov 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is so awesome, I'm gonna try.

  20. #95
    Join Date
    Mar 2013
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    try changing the MMX1 vars to the coords of the minimap
    At the start of the tutorial my script says this

    'THEN' expected at line 9
    Compiling failed.


    Heres my code

    Code:
    Program MineOre;
    {$i srl/srl.simba}
    Procedure ClickOre;
    var
      X,Y:Integer;
    begin
      if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)
      begin
        mmouse(x, y,1,1);
        wait(250);
        ClickMouse(X, Y, mouse_Left)
      end;
    end;
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.

  21. #96
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Kozs View Post
    At the start of the tutorial my script says this

    'THEN' expected at line 9
    Compiling failed.


    Heres my code

    Code:
    Program MineOre;
    {$i srl/srl.simba}
    Procedure ClickOre;
    var
      X,Y:Integer;
    begin
      if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)
      begin
        mmouse(x, y,1,1);
        wait(250);
        ClickMouse(X, Y, mouse_Left)
      end;
    end;
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.
    add then after if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)

  22. #97
    Join Date
    Mar 2013
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    add then after if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)


    no compiler errors but it does not do anything when I run. Just says successfully executed.

  23. #98
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Kozs View Post
    no compiler errors but it does not do anything when I run. Just says successfully executed.

    Because you never called it in your main loop

    Simba Code:
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.

    should be

    Simba Code:
    Begin
    MouseSpeed := 15;
    SetupSRL;
    ClickOre;
    end.

  24. #99
    Join Date
    Mar 2013
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Because you never called it in your main loop

    Simba Code:
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.

    should be

    Simba Code:
    Begin
    MouseSpeed := 15;
    SetupSRL;
    ClickOre;
    end.
    Still, no work.

  25. #100
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Kozs View Post
    Still, no work.
    then your not searching in a area were the color is? I don't know, because
    Quote Originally Posted by Kozs View Post
    Still, no work.
    doesn't tell me the problem

Page 4 of 6 FirstFirst ... 23456 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
  •