Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 52

Thread: i got an problem with my mouse

  1. #26
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    ok so i changed the colours in the cache and now it looks like this:

  2. #27
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    what should be the code now i got this but to what i need to change it
    Simba Code:
    program new;
    {$i srl/srl.simba}   //SRL INCLUDE

    procedure AttackMonster;
    var
      x, y, attempts:integer;  //Variable Declarations
    begin
      repeat             //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
        if findcolortolerance(x, y, 7430757, MSX1, MSY1, MSX2, MSY2, 10) then
          begin
            MMouse(x, y, 5, 5);     //Moves mouse to color with 5 pixel's randomness
            wait(randomrange(200, 500)); //Waits a random number between 200 and 500
          end;
          begin
            writeln('We attempted more then 10 times to find the monster!');
            Terminatescript;    //then we stop the script.
          end;
    begin
      SetupSRL;
      AttackMonster;
    end.

    and i get this error
    Code:
    [Error] C:\Program Files (x86)\Simba\Scripts\Mijn Script.simba(22:4): Identifier expected at line 21
    Compiling failed.

  3. #28
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Simba Code:
    program new;
    {$i srl/srl.simba}   //SRL INCLUDE

    procedure AttackMonster;
    var
      x, y, attempts:integer;  //Variable Declarations
    begin
      repeat             //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
        if findcolortolerance(x, y, 7430757, MSX1, MSY1, MSX2, MSY2, 10) then
        begin
          MMouse(x, y, 5, 5);     //Moves mouse to color with 5 pixel's randomness
          wait(randomrange(200, 500)); //Waits a random number between 200 and 500
          //not clicking or something?
        end else    (* you have to add else to tell it to do otherwise *)
        begin
          writeln('We attempted more then 10 times to find the monster!');
          Terminatescript;    //then we stop the script.
        end;

        (*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
      until False;
    end;  (*if you begin something, you should end it. this is not only the principle of life but of scripting as well ;) *)

    begin
      SetupSRL;
      AttackMonster;
    end.

  4. #29
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    ok so i changed the colours in the cache and now i have this:

    and this is my code and how can i make it work now:
    Simba Code:
    program new;
    {$i srl/srl.simba}   //SRL INCLUDE

    procedure AttackMonster;
    var
      x, y, attempts:integer;  //Variable Declarations
    begin
      repeat             //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
        if findcolortolerance(x, y, 8021606, MSX1, MSY1, MSX2, MSY2, 10) then
          begin
            MMouse(x, y, 5, 5);     //Moves mouse to color with 5 pixel's randomness
            wait(randomrange(200, 500)); //Waits a random number between 200 and 500
          end;
          begin
            writeln('We attempted more then 10 times to find the monster!');
            Terminatescript;    //then we stop the script.
          end;
    begin
      SetupSRL;
      AttackMonster;
    end.

    and i get this error when i run this script:
    Code:
    [Error] C:\Program Files (x86)\Simba\Scripts\Mijn Script.simba(22:4): Identifier expected at line 21
    Compiling failed.

  5. #30
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Simba Code:
    program new;
    {$i srl/srl.simba}   //SRL INCLUDE

    procedure AttackMonster;
    var
      x, y, attempts:integer;  //Variable Declarations
    begin
      repeat             //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
        if findcolortolerance(x, y, 7430757, MSX1, MSY1, MSX2, MSY2, 10) then
        begin
          MMouse(x, y, 5, 5);     //Moves mouse to color with 5 pixel's randomness
          wait(randomrange(200, 500)); //Waits a random number between 200 and 500
          //not clicking or something?
        end else    (* you have to add else to tell it to do otherwise *)
        begin
          writeln('We attempted more then 10 times to find the monster!');
          Terminatescript;    //then we stop the script.
        end;

        (*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
      until False;
    end;  (*if you begin something, you should end it. this is not only the principle of life but of scripting as well ;) *)

    begin
      SetupSRL;
      AttackMonster;
    end.
    with this code it doesn't click it will find the monster but it doesn't click maybe an solution don't look at the post from me above this that was an accident

  6. #31
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    You even commented it yourself '//Moves mouse to color with 5 pixel's randomness', so yeah its going to move there but if you don't tell it to click it wont click.

    I've even added comment asking why aren't you clicking but i didn't add in in case you are just testing or something.
    Add a ClickMouse2(mouse_Left) after MMouse, or use Mouse(x, y, 5, 5, mouse_Left), which is the combination of the 2.

  7. #32
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by remember me View Post
    with this code it doesn't click it will find the monster but it doesn't click maybe an solution don't look at the post from me above this that was an accident
    Hi remember me,

    Please check out this tutorial, and following that, this tutorial.

    Regards,
    ~ Daniel.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  8. #33
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    You even commented it yourself '//Moves mouse to color with 5 pixel's randomness', so yeah its going to move there but if you don't tell it to click it wont click.

    I've even added comment asking why aren't you clicking but i didn't add in in case you are just testing or something.
    Add a ClickMouse2(mouse_Left) after MMouse, or use Mouse(x, y, 5, 5, mouse_Left), which is the combination of the 2.
    omg i am noob sorry that i dindn't saw that but i got only one problem you type
    as comment
    Code:
    (*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
    but how can i add that?
    people said some things but i don't know where to add

    Quote Originally Posted by Daniel View Post
    Hi remember me,

    Please check out this tutorial, and following that, this tutorial.

    Regards,
    ~ Daniel.
    thanks for the handy tutorials Daniel

    Originally Posted by riwu
    You even commented it yourself '//Moves mouse to color with 5 pixel's randomness', so yeah its going to move there but if you don't tell it to click it wont click.

    I've even added comment asking why aren't you clicking but i didn't add in in case you are just testing or something.
    Add a ClickMouse2(mouse_Left) after MMouse, or use Mouse(x, y, 5, 5, mouse_Left), which is the combination of the 2.
    omg i am noob sorry that i dindn't saw that but i got only one problem you type
    as comment
    Code:
    (*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
    but how can i add that?
    people said some things but i don't know where to add
    Last edited by Daniel; 10-19-2012 at 01:43 AM. Reason: Triple post.

  9. #34
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by remember me View Post
    omg i am noob sorry that i dindn't saw that but i got only one problem you type
    as comment
    Code:
    (*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
    but how can i add that?
    people said some things but i don't know where to add
    Check out the tutorial links Daniel gave. We had given you a lot of ideas in previous posts, so you will just need to learn how to apply them after you learn the basics of scripting.

    Also don't triple post in the future, edit your posts.

  10. #35
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    i am now looking in the beginner's simba tutorial
    but can i find there how i can make when it has killed the man or the monster
    that it go search for another man or monster

  11. #36
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by remember me View Post
    i am now looking in the beginner's simba tutorial
    but can i find there how i can make when it has killed the man or the monster
    that it go search for another man or monster
    You will have to make some custom function man... there's no functions in srl that will do that in a private server.

  12. #37
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Think about how you as a person would know that the npc is dead. I'm guessing it has something to do with the animation - and health bar (colors). Then try to apply that using the color finding functions

  13. #38
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    something like
    that i click on that colour then if it can't find the colour green that the scripts knows
    "ah, it's dead so i need to click another npc"
    something like that?

  14. #39
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Regardless of camera angle, the apperance of the health bar never changes, and some monsters that are powerful(have enough health) enough will still be fighting when the health bar appears to be fully depleted. You could take a DTM of the outline of the health bar, and check for that. Or, if its a weak monster, just look for green in the health bar.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  15. #40
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    what do you mean with dtm?
    and how should the code looks like then

  16. #41
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Watch Yohojo's DTM tutorial if the looking for green thing doesn't work.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  17. #42
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    gonna look it later gtds(got to do something)

  18. #43
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    i got now this code:
    Simba Code:
    program GhostKilling;
    {$i srl/srl.simba}
    procedure AttackMonster;
    var HealthBar, X, Y: Integer;
    begin
      repeat
        HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
        If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
        Then Wait(300)
        end else
        begin
          if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
            MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
          end;
          until False;
        end;
    begin
    end.
    and i get this error
    Code:
    [Error] C:\Program Files (x86)\Simba\Scripts\GhostKilling.simba(11:5): Identifier expected at line 10
    Compiling failed.
    ok and i want to add that if he finds more then one it then waits and if he finds one
    he just click another monster because if you kill the monster then your bar stands there longer and i want that simba not wait for my bar to dissapear *sorry for my noobish english*
    Last edited by remember me; 10-21-2012 at 07:02 PM.

  19. #44
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Remove the 'end' beside the 'else', there is no begin (not needed since it's 1 command), hence there is no need for an 'end'.

  20. #45
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    ok i removed but when i use the code it just spam clicks and i get this error when i stop the
    script:
    Code:
    The following DTMs were not freed: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58]
    and this is my simba code:
    Simba Code:
    program GhostKilling;
    {$i srl/srl.simba}
    procedure AttackMonster;
    var HealthBar, X, Y: Integer;
    begin
      repeat
        HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
        If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
        Then Wait(300)
        else
        begin
          if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
            MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
          end;
          until False;
        end;
    begin
    setupsrl;
    AttackMonster;
    end.

  21. #46
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    For freeing the DTM you need to have:

    Simba Code:
    FreeDTM(HealthBar);

  22. #47
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    now i got this code
    Simba Code:
    program GhostKilling;
    {$i srl/srl.simba}
    procedure AttackMonster;
    var HealthBar, X, Y: Integer;
    begin
      repeat
        HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
        FreeDTM(HealthBar)
        If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
        Then Wait(300)
        else
        begin
          if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
            MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
          end;
          until False;
        end;
    begin
    setupsrl;
    AttackMonster;
    end.
    and this error:
    Code:
    [Hint] C:\Program Files (x86)\Simba\Includes\SRL/SRL/core/globals.simba(55:3): Variable 'WORLDSWITCHERENABLED' never used at line 54
    Compiled successfully in 624 ms.
    SRL Compiled in 15 msec
    Error: Exception: The given DTM Index[2] doesn't exist at line 9
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]
    how to fix this?

  23. #48
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    The
    Simba Code:
    FreeDTM(HealthBar)
    has to be in the procedure, but after you're done using it.

    Like this:
    Simba Code:
    program GhostKilling;
    {$i srl/srl.simba}
    procedure AttackMonster;
    var HealthBar, X, Y: Integer;
    begin
      repeat
        HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
        If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
        Then Wait(300)
        else
        begin
          if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
            MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
        end;
      until False;
      FreeDTM(HealthBar)// Here
    end;
    begin
      setupsrl;
      AttackMonster;
    end.
    Last edited by Ian; 10-22-2012 at 11:04 PM.

  24. #49
    Join Date
    Jan 2012
    Location
    127.0.0.1
    Posts
    702
    Mentioned
    11 Post(s)
    Quoted
    76 Post(s)

    Default

    Try this- note there were variouus issues with the code
    Simba Code:
    program GhostKilling;
    {$i srl/srl.simba}

    Procedure AttackMonster;
    Var
      HealthBar, X, Y: Integer;
    Begin
      HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt'); //Dont constantly declare the dtm in the loop
      Repeat
        If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
          Begin
            Wait(300);
         End
        Else
        Begin
          //Why did you free the DTM before using it?
          If findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
            Begin
              MMouse(x, y, 5, 5);
              wait(randomrange(200, 500));
              ClickMouse2(mouse_Left)
            End;
        End;
      Until False;
      FreeDTM(HealthBar); //Free it after the function
    End;

    begin
      setupsrl;
      AttackMonster;
    end.

    E: @BMXi there are also other issues i.e. this
    Simba Code:
    begin
          if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
            MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
          end;
    This basicly tells the mouse to wait and click regardless of whether colour was found or not
    corrections in my code above
    Last edited by Enslaved; 10-22-2012 at 11:16 PM.

  25. #50
    Join Date
    May 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    ok now i got this code
    Simba Code:
    program GhostKilling;
    {$i srl/srl.simba}
    procedure AttackMonster;
    var
     HealthBar, X, Y: Integer;
    begin
      HealthBar := DTMFromString('mrAAAAHic42BABaZQLAPFZkDMDMRsSGrYkPhguQkMDEJCQjjxfwb8gJEAhgEAlDEEEA==');
      repeat
        If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
          Begin
            Wait(300)
          end
        Else
        begin
        if findcolortolerance(x, y, 11119020, MSX1, MSY1, MSX2, MSY2, 10) then
          Begin
            MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
          end;
        End;
      until False;
      FreeDTM(HealthBar);
    end;

    begin
    setupsrl;
    AttackMonster;
    end.

    but now i want that it not just keeps clicking i want that it click one time like that this lines:
    Simba Code:
    MMouse(x, y, 5, 5);
            wait(randomrange(200, 500));
            ClickMouse2(mouse_Left)
    just click once because if it clicks on an monster it keeps clicking and clicking and than
    it clicks on other monsters and then my man is gonna walk away and... that takes houres


    Can you help me?
    Last edited by remember me; 10-25-2012 at 05:51 PM.

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •