Results 1 to 12 of 12

Thread: IsMoving

  1. #1
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default IsMoving

    Need to make my script wait while choping tree. Trying to use IsMoving but it's constantly clicking the tree. Help? =o
    Also, Trying to get it to put the angle to high still haven't been able to figure this out

    I put the WaitRandomRange(5000,10000) to help see if working.



    Simba Code:
    program ArticPines;
    {$DEFINE SRL5}
    {$DEFINE SMART}

    {$i srl/srl.simba}


     var
     x, y, i: integer;

     Procedure DeclarePlayers;
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;
        with Players[0] do
        begin
          Name         := '';
          Pass         := '';
          BoxRewards   := ['XP','xp','lamp'];
          LampSkill    := Skill_Woodcutting;
          Active       := True;
        end;
      end;


    Function IsMoving_W: Boolean;
      begin
        Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 200) > 10000;
      end;

    procedure Light;
    var
      SlotBox:TBox;
      DropsPattern: TIntegerArray;
    begin
      DropsPattern:=[1,2];

      For i:=0 to 1 Do
      Begin
        FindNormalRandoms;

        SlotBox:=InvBox(DropsPattern[i]);
        GetMousePos(X, Y);
        Mouse(X, Y, 0, 0, True);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);

        Wait(50+Random(20));


        End;
    End;



    function FindTree (Var X,Y: Integer) : boolean;
    var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      i : integer;

    begin
      result := False;

      x := MSCx;                         //need to get color
      y := MSCy;
      FindColorsSpiralTolerance( x, y, MyTPA, 7371627, MSx1, MSy1, MSx2, MSy2, 10);
      if (Length(MyTPA) < 1) then
          Exit;

      for i:=0 to High(MyTPA)do
      begin
        MyPoint:= MyTPA[i]
        MMouse( MyPoint.x, MyPoint.y, 3, 3);
        if WaitUpTextMulti(['hop','rctic'], 400) then
          begin
            Result := True;
            GetMousePos( x, y);
            Exit;
          end;
      end;
    //use TPA's
    //positions mouse
    //check uptext
    //GetMousePos( x, y);
    end;




    function FindTree2 (Var X,Y: Integer) : boolean;
    var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      i : integer;

    begin
      result := False;
                                        //need to get color
      x := MSCx;
      y := MSCy;
      FindColorsSpiralTolerance( x, y, MyTPA, 14147017, MSx1, MSy1, MSx2, MSy2, 10);
      if (Length(MyTPA) < 1) then
          Exit;

      for i:=0 to High(MyTPA)do
      begin
        MyPoint:= MyTPA[i]
        MMouse( MyPoint.x, MyPoint.y, 3, 3);
        if WaitUpTextMulti(['hop','rctic'], 400) then
          begin
            Result := True;
            GetMousePos( x, y);
            Exit;
          end;
      end;
    //use TPA's
    //positions mouse
    //check uptext
    //GetMousePos( x, y);
    end;


    procedure chop;
    begin
      if not LoggedIn then
        Exit;
      //areacheck
      FindNormalRandoms;

      if InvFull then
        //Light;

      MakeCompass(0);
      if (FindTree( x, y) or FindTree2( x, y)) then
        begin
          writeln('Found Tree');
          ClickMouse2(True);

          While IsMoving_W do
            Wait(RandomRange( 5000, 10000));

          Wait(RandomRange( 500, 1000));

          //Alch

        end;

    end;

    begin
      Smart_Server := 86;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL();
      DeclarePlayers;
      LoginPlayer;

      LogInPlayer;
      SetAngle(0);
      MakeCompass(0);

      repeat
        if not LoggedIn then LoginPlayer;
        //areacheck;

        chop;

      until(AllPlayersInactive)

      Logout;
      TerminateScript;

    end.

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    IsMoving checks the minimap. You need to use Animating(B:TBox; Time, MinCount: Integer): Boolean;

  3. #3
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol wow, thanks. Yeah i changed to averagepixelshift.

    Question, how the bloody heck due i get the angle high?

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    SetAngle(SRL_ANGLE_HIGH);

  5. #5
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    There's this one function that someone made to do this. Here it is

    Simba Code:
    {*******************************************************************************
    procedure SetAngle(Highest : Boolean);
    By: Raymond, edit by NaumanAkhlaQ
    Description: Sets the mainscreen at highest\lowest angle (Depends on the boolean)
    *******************************************************************************}

    procedure SetAngles(Highest : Boolean);
    begin
      if (not LoggedIn) then exit;
      KeyDown((Integer(not Highest) * 2) + 38);
      Sleep(1000 + Random(300));
      KeyUp((Integer(not Highest) * 2) + 38);
      Wait(500 + Random(100));
    end;
    Formerly known as Cut em2 it

  6. #6
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kk thanks, another.

    I Changed my IsMoving_W into detecting pixel shift.


    I have a while IsMoving_W do.

    It will do what ever i tell it to do and still check the pixel shift of the char correct? And then when it returns false move on?

    So if i wanted to add an alching procedure, it would only happen while moving?


    Edit: Also, for some reason the Angle_High only works some times.

  7. #7
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Yes, but I didn't know you could alch and woodcut at the same time :O

  8. #8
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    Yes, but I didn't know you could alch and woodcut at the same time :O

    Yes, I've got the script to work. At least cutting not for the alching! Also where do you suggest adding my antiban? After IsMoving?

  9. #9
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    When do you want to perform antiban? Between alchs?

  10. #10
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    When do you want to perform antiban? Between alchs?
    Um, I'm thinking between trees. (aka stops moving)

    also back to my question before, it will continually loop during the while moving part?
    Last edited by Littellj; 03-31-2012 at 06:04 AM.

  11. #11
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Yes it will. You will need another loop to handle clicking a new tree and doing antiban.

  12. #12
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is what i have below so far. OK
    1) I've come into a rather annoying thing where it will continually keep clicking
    the alch spell and then checking to see if existsitem(10) & 9, ( I put this in so that it wouln't over alch the logs.

    If i was to put a If existsItem(#) during the while moving loop it would switch to the game tab after every alch. Which is slow and bot like if you ask me.

    Basically my question is how would I make it wait till i have a descent amount of logs in invy, ~8, I was thinking something along the lines of. WaitUntillExistsItem(10) lol




    Is this correct?
    \/
    Simba Code:
    if (FindTree( x, y) or FindTree2( x, y)) then
        begin
          writeln('Found Tree');
          ClickMouse2(True);

          While IsMoving_W and not(InvFull)do
            begin
              Wait(RandomRange(1000,1500));
              Alch;

            end;

          Wait(RandomRange( 500, 1000));

          {if InvFull then
            Light;}


        end;


    Simba Code:
    program ArticPines;
    {$DEFINE SRL5}
    {$DEFINE SMART}

    {$i srl/srl.simba}


     var
     x, y, i: integer;

     Procedure DeclarePlayers;
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;
        with Players[0] do
        begin
          Name         := '';
          Pass         := '';
          BoxRewards   := ['XP','xp','lamp'];
          LampSkill    := Skill_Woodcutting;
          Active       := True;
        end;
      end;



    Function IsMoving_W: Boolean;
    var
      PBox: TBox;
    begin
      PBox := IntToBox(245, 130, 285, 195);
      Result := (AveragePixelShift(PBox, 250, 500) > 600);
    end;
    procedure Light;
    var
      SlotBox:TBox;
      DropsPattern: TIntegerArray;
    begin
      DropsPattern:=[1,2];

      For i:=0 to 1 Do
      Begin
        FindNormalRandoms;

        SlotBox:=InvBox(DropsPattern[i]);
        GetMousePos(X, Y);
        Mouse(X, Y, 0, 0, True);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);
        Wait(20+Random(20));

        MoveMouse(X, Y+40);
        ClickMouse(X, Y, mouse_Left);

        Wait(50+Random(20));


        End;
    End;


    ////////////////////////////////////////////////////////////////////
    /////////////{Modified from FLIGHTS Heavy Rodder!}//////////////////
    ////////////////////////////////////////////////////////////////////

     Procedure ReadyAlch;
     var
        AlchBMP: Integer;
     begin
      AlchBMP := BitmapFromString(10, 6, 'meJwLuf2Kd8o6JkYmVl1+sVgVpk0' +
            'y8sez4Uhi10WILLsQO4sHG1MOC1ABHAGl2OKaILJABDQBGQGlIAii' +
            'AFOWtbwfiICyaAq+n0oEigMNZ/HJZjFwhyuA2wIAwl0jlg==');

      if FindBitmapIn(AlchBMP, X, Y, MIX1, MIY1, MIX2, MIY2) then
      begin
        MMouse(X, Y, 3, 3);
        ClickMouse2(True);
      end else if not FindBitmapIn(AlchBMP, X, Y, MIX1, MIY1, MIX2, MIY2) then
      begin
        GameTab(tab_Magic);
        if FindBitmapIn(AlchBMP, X, Y, MIX1, MIY1, MIX2, MIY2) then
        begin
          MMouse( x, y, 5, 5);
          ClickMouse2(True);
          MMouseItem(22);
        end;
      end;
      FreeBitmap(AlchBMP);

    end;


    Procedure Alch;
    begin
      ReadyAlch;

      repeat

      if InvFull then
        exit;

      if ExistsItem(10) and ExistsItem(9) then
      begin
        MMouseItem(22);
          if WaitUpTextMulti(['Cast', 'ow L', 'evel', 'lchem'], 400) then
          ClickMouse2(True);
      end;

      ReadyAlch;
      until(not(IsMoving_W))

    end;



    function FindTree (Var X,Y: Integer) : boolean;
    var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      i : integer;

    begin
      result := False;

      x := MSCx;                         //need to get color
      y := MSCy;
      FindColorsSpiralTolerance( x, y, MyTPA, 7371627, MSx1, MSy1, MSx2, MSy2, 10);
      if (Length(MyTPA) < 1) then
          Exit;

      for i:=0 to High(MyTPA)do
      begin
        MyPoint:= MyTPA[i]
        MMouse( MyPoint.x, MyPoint.y, 3, 3);
        if WaitUpTextMulti(['hop','rctic'], 400) then
          begin
            Result := True;
            GetMousePos( x, y);
            Exit;
          end;
      end;
    //use TPA's
    //positions mouse
    //check uptext
    //GetMousePos( x, y);
    end;




    function FindTree2 (Var X,Y: Integer) : boolean;
    var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      i : integer;

    begin
      result := False;
                                        //need to get color
      x := MSCx;
      y := MSCy;
      FindColorsSpiralTolerance( x, y, MyTPA, 14147017, MSx1, MSy1, MSx2, MSy2, 10);
      if (Length(MyTPA) < 1) then
          Exit;

      for i:=0 to High(MyTPA)do
      begin
        MyPoint:= MyTPA[i]
        MMouse( MyPoint.x, MyPoint.y, 3, 3);
        if WaitUpTextMulti(['hop','rctic'], 400) then
          begin
            Result := True;
            GetMousePos( x, y);
            Exit;
          end;
      end;
    //use TPA's
    //positions mouse
    //check uptext
    //GetMousePos( x, y);
    end;


    procedure chop;
    begin
      if not LoggedIn then
        Exit;
      //areacheck
      FindNormalRandoms;

      if InvFull then
        //Light;

      SetAngle(0);
      MakeCompass(0);
      if (FindTree( x, y) or FindTree2( x, y)) then
        begin
          writeln('Found Tree');
          ClickMouse2(True);

          While IsMoving_W do
            begin
              Wait(RandomRange(1000,1500));
              Alch;

            end;

          Wait(RandomRange( 500, 1000));

          {if InvFull then
            Light;}


        end;

    end;

    begin
      Smart_Server := 86;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL();
      DeclarePlayers;
      LoginPlayer;

      LogInPlayer;
      SetAngle(0);
      MakeCompass(0);

      repeat
        if not LoggedIn then LoginPlayer;
        //areacheck;

        chop;

      until(AllPlayersInactive)

      Logout;
      TerminateScript;

    end.

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
  •