Results 1 to 21 of 21

Thread: Trying to make my very first script. Help needed >.>

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

    Default Trying to make my very first script. Help needed >.>

    Hey Lads,

    So here i am making my very firsts scrpt.
    I'ts for a not so popular rsps called imagine-ps. I'm trying to make a script that will simply kill chickens for hours on end. not collecting drops, not eating, not banking. should be easy enough? I'm having so much trouble. All i get is "successfully compiled in 'x' amt of milliseconds. then nothing happens on my client? heres my script so far..

    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.

    Any help appreciated, OR if somoene would like to whip one up quickly and copy and paste it into the comments that would be much appreciated.

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

    Default

    code is stubborn... it does exactly what you tell it do do

    anyways here, you don't have "ClickChicken" in your execution loop

    Simba Code:
    program KillChicken;

    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
      ClickChicken;
    end.

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

    Default

    Now i have invalid number of parameters on line 11.
    this is line 11 below.

    ClickMouse(X, Y, mouse_Left)

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

    Default

    Quote Originally Posted by quakez View Post
    Now i have invalid number of parameters on line 11.
    this is line 11 below.

    ClickMouse(X, Y, mouse_Left)
    When I parsed your code it deleted the srl include because you spelled it wrong... that might fix it but it looks like you also need to change your search coords because they make no sense

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

    Default

    I Honestly have no idea what I'm doing lol. Can you please dl imagine-ps and make me a chicken killing script? would it take that long?

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

    Default

    Quote Originally Posted by quakez View Post
    I Honestly have no idea what I'm doing lol. Can you please dl imagine-ps and make me a chicken killing script? would it take that long?
    no sorry, you would never learn that way. keep following rj's rsps scripting guide and ask questions on the forums.

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

    Default

    am having no luck following rj's guide. the area i am wanting the script to search for 'x' color, i can understand where he got two of the coords from because the color picker says so. but i cannot understand where he got the other coords

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

    Default

    Error: You passed wrong values to a finder function: ys > ye (233,202). at line 7

    Below is line 7

    if FindColorTolerance(X, Y, 9943501, 200, 233, 234, 202, 5) then

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

    Default

    Quote Originally Posted by quakez View Post
    Error: You passed wrong values to a finder function: ys > ye (233,202). at line 7

    Below is line 7

    if FindColorTolerance(X, Y, 9943501, 200, 233, 234, 202, 5) then
    FindColorTolerance(X, Y, COLOR, X1, Y1, X2, Y2, TOLERANCE)
    this part (X1, Y1, X2, Y2) is the area it will search for COLOR in. Think of it like a box. Notice your Y2 is smaller than your Y1.

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

    Default

    Quote Originally Posted by jstemper View Post
    no sorry, you would never learn that way. keep following rj's rsps scripting guide and ask questions on the forums.
    WOO i made it click 1 chicken, now how do i make it loop? or click more than 1 chicken?

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

    Default

    Program KillChicken;
    {srl/srl.simba}
    Procedure ClickChicken;
    var
    X,Y:Integer;
    begin
    if FindColorTolerance(X, Y, 8168377, 225, 185, 274, 234, 5) then
    begin
    MoveMouse(x, y);
    wait(100);
    ClickMouse(X, Y, mouse_Left)
    end;
    end;
    begin
    repeat
    ClickChicken;
    Until(NumberOfClickChickens = 50000);


    OK so this is where I'm upto. I'm now getting the error Error: Unknown declaration "NumberOfClickChickens" at line 17

    This is line 17 below

    Until(NumberOfClickChickens = 50000);

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

    Default

    Quote Originally Posted by jstemper View Post
    FindColorTolerance(X, Y, COLOR, X1, Y1, X2, Y2, TOLERANCE)
    this part (X1, Y1, X2, Y2) is the area it will search for COLOR in. Think of it like a box. Notice your Y2 is smaller than your Y1.
    please help with my looping problems

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

    Default

    Quote Originally Posted by quakez View Post
    please help with my looping problems
    download a script and look at their execution loop

  14. #14
    Join Date
    Nov 2011
    Location
    Norway
    Posts
    203
    Mentioned
    4 Post(s)
    Quoted
    100 Post(s)

    Default

    Change the loop to:

    ClickChicken;
    until false;

    It should then click more than once. Atm your script doesn't know what 'NumberOfClickChickens' is because you never declared it anywhere.
    Also you don't have anything in your script that will wait when your character is in combat so you may find it will click rapdily.

  15. #15
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by quakez View Post
    please help with my looping problems
    Take a look here to get some basic knowledge. When you use something like "numberOfClickChickens" you should declare whether it's a string, integer or something else. Just use "until false;" here
    Simba Code:
    program KillChicken;

    {$I SRL-6/SRL.simba}

    procedure ClickChicken;
    var
      x, y: integer;
    begin
      if FindColorTolerance(x, y, 8168377, 225, 185, 274, 234, 5) then
      begin
        MoveMouse(x, y);
        wait(100);
        ClickMouse(x, y, MOUSE_LEFT);
      end;
    end;

    begin
      setupSRL();
    repeat
      ClickChicken;
    until false;
    end.

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

    Default

    Quote Originally Posted by quakez View Post
    am having no luck following rj's guide. the area i am wanting the script to search for 'x' color, i can understand where he got two of the coords from because the color picker says so. but i cannot understand where he got the other coords
    My guide is quite old and I need to update it sometime

  17. #17
    Join Date
    Mar 2016
    Location
    Scandinavia
    Posts
    138
    Mentioned
    3 Post(s)
    Quoted
    46 Post(s)

    Default

    Simba Code:
    program KillChicken;

    {$I SRL-6/SRL.simba}

    procedure ClickChicken;
    var
      x, y: integer;
    begin
      if FindColorTolerance(x, y, 8168377, 225, 185, 274, 234, 5) then
      begin
        MoveMouse(x, y);
        wait(gaussRangeInt(100, 200));//make these numbers higher if you want it to wait longer before clicking the chicken
        ClickMouse(x, y, MOUSE_LEFT);
      end;
    end;

    begin
      setupSRL();
      repeat
        ClickChicken;
      until not isLoggedIn();
    end.

    Just a little improvement.

    I saw you wanted it to only click a certain amount of chickens. If so you could do something like this
    Simba Code:
    program KillChicken;

    {$I SRL-6/SRL.simba}

    var
      chickenClick: integer;

    procedure ClickChicken;
    var
      x, y : integer;
    begin
      if FindColorTolerance(x, y, 8168377, 225, 185, 274, 234, 5) then
      begin
        MoveMouse(x, y);
        wait(gaussRangeInt(100, 200));//make these numbers higher if you want it to wait longer before clicking the chicken
        chickenClick + 1;
        ClickMouse(x, y, MOUSE_LEFT);
        writeln('Chickens clicked:', chickenClick);
      end;
    end;

    begin
      setupSRL();
      repeat
        ClickChicken;
      until (chickenClick >= 5000);//edit 5000 to how many clicks you want to click at chickens
    end.

    Anyways welcome to SRL!
    I'm pretty sure that the include SRL wont work on a private server @scob;
    Make sure to checkout this awesome thinggy too. Great alternative to wasting resources "securing" the bitcoin network.
    https://boinc.tacc.utexas.edu/team_d....php?teamid=28

  18. #18
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Even better than Mayor's RS3 tutorial (which isn't exactly the right tutorial for this) is the actual beginners guide to scripting. You clearly have no idea what you're doing, so please, before you continue trying to duct tape a script together, learn the absolute bare basics:

    https://villavu.com/forum/showthread.php?t=58935



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

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

    Default

    Simba Code:
    program KillChicken;

    {$I SRL-6/SRL.simba}

    var
      chickenClick: integer;

    procedure ClickChicken;
    var
      x, y : integer;
    begin
      if FindColorTolerance(x, y, 8168377, 225, 185, 274, 234, 5) then
      begin
        MoveMouse(x, y);
        wait(gaussRangeInt(100, 200));//make these numbers higher if you want it to wait longer before clicking the chicken
        ClickMouse(x, y, MOUSE_LEFT);
        if didclick(true, 300) then
          inc(chickenClick);
        writeln('Chickens clicked:', chickenClick);
      end;
    end;

    begin
      setupSRL();
      repeat
        ClickChicken;
      until (chickenClick >= 5000);//edit 5000 to how many clicks you want to click at chickens
    end.

    just an add on from lemon star's second one - increases chickenClick only if you actually clicked

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

    Default

    Thankyou guys all so much you have been a huge help, i actually have my script up and running doing its thing. But what i now need to ask is how can i add multiple colours. Because as it is now it will only click 3 or four of the chickens. As i assume they are slightly different in colour.
    BTW thanks to all of you for putting up with my very NOOBIE state of coding and actually taking the time to help out. And a big thankyou to lemon star for welcoming me.

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

    Default

    Quote Originally Posted by quakez View Post
    Thankyou guys all so much you have been a huge help, i actually have my script up and running doing its thing. But what i now need to ask is how can i add multiple colours. Because as it is now it will only click 3 or four of the chickens. As i assume they are slightly different in colour.
    BTW thanks to all of you for putting up with my very NOOBIE state of coding and actually taking the time to help out. And a big thankyou to lemon star for welcoming me.
    try this
    Simba Code:
    program KillChicken;

    {$I SRL-6/SRL.simba}

    var
      chickenClick: integer;

    procedure ClickChicken;
    var
      x, y, I : integer;
      ChickenColors: TIntegerArray;
    begin
      ChickenColors := [col1, col2, col3];
      for I := 0 to High(ChickenColors) do
      if FindColorTolerance(x, y, ChickenColors[I], 225, 185, 274, 234, 5) then
      begin
        MoveMouse(x, y);
        wait(gaussRangeInt(100, 200));//make these numbers higher if you want it to wait longer before clicking the chicken
        ClickMouse(x, y, MOUSE_LEFT);
        if didclick(true, 300) then
          inc(chickenClick);
        writeln('Chickens clicked:', chickenClick);
      end;
    end;

    begin
      repeat
        ClickChicken;
      until (chickenClick >= 5000);//edit 5000 to how many clicks you want to click at chickens
    end.

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
  •