Results 1 to 7 of 7

Thread: Help with rsps script

  1. #1
    Join Date
    Sep 2014
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default Help with rsps script

    Hello everyone,
    I've been having trouble getting a simple script to basically find this Bitmap and after finding this bitmap it is in a place and when it is in this place it should be finding some color to attack and click on it. how do u think i should do this
    heres i have


    unction attack: integer;
    var
    x, y, Pit: integer;
    begin
    if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then
    MoveMouse(x, y);
    writeLn('inside pit') then
    if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then
    begin
    writeLn('target found');
    MoveMouse(x, y);
    wait(2000);
    ClickMouse(x, y, MOUSE_LEFT);
    wait(2000)
    end else writeln('target not found, not in pit');
    end;



    P.s sorry i have no idea how to post simba code in its own seperate text box.

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    For Simba code, you use SIMBA tags, like: [ simba ] [/ simba ] without the spaces obviously

    Simba Code:
    function attack: integer;
    var
      x, y, Pit: integer;
    begin
      if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then //We we find this bitmap, then...
       begin
         MoveMouse(x, y); //Move the mouse to where we found it (don't click or anything though)
         writeLn('inside pit');
       end;

      if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then //If we find this color(?)
       begin
         writeLn('target found'); //I guess the above color is of a monster to attack?
         MoveMouse(x, y); //Move the mouse, wait 2 seconds and then click? I hope the target isn't moving...
         wait(2000);
         ClickMouse(x, y, MOUSE_LEFT);
         wait(2000)
       end else writeln('target not found, not in pit');
    end;

    Looks like you have a functional function (why is this a function btw? You've set it to return an integer but never assign a result) here. What's it not doing that you want it to?
    Last edited by KeepBotting; 03-07-2015 at 02:33 AM.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  3. #3
    Join Date
    Sep 2014
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Hi , thanks for looking at my code yes when it finds the bitmap it moves mouse to it then I want it to search for a color to attack only if it's inside the pit. So far my script searches for the target color everywhere and not where the bitmap is found. I only want it to search for target colors when bitmap is found.

  4. #4
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by henryuscola View Post
    Hi , thanks for looking at my code yes when it finds the bitmap it moves mouse to it then I want it to search for a color to attack only if it's inside the pit. So far my script searches for the target color everywhere and not where the bitmap is found. I only want it to search for target colors when bitmap is found.
    Easiest way to do that would be to tell the function to exit if the first bitmap isn't found, like so:

    Simba Code:
    function attack: integer;
    var
      x, y, Pit: integer;
    begin
      if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then //We we find this bitmap, then...
       begin
         MoveMouse(x, y); //Move the mouse to where we found it (don't click or anything though)
         writeLn('inside pit');
       end else exit; //I've added this bit here.
                        //If the bitmap is not found, we'll exit the routine.

      if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then //If we find this color(?)
       begin
         writeLn('target found'); //I guess the above color is of a monster to attack?
         MoveMouse(x, y); //Move the mouse, wait 2 seconds and then click? I hope the target isn't moving...
         wait(2000);
         ClickMouse(x, y, MOUSE_LEFT);
         wait(2000)
       end else writeln('target not found, not in pit');
    end;
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  5. #5
    Join Date
    Sep 2014
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Easiest way to do that would be to tell the function to exit if the first bitmap isn't found, like so:

    Simba Code:
    function attack: integer;
    var
      x, y, Pit: integer;
    begin
      if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then //We we find this bitmap, then...
       begin
         MoveMouse(x, y); //Move the mouse to where we found it (don't click or anything though)
         writeLn('inside pit');
       end else exit; //I've added this bit here.
                        //If the bitmap is not found, we'll exit the routine.

      if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then //If we find this color(?)
       begin
         writeLn('target found'); //I guess the above color is of a monster to attack?
         MoveMouse(x, y); //Move the mouse, wait 2 seconds and then click? I hope the target isn't moving...
         wait(2000);
         ClickMouse(x, y, MOUSE_LEFT);
         wait(2000)
       end else writeln('target not found, not in pit');
    end;

    Hey thanks for your help so far this part of the script runs well but I've been having problems with DTMs like it finds the Dtms after first run but if I run the script again it doesn't detect the dtms ? Any ideas? I figured using dtms will make the script more efficient and less buggy but idk.

  6. #6
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by henryuscola View Post
    Hey thanks for your help so far this part of the script runs well but I've been having problems with DTMs like it finds the Dtms after first run but if I run the script again it doesn't detect the dtms ? Any ideas? I figured using dtms will make the script more efficient and less buggy but idk.
    What kinds of things are you attempting to detect with DTMs? They work fine for stuff like sprites or deformable aspects (inventory items etc) but 3d models or things that deform a lot aren't going to work
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  7. #7
    Join Date
    Sep 2014
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    What kinds of things are you attempting to detect with DTMs? They work fine for stuff like sprites or deformable aspects (inventory items etc) but 3d models or things that deform a lot aren't going to work
    Still no luck with them, I want to detect some icons on the minimap such as trees. Now when I test to show matching dtms it will show them but when running the script it's like it just skips through the procedure and ignores the dtms

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
  •