Results 1 to 6 of 6

Thread: New Procedure?

  1. #1
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Exclamation New Procedure?

    Ok this is my RSPS Powerchopper I am working on.
    Before I added the DropLog Procedure it was clicking the trees fine except I still need to add pixelshift in; however now it doesn't do anything! Please help a newbie out
    It says:
    Code:
    Compiled successfully in 375 ms.
    Successfully executed.
    So I need help Adding this:

    Code:
    Procedure DropLog;
    var
      X,Y:Integer;
    begin
    if FindColorTolerance(X, Y, 605787, 561, 226, 738, 484, 5) then
    begin
      mmouse(x, y,1,1);
      wait(250);
      ClickMouse(X, Y, mouse_Right)
      wait(450);
        if FindBitmapToleranceIn(Drop, X, Y, 561, 226, 738, 484, 145) then
        begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
      end;
    end;
    Begin
    MouseSpeed := 15;
    Drop := BitmapFromString(100, 10, 'meJzNlm0KwjAMhnseEbyCqCCo4' +
            'NX8s7vsBLuWVgPlNR/v2s6BIz/SNF2ap0npME4ppdtpO4xTlqz8XP' +
            'aPp4gaStxVJQp0Pb4lGhajGg7frOr3fz/vWlkp6WOF2KO8mliJrsT' +
            '6Xw4bl5XoqtJcI7HbDVvFwowgoz19Pu4jKc8GQjcRZKUOl7Mqu8Ih' +
            'Yons0eGKJ1qKXuxqlWu3PgjQhkZuTYHw54QVRndnic4bgRy3ZZib3' +
            'bXbsiHHpJxrdFuHlVmvx8oea306qNt7Bvn0sVKN8D+slujubdzBJy' +
            'rUworcTuhPPK19eQ/O9qbbJgiKO+NWSSDl796NbtbWExG5S6K/ueG' +
            'ibaiUyVpVWtwZq5EE4qnVS+urrE/c1nAfQjjl3mCVgfD1VWZfuuW+' +
            'zQ==');
    DropLog;
    FreeBitmap(Drop);
    end.
    INTO THIS:

    Code:
    program CrisisXCutter;
    {$i srl/srl.simba}
    var
      Drop:Integer;
    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 := 15;
    ClickTree;
    DropLog;
    end.
    Last edited by icode; 08-08-2013 at 05:20 PM.

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

    Default

    Localize variables whenever possible
    Simba Code:
    Procedure DropLog;
    var
      X, Y, Drop:Integer;
    begin
      if FindColorTolerance(X, Y, 605787, 561, 226, 738, 484, 5) then
      begin
        mmouse(x, y,1,1);
        wait(250);
        ClickMouse(X, Y, mouse_Right)
        wait(450);

        Drop := BitmapFromString(100, 10, 'meJzNlm0KwjAMhnseEbyCqCCo4' +
              'NX8s7vsBLuWVgPlNR/v2s6BIz/SNF2ap0npME4ppdtpO4xTlqz8XP' +
              'aPp4gaStxVJQp0Pb4lGhajGg7frOr3fz/vWlkp6WOF2KO8mliJrsT' +
              '6Xw4bl5XoqtJcI7HbDVvFwowgoz19Pu4jKc8GQjcRZKUOl7Mqu8Ih' +
              'Yons0eGKJ1qKXuxqlWu3PgjQhkZuTYHw54QVRndnic4bgRy3ZZib3' +
              'bXbsiHHpJxrdFuHlVmvx8oea306qNt7Bvn0sVKN8D+slujubdzBJy' +
              'rUworcTuhPPK19eQ/O9qbbJgiKO+NWSSDl796NbtbWExG5S6K/ueG' +
              'ibaiUyVpVWtwZq5EE4qnVS+urrE/c1nAfQjjl3mCVgfD1VWZfuuW+' +
              'zQ==');
        if FindBitmapToleranceIn(Drop, X, Y, 561, 226, 738, 484, 145) then
        begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;

        FreeBitmap(Drop);
      end;
    end;

    Also in ClickTree() there is an infinite loop since LOGS can never change its value.

  3. #3
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Localize variables whenever possible
    Simba Code:
    Procedure DropLog;
    var
      X, Y, Drop:Integer;
    begin
      if FindColorTolerance(X, Y, 605787, 561, 226, 738, 484, 5) then
      begin
        mmouse(x, y,1,1);
        wait(250);
        ClickMouse(X, Y, mouse_Right)
        wait(450);

        Drop := BitmapFromString(100, 10, 'meJzNlm0KwjAMhnseEbyCqCCo4' +
              'NX8s7vsBLuWVgPlNR/v2s6BIz/SNF2ap0npME4ppdtpO4xTlqz8XP' +
              'aPp4gaStxVJQp0Pb4lGhajGg7frOr3fz/vWlkp6WOF2KO8mliJrsT' +
              '6Xw4bl5XoqtJcI7HbDVvFwowgoz19Pu4jKc8GQjcRZKUOl7Mqu8Ih' +
              'Yons0eGKJ1qKXuxqlWu3PgjQhkZuTYHw54QVRndnic4bgRy3ZZib3' +
              'bXbsiHHpJxrdFuHlVmvx8oea306qNt7Bvn0sVKN8D+slujubdzBJy' +
              'rUworcTuhPPK19eQ/O9qbbJgiKO+NWSSDl796NbtbWExG5S6K/ueG' +
              'ibaiUyVpVWtwZq5EE4qnVS+urrE/c1nAfQjjl3mCVgfD1VWZfuuW+' +
              'zQ==');
        if FindBitmapToleranceIn(Drop, X, Y, 561, 226, 738, 484, 145) then
        begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;

        FreeBitmap(Drop);
      end;
    end;

    Also in ClickTree() there is an infinite loop since LOGS can never change its value.
    Awesome thanks! and yeah I know still working on that and can I just put the droplog procedure after the clicktree one but before the main functions right?

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

    Default

    Quote Originally Posted by icode View Post
    Awesome thanks! and yeah I know still working on that and can I just put the droplog procedure after the clicktree one but before the main functions right?
    What main functions?

  5. #5
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    What main functions?
    Begin
    SetupSRL;
    MouseSpeed := 15;
    ClickTree;
    DropLog;
    end.

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

    Default

    Quote Originally Posted by icode View Post
    Begin
    SetupSRL;
    MouseSpeed := 15;
    ClickTree;
    DropLog;
    end.
    Yeah, except you probably need a loop to repeat the 2 procedures.
    Also MouseSpeed := 15; isn't needed as it has been called in SetupSRL().

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
  •