Results 1 to 15 of 15

Thread: It compiles, but it doesn't move the mouse to the actual point?

  1. #1
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default It compiles, but it doesn't move the mouse to the actual point?

    It doesn't make any sense. I've highlighted the game client. Set the coords of the color tolerance to the client window, and it compiles just fine. The only problem is that it doesn't even move the mouse?

    Code:
    Program AtaTinMiner;
    {$i srl-6/srl.simba}
    Procedure ClickTin
    var
      X,Y:Integer;
     begin
     if findColorTolerance(X,Y,7631997,5,4,865,681,1) then
      begin
      moveMouse(X,Y); //moves the mouse to the coordinates of the found point
      wait(100); //waits 1/10 of a second
      clickMouse(X,Y,1); //clicks the left-side of the mouse
     end;
    end;
    
    Begin
    MouseSpeed := 15;
    end.

  2. #2
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Btw, I'm using a 2160x1080 screen, so that might be a problem. The upper left edge coordinates are always "6,4" or "5,2".

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

    Default

    You aren't calling the procedure. Your script sets the mouse speed and doesn nothing else.

    Simba Code:
    program new;

    procedure whatever; //this will not run unless you tell it to below
    begin
    //stuff
    end;

    begin
      whatever(); //you have to do this
      //this is what will happen when you run the script
    end.// <-- the one with the period

    It's usually a good idea to add some writeln's when you're starting a new script, e.g.
    Simba Code:
    procedure clickThing();
    var
      x, y: integer;
    begin
      if findColor(x, y, ...) then
      begin
        writeln('Found color at [', x, ', ', y, ']');
        //other stuff
      end else writeln('Did not find color');
    end;

    also you really don't need SRL-6 for a RSPS
    Last edited by Citrus; 01-27-2016 at 06:03 PM.

  4. #4
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    You aren't calling the procedure. Your script sets the mouse speed and nothing else.

    Simba Code:
    program new;

    procedure whatever; //this will not run unless you tell it to below
    begin
    //stuff
    end;

    begin
      whatever(); //you have to do this
      //this is what will happen when you run the script
    end.// <-- the one with the period

    also you really don't need SRL-6 for a RSPS
    It worked! Thanks! What include would you recommend then?

  5. #5
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Quote Originally Posted by YMCMBubel View Post
    It worked! Thanks! What include would you recommend then?
    None. The default included functions in Simba should be sufficient.

    Infact, from first glance, you aren't even using anything from SRL and you aren't even setting it up.

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

    Default

    Quote Originally Posted by YMCMBubel View Post
    It worked! Thanks! What include would you recommend then?
    What he said ^
    Simba has everything you need built in: http://docs.villavu.com/simba/referencescript.html
    It's just a matter of writing what you need for your particular script. I wrote a couple of scripts for NR a while ago, so I might be able to help if you need anything else.
    Last edited by Citrus; 01-27-2016 at 06:06 PM.

  7. #7
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by the bank View Post
    None. The default included functions in Simba should be sufficient.

    Infact, from first glance, you aren't even using anything from SRL and you aren't even setting it up.
    Quote Originally Posted by Citrus View Post
    What he said ^
    Simba has everything you need built in: http://docs.villavu.com/simba/referencescript.html
    Thank you guys! I'll stick with the original Simba include.

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

    Default

    Quote Originally Posted by the bank View Post
    None. The default included functions in Simba should be sufficient.

    Infact, from first glance, you aren't even using anything from SRL and you aren't even setting it up.
    what??

    If he plays on expanding this script past a colorpicker hes gonna need SRL-6 lol. SRL-6 has a massive library that can be used for like anything lol why would you not include it. I've made hundreds of scripts for RSPS's and never once have I not used the SRL include (or some variation of it). SRL-6 has debugging, CTS library, TPA/ATPA/Integer/string/point functions (even though all these are wrappers anyway it's still easier)

    you can just override the main RS3 functions like isLoggedIn and make your own

    Simba Code:
    function isLoggedIn():boolean;override;
    begin
      //blah blah code here
    end;


    Also you could use my old alotic include as a skeleton: https://villavu.com/forum/showthread.php?t=112690
    It's like a much simpler version of SRL-6

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

    Default

    Quote Originally Posted by rj View Post
    If he plays on expanding this script past a colorpicker hes gonna need SRL-6 lol. SRL-6 has a massive library that can be used for like anything lol why would you not include it. I've made hundreds of scripts for RSPS's and never once have I not used the SRL include (or some variation of it). SRL-6 has debugging, CTS library, TPA/ATPA/Integer/string/point functions (even though all these are wrappers anyway it's still easier)

    you can just override the main RS3 functions like isLoggedIn and make your own
    It makes sense to use the include as a reference when writing your own functions, but I still wouldn't actually include all of it. Maybe it's just because I've used it so much that I know there's only a handful of things I'd want, e.g. grid();
    The other factor that might be underrated is the compile time. SRL-6 will turn 100 ms into 3000 ms, and that will add up as you develop more and more scripts.

    In OP's case he might actually want to include SRL-6, since he probably isn't familiar with it.

  10. #10
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    It makes sense to use the include as a reference when writing your own functions, but I still wouldn't actually include all of it. Maybe it's just because I've used it so much that I know there's only a handful of things I'd want, e.g. grid();
    The other factor that might be underrated is the compile time. SRL-6 will turn 100 ms into 3000 ms, and that will add up as you develop more and more scripts.

    In OP's case he might actually want to include SRL-6, since he probably isn't familiar with it.
    I was approaching it from a compilation time standpoint. In the industry, build times are critical, as they really do add up.

    For example, lets say you're developing a script to chop and bank trees. You will likely compile once every 2 minutes you are writing, both to ensure you havent made an syntax errors or to check if your feature is functioning. When your script is being bug-patched, it is likely you could compile even more common - like once every 30 seconds.

    Say you spend an hour developing a script, and an hour bug patching it.

    This equates to:

    Regular (100ms) build time: 15 seconds
    SRL (3000ms) build time: 6 minutes

    This means you can save about 6 minutes every hour. Just in build times.

  11. #11
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by the bank View Post
    I was approaching it from a compilation time standpoint. In the industry, build times are critical, as they really do add up.

    For example, lets say you're developing a script to chop and bank trees. You will likely compile once every 2 minutes you are writing, both to ensure you havent made an syntax errors or to check if your feature is functioning. When your script is being bug-patched, it is likely you could compile even more common - like once every 30 seconds.

    Say you spend an hour developing a script, and an hour bug patching it.

    This equates to:

    Regular (100ms) build time: 15 seconds
    SRL (3000ms) build time: 6 minutes

    This means you can save about 6 minutes every hour. Just in build times.
    I'm confused to where you get your figure from since I get... (average after 10 compiles)
    359 ms with just begin and end
    1875ms with SRL-6 and SPS included
    This is on a crappy dual core i5
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

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

    Default

    Quote Originally Posted by Harrier View Post
    I'm confused to where you get your figure from since I get... (average after 10 compiles)
    359 ms with just begin and end
    1875ms with SRL-6 and SPS included
    This is on a crappy dual core i5

    I'll admit those were just off the top of my head. I was thinking of fastest vs slowest compile times that I remember seeing. I use 3 different computers, which is why they were so extreme.

    But I still stand by my point.
    On my i3:
    600-line RSPS script compiles in 244 ms
    600-line RS3 script compiles in 2121 ms

    I compile (i.e. run the script to isolate functions) a LOT when I'm writing a script, so this matters to me.
    Last edited by Citrus; 01-27-2016 at 10:41 PM.

  13. #13
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by the bank View Post
    I was approaching it from a compilation time standpoint. In the industry, build times are critical, as they really do add up.

    For example, lets say you're developing a script to chop and bank trees. You will likely compile once every 2 minutes you are writing, both to ensure you havent made an syntax errors or to check if your feature is functioning. When your script is being bug-patched, it is likely you could compile even more common - like once every 30 seconds.
    I'll just assume you are talking about someone who's really inexperienced. But when taking into account that you start with talking about "in the industry.." that doesn't seem to be the case.. I personally spend very little time compiling the script, not once to check for syntax errors, only a few times at the end in order to make sure the logic is bulletproof, the logic itself is worked out before I type anything.

    Anyway, sure the compile-time can add up, but it's only a fraction of the time spent, considering any decently sized project (assuming one actually isn't inexperienced).
    Last edited by slacky; 01-27-2016 at 10:37 PM.
    !No priv. messages please

  14. #14
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    I don't think YMCMBubel gives two sh*ts about differences in compile time. He just wants help with his script.

  15. #15
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    I'll just assume you are talking about someone who's really inexperienced. But when taking into account that you start with talking about "in the industry.." that doesn't seem to be the case.. I personally spend very little time compiling the script, not once to check for syntax errors, only a few times at the end in order to make sure the logic is bulletproof, the logic itself is worked out before I type anything.

    Anyway, sure the compile-time can add up, but it's only a fraction of the time spent, considering any decently sized project (assuming one actually isn't inexperienced).
    Well of course. When I reference the high tech industry, I reference the kind of applications I work with.

    Build time is massively important in native development, especially in a professional setting where people are being compensated for their time spent there.

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
  •