Results 1 to 4 of 4

Thread: first script (rsps)

  1. #1
    Join Date
    Jun 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default first script (rsps)

    This is my first script. I'm making it for a rsps, so a lot of the includes and tools don't work for me. just trying to do, what I think should be a simple task, is becoming very difficult. So it isn't working right and I would love some help.
    Heres the code

    program MageChopper; // this is my first script ever \\
    {$i srl/srl.simba} // and inteded for a rsps \\

    procedure chop;
    var x, y: integer;
    var x1, y1: integer;
    var x2, y2: integer;

    begin
    repeat
    if FindColorTolerance(x1, y1, 13826296 , 1, 1, 514, 337, 3) and
    FindColorTolerance(x2, y2, 12829954 , 84, 8, 150, 18, 3) then
    begin
    MoveMouse(x1, y1);
    Wait(500+random(217));
    ClickMouse(x1, y1, 1);
    Wait(520+random(132));
    end;
    until FindColorTolerance(x, y, 65536 , 686, 433, 726, 459, 3)
    end;

    procedure drop;
    begin
    SendKeys('::empty', 100, 30);
    pressKey(13)
    end;

    begin
    SetUpSRL;
    repeat
    begin
    chop;
    drop;
    end;
    until(false);
    end.

    The script compiles fine, and I feel like, in theory it should work. Unfortunately when I run the script it seems to only do the drop procedure.

    Please, constructive criticism only. I know its probably sloppy or I might be doing something completely idiotic. Just keep in mind this is my first bit of coding ever.

  2. #2
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    you only need var once, like..

    var
    x,y,y1,y2,x1,x2: integer;

    if the chop function isn't working, try setting the tolerance to ten or maybe fifteen. And you might want to only have one condition for the if statement at the beginning of chop, unless both are necessary.

    Basically: get the chop function to click on the screen first, after you verify it clicks, then start restricting where it'll click until it'll only click where you want it to. Cause if it's not clicking anywhere you have too many restrictions, or non functional restrictions.
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  3. #3
    Join Date
    Jun 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I appreciate the reply xdarkshadowx. I tried adjusting the tol. I was able to get it to clock on the screen. but I ran into a problem I encountered before, which is that the script sometimes clicks when the mouse isnt on the tree. I would like to implement a check to see if the mouse is over the tree(thats what the 2nd if-then statement was supposed to be). I will review some more tuts and hit it hard again tomorrow.

  4. #4
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Is the color of the tree visible elsewhere? once you get better at scripting you can start including some of the harder functions, some from the wizzy plug-in would work quite well for locating trees I think. You also might want to open up some other tree-finding scripts to get an idea of how they did it.
    Feel free to PM me if you have any trouble, best of luck in your coding!
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

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
  •