Page 6 of 6 FirstFirst ... 456
Results 126 to 139 of 139

Thread: How to script for a RSPS - Beginner level

  1. #126
    Join Date
    May 2016
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Thanks!

  2. #127
    Join Date
    Jul 2016
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    hey i tried to make a chicken killing script for an rsps i play, all it does is tell me it was executed successfully in x amt of milliseconds.
    Below is the script as it is.
    Program KillChicken;
    {srl/srl.simba}
    Procedure ClickChicken;
    var
    X,Y:Integer;
    begin
    if FindColorTolerance(X, Y, 9943501, 200, 233, 234, 202, 5) then
    begin
    MoveMouse(x, y);
    wait(250);
    ClickMouse(X, Y, mouse_Left)
    end;
    end;
    Begin
    end.

    Why doesnt it work? btw this is my first go at this

  3. #128
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    You only define the ClickChicken procedure, you never call it, so try, instead of
    begin
    end.
    to call the function:
    begin
    ClickChicken();
    end.
    The
    begin
    end.
    block is what is executed
    Infractions, reputation, reflection, the dark side of scripting, they are.

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

    Default

    requested this guide to be moved to outdated guides until I can update it.

    It still has a lot of relevant information but it can be hard to follow at a beginner level

  5. #130
    Join Date
    Jun 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    This is a great guide

  6. #131
    Join Date
    May 2016
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks for this! I'm starting to get the hang of it now

  7. #132
    Join Date
    Apr 2017
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    program new;
    {$i srl-6/srl.simba}
    Procedure ClickOre;
    var
    X,Y: Integer;
    begin
    if FindColorTolerance(X, Y, 3956612, 4, 4, 509, 335, 5) then
    begin
    MoveMouse(1, 1);
    wait(250);
    ClickMouse(X, Y, mouse_Left)
    end;
    end;
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.


    i tried making this script to mine ores on a rsps. The script runs but it won't click on the ore.
    i guess the FindColorTolerance(X, Y, 3956612, 4, 4, 509, 335, 5) is wrong, but how can i fix this?

  8. #133
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by japje05 View Post
    program new;
    {$i srl-6/srl.simba}
    Procedure ClickOre;
    var
    X,Y: Integer;
    begin
    if FindColorTolerance(X, Y, 3956612, 4, 4, 509, 335, 5) then
    begin
    MoveMouse(1, 1);
    wait(250);
    ClickMouse(X, Y, mouse_Left)
    end;
    end;
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.


    i tried making this script to mine ores on a rsps. The script runs but it won't click on the ore.
    i guess the FindColorTolerance(X, Y, 3956612, 4, 4, 509, 335, 5) is wrong, but how can i fix this?
    Look at Killerdou's post right above yours

  9. #134
    Join Date
    Apr 2017
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    it still doesn't work. can you explain me how to find correct values for the FindColorTolerance? i think that is the problem.
    thanks anyway

  10. #135
    Join Date
    Jan 2012
    Location
    in a galaxy far far away
    Posts
    371
    Mentioned
    3 Post(s)
    Quoted
    48 Post(s)

    Default

    Quote Originally Posted by japje05 View Post
    it still doesn't work. can you explain me how to find correct values for the FindColorTolerance? i think that is the problem.
    thanks anyway
    try to make the box you want to find the color in as small as possible.

    if FindColorTolerance(X, Y, 3956612, 4, 4, 509, 335, 5) then
    begin
    MoveMouse(1, 1); <----somethings wrong here
    wait(250);
    ClickMouse(X, Y, mouse_Left)
    >:)

  11. #136
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by japje05 View Post
    it still doesn't work. can you explain me how to find correct values for the FindColorTolerance? i think that is the problem.
    thanks anyway
    Well you have a couple of problems. First off, you never actually call the ClickOre procedure anywhere in your program. You have it defined, but never use it, which is why I told you to have a look at KillerDou's explanation above.
    Secondly,
    Simba Code:
    MoveMouse(1, 1);
    is going to move the mouse to the static coordinate (1, 1) (relative to the targetted window). You want to move the mouse to the found instance of FindColorTolerance
    Simba Code:
    function FindColorTolerance(var x, y: Integer; col, x1, y1, x2, y2, tol: Integer): Boolean;
    "x, y" are integer coordinates that FindColorTolerance stores the first found point of "col" within the given tolerance of "tol"



    Try this:
    Simba Code:
    program new;
    {$i srl-6/srl.simba}

    procedure ClickOre();
    var
      X, Y: Integer;
    begin
      if FindColorTolerance(X, Y, 3956612, 4, 4, 509, 335, 5) then
      begin
        MoveMouse(X, Y);
        wait(250);
        ClickMouse(X, Y, mouse_Left)
      end;
    end;

    begin
      MouseSpeed := 15;
      ClickOre();
    end.

  12. #137
    Join Date
    Oct 2014
    Location
    Belgium
    Posts
    33
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    hello i am now on this so understand me....
    can we make a guide like lvl1 lvl2 lvl3 programming so we can go step by step its all mixed up in this guide there are some mis typing in the simba code like mmouse?? if you wanna show to its done just typ it good @the first (MoveMouse) so we dont get mixed up too and why is this an error? Error: File "srl/srl.simba" not found at line 2

  13. #138
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by RSPS Scripter View Post
    hello i am now on this so understand me....
    can we make a guide like lvl1 lvl2 lvl3 programming so we can go step by step its all mixed up in this guide there are some mis typing in the simba code like mmouse?? if you wanna show to its done just typ it good @the first (MoveMouse) so we dont get mixed up too and why is this an error? Error: File "srl/srl.simba" not found at line 2
    First of all, don't double post. There is an edit button for a reason.

    Second, mmouse is not a typo. It's an old mouse function from an old include. That's why it isn't being found.
    I'd recommend just using Simba's built-in functions for RSPS scripting. Or else look at some of the scripts that have been released and see how they handle things.

    Here is a guide to get you started with Simba: https://villavu.com/forum/showthread.php?t=58935

  14. #139
    Join Date
    Aug 2017
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Thanks for the help.

Page 6 of 6 FirstFirst ... 456

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •