Results 1 to 2 of 2

Thread: Script Help

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

    Default Script Help

    Simba Code:
    program WillowTreeBanker;
    {$I SRL/SRL.Simba}
    {$I P07Incliude.Simba}

    var
        AnimationCheck, Skiller, RunFromCombat, Lagg, ChopWaitT, invcount1, invcount2, ChopWaitTime, TreeColor, BankDTM, BankColor1: integer;
        Location: string;

    procedure DTM;
    begin
    //make sure axe is in first slot first row or weilded
    Skiller := 1; //weilding axe = 0  axe is in inv = 1
    RunFromCombat := 1; //1 = yes 0 = no
    Lagg := 750; //lag time in ms
    ChopWaitTime := 15;  //time to check if chopping
    AnimationCheck := 90; //for pixelshift, chopping

    Location := 'Willow';  //Willow or Maple

    if(Location = 'Maple') then //over at seers
    begin
    TreeColor := 12892;
    BankColor1 := 8229016;
    BankDTM := DTMFromString('mQwAAAHicY2ZgYOBnYWAQBmJpIH7IgMB//jDBMSuQD8OMSBgIAFujCPA=');
    end;
    if(Location = 'Willow') then //over at draynor
    begin
    BankDTM:= DTMFromString('mQwAAAHicY2ZgYGhmYmDohmIZBgiWAOK3bxGYiwGBGZEwEAAAMdAHog==');
    BankColor1 := 2578800;
    TreeColor := 2506563;
    end;

    end;

    Procedure P07_DeclarePlayer;
    Begin
      P07_PlayerName:='';
      P07_PlayerPass:='';
    end;

    //DONT EDIT BELOW

    procedure WaitHumanClick;
    begin
      case random(600) of
        1..450: Wait(RandomRange(0, 100));
        451..570: Wait(RandomRange(0, 200));
        571..590: Wait(RandomRange(0, 600));
        591..600: Wait(RandomRange(400, 1100));
      end;
    end;

    procedure FreeDTMss;
    begin
      FreeDTM(BankDTM);
    end;

    procedure GoToBank;
    var x, y: integer;
    begin
      P07_MakeCompassNorth;
      WaitHumanClick;
      if(findDTM(BankDTM, x, y, 565, 7, 717, 157)) then
      begin
        case Location of
        'Willow': Mouse(RandomRange(X + 15, x + 20), RandomRange(Y - 8, Y - 13), random(3), random(3), true);
        'Maple': Mouse(RandomRange(X - 5, x + 5), RandomRange(Y + 10, Y + 15), random(3), random(3), true);
        end;
      end;
      P07_FFlag;
      wait (lagg);
    end;

    procedure BankLogs;
    begin
      if(skiller = 1) then
      begin
      P07_Deposit(2, 28, True);
      wait (lagg);
      end
      else
      begin
        P07_Deposit(1, 28, True);
        wait (lagg);
      end;
    end;

    procedure OpenBank1;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      WaitHumanClick;
      Repeat
        If P07_FindObj(x, y, 'ank booth', BankColor1, 10) Then
        begin
          WaitHumanClick;
          Mouse(RandomRange(X - 5, x + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
          WaitHumanClick;
          P07_ChooseOptionMulti(['se-q']);
          wait(lagg * 2);
        end
        else
        begin
          P07_MakeCompassDegree(30);
          GoToBank;
        end;
        P07_FFlag;
        wait (lagg);
      until(P07_BankScreen)
    end;

    procedure GoToTrees;
    var x, y: integer;
    begin
      P07_MakeCompassNorth;
      WaitHumanClick;
      if(findDTM(BankDTM, x, y, 565, 7, 717, 157)) then
      begin
        case Location of
        'Willow': Mouse(RandomRange(X - 5, x - 15), RandomRange(Y + 15, Y + 25), random(3), random(3), true);
        'Maple': Mouse(RandomRange(X - 5, x + 5), RandomRange(Y - 10, Y - 15), random(3), random(3), true);
        end;
      end;
      P07_FFlag;
      wait (lagg);
    end;

    procedure ChopTree;
    var x, y: integer;
    begin
      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
        If P07_FindObj(x, y, Location, TreeColor, 5) Then
        begin
          WaitHumanClick;
          MMouse(x, y, Random(2), Random(2));
          WaitHumanClick;
          if (P07_ContainsText(GetTextAtExWrap(35, 8, 170, 21, 0, 5, 1, 13423640, 65, 'P07UpChars'), [Location])) then
          begin
            GetMousePos(x, y);

            if(random(2) = 1) then
            begin
              Mouse(RandomRange(X - 5, x + 5), RandomRange(y - 5, y + 5), random(5), random(5), True);
            end
            else
            begin
              Mouse(RandomRange(X - 5, x + 5), RandomRange(y - 5, y + 5), random(5), random(5), false);  //clicks it
              P07_ChooseOptionMulti(['hop']);
            end;
          end
          else
          begin
            GoToTrees;
          end;
        end
        else
        begin
          P07_MakeCompassDegree(30);  //goes to trees if cant find trees
          GoToTrees;
        end;

      P07_FFlag;
      wait (Lagg);
    end;

    procedure TurnOnRun;
    var x, y: integer;
    begin
       Mouse(671, 482, random(5), random(5), true);
       WaitHumanClick;
       if(FindColorTolerance(x, y, 4803917, 651, 422, 659, 430, 10)) then
       begin
         Mouse(640, 426, random(5), random(5), true);
       end;
       Mouse(644, 184, random(5), random(5), true);
    end;

    Function isMoving1: Boolean;
      var
        PBox: TBox;
      begin
        PBox := IntToBox(240, 140, 300, 200);
        Result := (AveragePixelShift(PBox, 250, 500) > AnimationCheck);
        //Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
      end;

    Function AntiBan: Boolean;
    begin
      case random(300) of
      0: P07_HoverSkill('woodcutting', random(5000));
      1: TurnOnRun;
      2: P07_MakeCameraAngleLow;
      3: P07_MakeCompassSouth;
      4: P07_MakeCompassEast;
      5: P07_MakeCompassWest;
      end;
    end;

    begin
      P07_DeclarePlayer;
      SetupP07Include;
      ActivateClient;
      Wait(2000);

      If (Not P07_LoggedIn) Then
      begin
        P07_LogInPlayer;
      end;

      P07_MakeCameraAngleHigh;
      P07_MakeCompassNorth;
      DTM;
      AddOnTerminate('FreeDTMss')
      TurnOnRun;
      ChopWaitT := 0;
      invcount2 := 28;

      repeat
        repeat
          invcount1 := P07_InvCount;
          ChopWaitT := ChopWaitT + 1;

          AntiBan;

          if((CountColorTolerance(255, 230, 130, 280, 180, 2) + CountColorTolerance(65280, 230, 130, 280, 180, 2) > 100) and (RunFromCombat = 1)) then
            begin
              Mouse(305, 174, random(10), random(10), true);
              P07_FFlag;
              wait (lagg);
                if(CountColorTolerance(255, 230, 130, 280, 180, 2) + CountColorTolerance(65280, 230, 130, 280, 180, 2) > 50) then
                begin
                  GoToBank;
                  if(P07_InvCount > 1) then
                  begin
                    OpenBank1;
                    BankLogs;
                  end;
                  GoToTrees;
                end;
            end;

            if(P07_InvFull) then
            begin
              GoToBank;
              OpenBank1;
              BankLogs;
              GoToTrees;
            end
            //else;
            begin
              if( (invcount2 >= invcount1) or not isMoving1) then
              begin
                ChopTree;
                invcount2 := 0;
              //end;
              else
              begin
                if(random(10) = 1) then
                begin
                  MMouse(RandomRange(-100, 900), RandomRange(-100, 600), random(10), random(10));
                end;
              end;
            end;
        until((ChopWaitT > ChopWaitTime) or Not P07_LoggedIn)
        ChopWaitT := 0;
        invcount2 := P07_InvCount;

      until (Not P07_LoggedIn)
      TerminateScript;
    end.


    [Hint] C:\Simba\Scripts\[07] Draynor Willow Banker [2.1].simba(190:10): Variable 'Result' never used at line 189
    [Error] C:\Simba\Scripts\[07] Draynor Willow Banker [2.1].simba(253:9): Semicolon (';') expected at line 252
    Compiling failed.

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Related script questions should be posted on the scripters thread.

    Creds to DannyRS for this wonderful sig!

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
  •