Results 1 to 13 of 13

Thread: [PkHonor] Magic Tree Cutter Need Help with Random Event

  1. #1
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default [PkHonor] Magic Tree Cutter Need Help with Random Event

    I would like to add a random event solver into my code, so I could cut magic trees essentially forever. There is no bank requires because on this private server whenever you cut down a tree instead of getting logs you get points. There is only one random event and it requires you to click on a portal and leave. It happens about once a hour and although my bot works well without it I would like to know how to solve a random event and it would help me to bot overnight.
    Code:
    program PkHonor;
    {$i srl/srl.simba}
    
    const
      LOGS = 100;
    
    Procedure ClickTree;
    var
      X,Y:Integer;
    begin
    repeat
      if FindColorTolerance(X, Y, 14678264, 1, 5, 760, 502, 1) or
      FindColorTolerance(X, Y, 12187896, 1, 5, 760, 502, 1)then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
          wait(10000+random(5000));
      end;
    until (LOGS > 100);
    end;
    Begin
    SetupSRL;
    MouseSpeed := 30;
    ClickTree;
    end.

  2. #2
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Just add another FindColorTolerance that matches the color of the portal and click it when it's visible.

  3. #3
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    How could i have it teleport back to the certain area if it goes there though?

  4. #4
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ok, so its cutting trees it gets the random and the random teleports it to falador where there are no trees. Could I have a else statement returning me to the tree cutting area?

  5. #5
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    I didn't realise it could teleport you elsewhere in the world. You would have to have an else statement that somehow returned you to the tree cutting area.

  6. #6
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes I have the else statement but I have no idea how to have it teleport me back. Thanks!

  7. #7
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    I won't be able to help much without knowing what you're capable of on this server. I recommend some sort of teleport return if you can, or some method of transporting yourself to a known area, and walking from there.

  8. #8
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Well, there is a teleport in the magic book to get you there? Is it possible to click it?

  9. #9
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    If you have access to said magic and are capable of casting the spell, then I don't see why not? I recommend using DTMs to find spells to cast.

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

    Default

    Can we see a pic of the portal?

  11. #11
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Here is full code works perfectly and tellies back! How could I make it not take over my mouse?
    Code:
     program PkHonor;
    {$i srl/srl.simba}
    
    const
      LOGS = 100;
    
    Procedure ClickTree;
    var
      X,Y:Integer;
    begin
    repeat
      if FindColorTolerance(X, Y, 14678264, 1, 5, 760, 502, 1) or
      FindColorTolerance(X, Y, 12187896, 1, 5, 760, 502, 1) or
      FindColorTolerance(X, Y, 11661552, 1, 5, 760, 502, 1) then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
          wait(10000+random(5000));
          KeyDown(39);
          wait(RandomRange(50,100));
          KeyUp(39);
      end else
      begin
          KeyDown(39);
          wait(RandomRange(100,200));
          KeyUp(39);
          wait(RandomRange(500,1000));
          PressKey(118);
          wait(500);
          mmouse(648, 400, 1, 1);
          wait(100)
          ClickMouse(X, Y, mouse_Left);
          wait(500);
          mmouse(263, 447, 1, 1);
          wait(100);
          ClickMouse(X, Y, mouse_Left);
          wait(10000);
      end;
    until (LOGS > 100);
    end;
    
    Begin
    SetupSRL;
    MouseSpeed := 30;
    ClickTree;
    end.

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

    Default

    Quote Originally Posted by schmidt73 View Post
    Here is full code works perfectly and tellies back! How could I make it not take over my mouse?
    Code:
     program PkHonor;
    {$i srl/srl.simba}
    
    const
      LOGS = 100;
    
    Procedure ClickTree;
    var
      X,Y:Integer;
    begin
    repeat
      if FindColorTolerance(X, Y, 14678264, 1, 5, 760, 502, 1) or
      FindColorTolerance(X, Y, 12187896, 1, 5, 760, 502, 1) or
      FindColorTolerance(X, Y, 11661552, 1, 5, 760, 502, 1) then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
          wait(10000+random(5000));
          KeyDown(39);
          wait(RandomRange(50,100));
          KeyUp(39);
      end else
      begin
          KeyDown(39);
          wait(RandomRange(100,200));
          KeyUp(39);
          wait(RandomRange(500,1000));
          PressKey(118);
          wait(500);
          mmouse(648, 400, 1, 1);
          wait(100)
          ClickMouse(X, Y, mouse_Left);
          wait(500);
          mmouse(263, 447, 1, 1);
          wait(100);
          ClickMouse(X, Y, mouse_Left);
          wait(10000);
      end;
    until (LOGS > 100);
    end;
    
    Begin
    SetupSRL;
    MouseSpeed := 30;
    ClickTree;
    end.
    You would have to make massive edits to S.M.A.R.T which would require a lot of Java and Pascal knowledge OR you could use a virtual machine

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

    Default

    Using a virtual machine seems to be the most reasonable.. I have played the server before. I have a script that I used to use for magic logs, but I believe the random event was different. There was never a random that tellied me to fally, just bob the cat.

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
  •