Results 1 to 14 of 14

Thread: Need scripting feedback... please?

  1. #1
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question Need scripting feedback... please?

    I'm starting write my scripts into a bit more complex scripting (some might call it), but im not sure if it is good enough... Please give me feedback, suggestions to clean up codes, maybe even advice on what i can do better on to meet up to standards?

    * Might be asking alot, but might also help other scripter learn xD (hopefully)

    [SC]Form.scar
    SCAR Code:
    type
      TData = record
        Username, Password, NickName, ProgNick, CutTrees: String;
        BankPinC, LoadsToC: Integer;
        Load, FireLogs, plActive: Boolean;
        TempStor: Variant;
      end;
      TDataArray = Array [0..4] of TData;

      TConfig = record
        Players, ChanceAB, DivideAB, TimeAuto, TimeRest: Integer;
      end;
      TConfigArray = Array [0..3] of TConfig;

    var
      imgSplash, w, h, numPlayers, curPlayer: Integer;
      SC_Form: TForm;
      Splash: TImage;
      btnADDPLAYER, btnSTART, btnCANCEL, btnSave, btnLoad, btnDelete: TButton;
      grpPlayers: TGroupBox;
      tabPlayers: TTabControl;
      tabPlayer: Array [0..4] of TTabControl;
      edUsername, edPassword, edNickname, edProgNick: Array [-1..4] of TEdit;
      edBankPinC, edLoadsToC: Array [-1..4] of TEdit;
      cbCutTrees, cbFireLogs : Array [-1..4] of TComboBox;
      cbplActive: Array [-1..4] of TCheckBox;
      lblUsername, lblPassword, lblNickname, lblProgNick: TLabel;
      lblBankPinC, lblLoadsToC, lblCutTrees, lblFireLogs: TLabel;
      DLPath: String;
      frmPlayer: TDataArray;
      CFG: TConfigArray;
      //Test: TComboBox;

    function LoadAllPlayers(var Data: TDataArray): Boolean;
    var
      i: Integer;
    begin
      try
        //Test.Items.IndexOfName();
        ClearDebug;
        CFG[0].Players := 0;
        for i:=0 to 4 do
        begin
          with Data[i] do
          begin
            Username := ReadINI('P' + IntToStr(i), 'Username', DLPath + 'Nadeem[global].cfg');
            if not (Username = '*') then Load := True;

            Password := ReadINI('P' + IntToStr(i), 'Password', DLPath + 'Nadeem[global].cfg');
            Nickname := ReadINI('P' + IntToStr(i), 'Nickname', DLPath + 'Nadeem[global].cfg');
            ProgNick := ReadINI('P' + IntToStr(i), 'ProgNick', DLPath + 'Nadeem[global].cfg');
            CutTrees := ReadINI('P' + IntToStr(i), 'CutTrees', DLPath + 'Nadeem[global].cfg');

            TempStor := ReadINI('P' + IntToStr(i), 'BankPinC', DLPath + 'Nadeem[global].cfg');
            if (TempStor > -1) then
              BankPinC := StrToInt(TempStor)
            else
              BankPinC := 0000;

            TempStor := ReadINI('P' + IntToStr(i), 'LoadsToC', DLPath + 'Nadeem[global].cfg');
            if (TempStor > -1) then
              LoadsToC := StrToInt(Data[i].TempStor)
            else
              LoadsToC := 0;

            TempStor := ReadINI('P' + IntToStr(i), 'FireLogs', DLPath + 'Nadeem[global].cfg');
            FireLogs := StrToBool(Data[i].TempStor);

            TempStor := ReadINI('P' + IntToStr(i), 'plActive', DLPath + 'Nadeem[global].cfg');
            plActive := StrToBool(Data[i].TempStor);

            if Load then Inc(CFG[0].Players);
          end;

          with CFG[0] do
          begin
            TimeAuto := StrToInt(ReadINI('Config', 'TimeAuto', DLPath + 'Nadeem[global].cfg'));
            TimeRest := StrToInt(ReadINI('Config', 'TimeRest', DLPath + 'Nadeem[global].cfg'));
            ChanceAB := StrToInt(ReadINI('Config', 'ChanceAB', DLPath + 'Nadeem[global].cfg'));
            DivideAB := StrToInt(ReadINI('Config', 'DivideAB', DLPath + 'Nadeem[global].cfg'));
            //if i > 3 then Writeln('Players: ' + IntToStr(Players));
          end;

          Result := True;
        end;
      except
        Writeln('Unable to read data from file... Please make sure you have all necessary files to run this script.');
        TerminateScript;
      end;
    end;

    procedure RefreshForm;
    var
      i: Integer;
    begin

      lblUsername.Visible := False;
      lblPassword.Visible := False;
      lblNickname.Visible := False;
      lblProgNick.Visible := False;
      lblBankPinC.Visible := False;
      lblLoadsToC.Visible := False;
      lblCutTrees.Visible := False;
      lblFireLogs.Visible := False;

      for i:=0 to 4 do
      begin
        edUsername[i].Visible := False;
        edPassword[i].Visible := False;
        edNickname[i].Visible := False;
        edProgNick[i].Visible := False;
        edBankPinC[i].Visible := False;
        edLoadsToC[i].Visible := False;
        cbCutTrees[i].Visible := False;
        cbFireLogs[i].Visible := False;
        cbplActive[i].Visible := False;
      end;

      case curPlayer of
        0..4 : begin
                 lblUsername.Visible := True;
                 lblPassword.Visible := True;
                 lblNickname.Visible := True;
                 lblProgNick.Visible := True;
                 lblBankPinC.Visible := True;
                 lblLoadsToC.Visible := True;
                 lblCutTrees.Visible := True;
                 lblFireLogs.Visible := True;

                 if curPlayer > 0 then btnDelete.Visible := True else btnDelete.Visible := False;

                 edUsername[curPlayer].Visible := True;
                 edPassword[curPlayer].Visible := True;
                 edNickname[curPlayer].Visible := True;
                 edProgNick[curPlayer].Visible := True;
                 edBankPinC[curPlayer].Visible := True;
                 edLoadsToC[curPlayer].Visible := True;
                 cbCutTrees[curPlayer].Visible := True;
                 cbFireLogs[curPlayer].Visible := True;
                 cbplActive[curPlayer].Visible := True;
               end;
      end;
    end;

    procedure Configure(Sender: TObject);
    var
      i: Integer;
    begin
      DLPath := AppPath + 'Scripts\Smart Cutta\';
      case Sender of
        btnSave : begin
                    try
                      for i:=0 to numPlayers do
                      begin
                        WriteINI('P' + IntToStr(i), 'Username', edUsername[i].Text, DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'Password', edPassword[i].Text, DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'Nickname', edNickname[i].Text, DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'ProgNick', edProgNick[i].Text, DLPath + 'Nadeem[global].cfg');
                        if (cbCutTrees[i].Text <> '') then
                          WriteINI('P' + IntToStr(i), 'CutTrees', cbCutTrees[i].Text, DLPath + 'Nadeem[global].cfg')
                        else
                          WriteINI('P' + IntToStr(i), 'CutTrees', 'All', DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'BankPinC', IntToStr(StrToIntDef(edBankPinC[i].Text, 0000)), DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'FireLogs', BoolToStr(StrToBoolDef(cbFireLogs[i].Text, False)), DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'LoadsToC', IntToStr(StrToIntDef(edLoadsToC[i].Text, 100)), DLPath + 'Nadeem[global].cfg');
                        WriteINI('P' + IntToStr(i), 'plActive', BoolToStr(cbplActive[i].Checked), DLPath + 'Nadeem[global].cfg');
                      end;
                    except
                      Writeln('Unable to save data to file... Please re-start SCAR.');
                      TerminateScript;
                    end;
                  end;

        btnLoad : begin
                    LoadAllPlayers(frmPlayer);
                    for i:=0 to 4 do
                    begin
                      edUsername[i].Text := frmPlayer[i].Username;
                      edPassword[i].Text := frmPlayer[i].Password;
                      edNickname[i].Text := frmPlayer[i].Nickname;
                      edProgNick[i].Text := frmPlayer[i].ProgNick;
                      edLoadsToC[i].Text := IntToStr(frmPlayer[i].LoadsToC);
                      edBankPinC[i].Text := IntToStr(frmPlayer[i].BankPinC);
                      cbCutTrees[i].ItemIndex := cbCutTrees[i].Items.IndexOf(frmPlayer[i].CutTrees);
                      cbFireLogs[i].ItemIndex := cbFireLogs[i].Items.IndexOf(BoolToStr(frmPlayer[i].FireLogs));
                      cbplActive[i].Checked   := frmPlayer[i].plActive;
                    end;
                    //Writeln('Playersz: ' + IntToStr(CFG[0].Players));
                    numPlayers := (CFG[0].Players - 1);
                    for i:=1 to numPlayers do
                    begin
                      tabPlayers.Width := 55 + (60*(i+1));
                      tabPlayers.Tabs.InsertObject((i+1), 'Player ' + IntToStr(i), tabPlayer[i]);
                    end;
                    btnLoad.Enabled := False;
                  end;
      end;
    end;

    procedure Player(Sender: TObject);
    begin
      case Sender of
        btnAddPlayer : begin
                         if (numPlayers < 3) then
                         begin
                           Inc(numPlayers);
                           tabPlayers.Width := 55 + (60*(numPlayers+1));
                           tabPlayers.Tabs.InsertObject((numPlayers+1), 'Player ' + IntToStr(numPlayers), tabPlayer[numPlayers]);
                           //Writeln('New Player Added! ' + IntToStr(numPlayers));
                         end else
                         begin
                           Writeln('Currently the MAX number of players this form can support is only 4.');
                         end;
                       end;

        btnDelete    : begin
                         try
                           //Writeln('Delete ' + IntToStr(curPlayer));
                           tabPlayers.Tabs.Delete(curPlayer+1);
                           tabPlayers.TabPosition
                           Dec(numPlayers);

                           WriteINI('P' + IntToStr(curPlayer), 'Username', '*', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'Password', '*', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'Nickname', '*', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'ProgNick', '*', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'CutTrees', 'all', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'BankPinC', '000', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'FireLogs', 'False', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'LoadsToC', '100', DLPath + 'Nadeem[global].cfg');
                           WriteINI('P' + IntToStr(curPlayer), 'plActive', 'False', DLPath + 'Nadeem[global].cfg');
                         except
                           writeln('You cannot delete more than what you have! :P');
                         end;
                       end;
      end;
    end;

    procedure SwitchPlayer(Sender: TObject; Button: TMouseButton; Shift: TShiftState; x, y: Integer);
    begin
      case Button of
        mbLeft : begin
                   case x of
                     000..059 : curPlayer := -1;
                     060..117 : curPlayer := 0;
                     118..175 : curPlayer := 1;
                     176..233 : curPlayer := 2;
                     234..291 : curPlayer := 3;
                   end;
                 end;
      end;
      if (curPlayer > -1) then
        grpPlayers.Caption := 'Player ' + IntToStr(curPlayer)
      else
        grpPlayers.Caption := 'Config';
      RefreshForm;
      //Writeln(IntToStr(curPlayer) + ' | ' + IntToStr(x) + ',' + IntToStr(y));
    end;

    procedure InitForm;
    var
      i, TimeInitForm: Integer;
    begin
      TimeInitForm := GetSystemTime;
      SC_Form := CreateForm;
      with SC_Form do
      begin
        Position := poScreenCenter;
        Left := 250;
        Top := 114;
        Hint := 'Nadeem'#39's | Smart Cutta! [Ultimate]';
        VertScrollBar.Visible := False;
        BorderIcons := [biSystemMenu, biMinimize];
        BorderStyle := bsNone;
        Caption := 'Nadeem'#39's | Smart Cutta [Ultimate] v1.03';
        ClientHeight := 290;
        ClientWidth := 700;
        Color := clBtnFace;
        Font.Color := clWindowText;
        Font.Height := -13;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
        Visible := False;
        PixelsPerInch := 96;
      end;
      Splash := TImage.Create(SC_Form);
      Splash.Parent := SC_Form;
      Splash.Left := 0;
      Splash.Top := 0;
      Splash.Width := 350;
      Splash.Height := 290;
      Splash.Hint := 'Smart Cutta [Ultimate] !!';
      imgSplash := LoadBitmap(ScriptPath + 'SC_Splash.bmp');
      GetBitmapSize(imgSplash, w, h);
      CopyCanvas(GetBitmapCanvas(imgSplash), Splash.Canvas, 0, 0, w, h, 0, 0, w, h);
      btnSTART := TButton.Create(SC_Form);
      btnSTART.Parent := SC_Form;
      btnSTART.Left := 545;
      btnSTART.Top := 257;
      btnSTART.Width := 79;
      btnSTART.Height := 31;
      btnSTART.Hint := 'Start Script';
      btnSTART.Caption := 'Start';
      btnSTART.TabOrder := 8;
      btnSTART.ModalResult := 1;
      btnCANCEL := TButton.Create(SC_Form);
      btnCANCEL.Parent := SC_Form;
      btnCANCEL.Left := 625;
      btnCANCEL.Top := 257;
      btnCANCEL.Width := 71;
      btnCANCEL.Height := 31;
      btnCANCEL.Cancel := True;
      btnCANCEL.Hint := 'Cancel/Terminate';
      btnCANCEL.Caption := 'Cancel';
      btnCANCEL.ModalResult := 1;
      btnCANCEL.TabOrder := 9;
      btnADDPLAYER := TButton.Create(SC_Form);
      btnADDPLAYER.Parent := SC_Form;
      btnADDPLAYER.Left := 457;
      btnADDPLAYER.Top := 257;
      btnADDPLAYER.Width := 87;
      btnADDPLAYER.Height := 31;
      btnADDPLAYER.Hint := 'Add New Player';
      btnADDPLAYER.Caption := 'Add Player';
      btnADDPLAYER.TabOrder := 10;
      btnADDPLAYER.OnClick := @Player;
      tabPlayers := TTabControl.Create(SC_Form);
      tabPlayers.Parent := SC_Form;
      tabPlayers.Left := 368;
      tabPlayers.Top := 8;
      tabPlayers.Height := 25;
      tabPlayers.TabOrder := 12;
      tabPlayers.Width := 115;
      tabPlayers.Tabs.Add('Config');
      tabPlayers.Tabs.Add('Player 0');
      tabPlayers.TabIndex := 0;
      tabPlayers.OnMouseDown := @SwitchPlayer;
      grpPlayers := TGroupBox.Create(SC_Form);
      grpPlayers.Parent := SC_Form;
      grpPlayers.Left := 369;
      grpPlayers.Top := 40;
      grpPlayers.Width := 319;
      grpPlayers.Height := 208;
      grpPlayers.Caption := 'Config';
      grpPlayers.TabOrder := 11;
      btnSave := TButton.Create(SC_Form);
      btnSave.Parent := SC_Form;
      btnSave.Left := 664;
      btnSave.Top := 17;
      btnSave.Width := 32;
      btnSave.Height := 16;
      btnSave.Caption := 'Save';
      btnSave.Font.Color := clWindowText;
      btnSave.Font.Height := -9;
      btnSave.Font.Name := 'MS Sans Serif';
      btnSave.Font.Style := [];
      btnSave.ParentFont := False;
      btnSave.TabOrder := 13;
      btnSave.OnClick := @Configure;
      btnLoad := TButton.Create(SC_Form);
      btnLoad.Parent := SC_Form;
      btnLoad.Left := 665;
      btnLoad.Top := 1;
      btnLoad.Width := 31;
      btnLoad.Height := 16;
      btnLoad.Caption := 'Load';
      btnLoad.Font.Color := clWindowText;
      btnLoad.Font.Height := -9;
      btnLoad.Font.Name := 'MS Sans Serif';
      btnLoad.Font.Style := [];
      btnLoad.ParentFont := False;
      btnLoad.TabOrder := 14;
      btnLoad.OnClick := @Configure;
      btnDelete := TButton.Create(SC_Form);
      btnDelete.Parent := SC_Form;
      btnDelete.Left := 625;
      btnDelete.Top := 225;
      btnDelete.Width := 59;
      btnDelete.Height := 19;
      btnDelete.Caption := 'Delete Player';
      btnDelete.Font.Color := clWindowText;
      btnDelete.Font.Height := -9;
      btnDelete.Font.Name := 'MS Sans Serif';
      btnDelete.Font.Style := [];
      btnDelete.ParentFont := False;
      btnDelete.TabOrder := 9;
      btnDelete.Visible := False;
      btnDelete.OnClick := @Player;
      lblUsername := TLabel.Create(grpPlayers);
      lblUsername.Parent := grpPlayers;
      lblUsername.Left := 16;
      lblUsername.Top := 37;
      lblUsername.Width := 51;
      lblUsername.Height := 11;
      lblUsername.Caption := 'Username';
      lblUsername.Font.Color := clWindowText;
      lblUsername.Font.Height := -11;
      lblUsername.Font.Name := 'MS Sans Serif';
      lblUsername.Font.Style := [];
      lblUsername.ParentFont := False;
      lblPassword := TLabel.Create(grpPlayers);
      lblPassword.Parent := grpPlayers;
      lblPassword.Left := 16;
      lblPassword.Top := 72;
      lblPassword.Width := 49;
      lblPassword.Height := 13;
      lblPassword.Caption := 'Password';
      lblPassword.Font.Color := clWindowText;
      lblPassword.Font.Height := -11;
      lblPassword.Font.Name := 'MS Sans Serif';
      lblPassword.Font.Style := [];
      lblPassword.ParentFont := False;
      lblNickname := TLabel.Create(grpPlayers);
      lblNickname.Parent := grpPlayers;
      lblNickname.Left := 16;
      lblNickname.Top := 105;
      lblNickname.Width := 50;
      lblNickname.Height := 13;
      lblNickname.Caption := 'Nickname';
      lblNickname.Font.Color := clWindowText;
      lblNickname.Font.Height := -11;
      lblNickname.Font.Name := 'MS Sans Serif';
      lblNickname.Font.Style := [];
      lblNickname.ParentFont := False;
      lblProgNick := TLabel.Create(grpPlayers);
      lblProgNick.Parent := grpPlayers;
      lblProgNick.Left := 16;
      lblProgNick.Top := 137;
      lblProgNick.Width := 50;
      lblProgNick.Height := 13;
      lblProgNick.Caption := 'Prog Nick';
      lblProgNick.Font.Color := clWindowText;
      lblProgNick.Font.Height := -11;
      lblProgNick.Font.Name := 'MS Sans Serif';
      lblProgNick.Font.Style := [];
      lblProgNick.ParentFont := False;
      lblBankPinC := TLabel.Create(grpPlayers);
      lblBankPinC.Parent := grpPlayers;
      lblBankPinC.Left := 16;
      lblBankPinC.Top := 172;
      lblBankPinC.Width := 50;
      lblBankPinC.Height := 13;
      lblBankPinC.Caption := 'Bank Pin';
      lblBankPinC.Font.Color := clWindowText;
      lblBankPinC.Font.Height := -11;
      lblBankPinC.Font.Name := 'MS Sans Serif';
      lblBankPinC.Font.Style := [];
      lblBankPinC.ParentFont := False;
      lblLoadsToC := TLabel.Create(grpPlayers);
      lblLoadsToC.Parent := grpPlayers;
      lblLoadsToC.Left := 226;
      lblLoadsToC.Top := 30;
      lblLoadsToC.Width := 50;
      lblLoadsToC.Height := 13;
      lblLoadsToC.Caption := 'Loads';
      lblLoadsToC.Font.Color := clWindowText;
      lblLoadsToC.Font.Height := -11;
      lblLoadsToC.Font.Name := 'MS Sans Serif';
      lblLoadsToC.Font.Style := [];
      lblLoadsToC.ParentFont := False;
      lblCutTrees := TLabel.Create(grpPlayers);
      lblCutTrees.Parent := grpPlayers;
      lblCutTrees.Left := 213;
      lblCutTrees.Top := 79;
      lblCutTrees.Width := 50;
      lblCutTrees.Height := 13;
      lblCutTrees.Caption := 'Trees To Cut';
      lblCutTrees.Font.Color := clWindowText;
      lblCutTrees.Font.Height := -11;
      lblCutTrees.Font.Name := 'MS Sans Serif';
      lblCutTrees.Font.Style := [];
      lblCutTrees.ParentFont := False;
      lblFireLogs := TLabel.Create(grpPlayers);
      lblFireLogs.Parent := grpPlayers;
      lblFireLogs.Left := 219;
      lblFireLogs.Top := 133;
      lblFireLogs.Width := 50;
      lblFireLogs.Height := 13;
      lblFireLogs.Caption := 'Fire Logs';
      lblFireLogs.Font.Color := clWindowText;
      lblFireLogs.Font.Height := -11;
      lblFireLogs.Font.Name := 'MS Sans Serif';
      lblFireLogs.Font.Style := [];
      lblFireLogs.ParentFont := False;

      for i:=0 to 4 do
      begin
        edUsername[i] := TEdit.Create(grpPlayers);
        edUsername[i].Parent := grpPlayers;
        edUsername[i].Left := 72;
        edUsername[i].Top := 32;
        edUsername[i].Width := 100;
        edUsername[i].Height := 23;
        edUsername[i].Font.Color := clWindowText;
        edUsername[i].Font.Height := -10;
        edUsername[i].Font.Name := 'MS Sans Serif';
        edUsername[i].Font.Style := [];
        edUsername[i].ParentFont := False;
        edUsername[i].TabOrder := 1;
        edUsername[i].Text := '*';
        edPassword[i] := TEdit.Create(grpPlayers);
        edPassword[i].Parent := grpPlayers;
        edPassword[i].Left := 72;
        edPassword[i].Top := 68;
        edPassword[i].Width := 100;
        edPassword[i].Height := 23;
        edPassword[i].Font.Color := clWindowText;
        edPassword[i].Font.Height := -10;
        edPassword[i].Font.Name := 'MS Sans Serif';
        edPassword[i].Font.Style := [];
        edPassword[i].ParentFont := False;
        edPassword[i].TabOrder := 2;
        edPassword[i].Text := '***';
        edNickname[i] := TEdit.Create(grpPlayers);
        edNickname[i].Parent := grpPlayers;
        edNickname[i].Left := 72;
        edNickname[i].Top := 102;
        edNickname[i].Width := 100;
        edNickname[i].Height := 23;
        edNickname[i].Font.Color := clWindowText;
        edNickname[i].Font.Height := -10;
        edNickname[i].Font.Name := 'MS Sans Serif';
        edNickname[i].Font.Style := [];
        edNickname[i].ParentFont := False;
        edNickname[i].TabOrder := 3;
        edNickname[i].Text := 'ick';
        edProgNick[i] := TEdit.Create(grpPlayers);
        edProgNick[i].Parent := grpPlayers;
        edProgNick[i].Left := 72;
        edProgNick[i].Top := 137;
        edProgNick[i].Width := 100;
        edProgNick[i].Height := 23;
        edProgNick[i].Font.Color := clWindowText;
        edProgNick[i].Font.Height := -10;
        edProgNick[i].Font.Name := 'MS Sans Serif';
        edProgNick[i].Font.Style := [];
        edProgNick[i].ParentFont := False;
        edProgNick[i].TabOrder := 3;
        edProgNick[i].Text := 'rogNick';
        edBankPinC[i] := TEdit.Create(grpPlayers);
        edBankPinC[i].Parent := grpPlayers;
        edBankPinC[i].Left := 72;
        edBankPinC[i].Top := 172;
        edBankPinC[i].Width := 100;
        edBankPinC[i].Height := 23;
        edBankPinC[i].Font.Color := clWindowText;
        edBankPinC[i].Font.Height := -10;
        edBankPinC[i].Font.Name := 'MS Sans Serif';
        edBankPinC[i].Font.Style := [];
        edBankPinC[i].ParentFont := False;
        edBankPinC[i].TabOrder := 3;
        edBankPinC[i].Text := '0000';
        edLoadsToC[i] := TEdit.Create(grpPlayers);
        edLoadsToC[i].Parent := grpPlayers;
        edLoadsToC[i].Left := 204;
        edLoadsToC[i].Top := 49;
        edLoadsToC[i].Width := 80;
        edLoadsToC[i].Height := 23;
        edLoadsToC[i].Font.Color := clWindowText;
        edLoadsToC[i].Font.Height := -10;
        edLoadsToC[i].Font.Name := 'MS Sans Serif';
        edLoadsToC[i].Font.Style := [];
        edLoadsToC[i].ParentFont := False;
        edLoadsToC[i].TabOrder := 3;
        edLoadsToC[i].Text := '100';
        cbCutTrees[i] := TComboBox.Create(grpPlayers);
        cbCutTrees[i].Parent := grpPlayers;
        cbCutTrees[i].Left := 203;
        cbCutTrees[i].Top := 99;
        cbCutTrees[i].Width := 85;
        cbCutTrees[i].Height := 25;
        cbCutTrees[i].Style := csDropDownList;
        cbCutTrees[i].Font.Height := -12;
        cbCutTrees[i].ItemHeight := 13;
        cbCutTrees[i].TabOrder := 4;
        cbCutTrees[i].Items.Add('All');
        cbCutTrees[i].Items.Add('Normal');
        cbCutTrees[i].Items.Add('Oak');
        cbCutTrees[i].Items.Add('Willow');
        cbCutTrees[i].Items.Add('Yew');
        cbCutTrees[i].Items.Add('Maple');
        cbCutTrees[i].Items.Add('Teak');
        cbCutTrees[i].Items.Add('Mahogany');
        cbCutTrees[i].Items.Add('Magic');
        cbFireLogs[i] := TComboBox.Create(grpPlayers);
        cbFireLogs[i].Parent := grpPlayers;
        cbFireLogs[i].Left := 203;
        cbFireLogs[i].Top := 149;
        cbFireLogs[i].Width := 85;
        cbFireLogs[i].Height := 25;
        cbFireLogs[i].Style := csDropDownList;
        cbFireLogs[i].Font.Height := -12;
        cbFireLogs[i].ItemHeight := 13;
        cbFireLogs[i].TabOrder := 4;
        cbFireLogs[i].Items.Add('False');
        cbFireLogs[i].Items.Add('True');
        cbplActive[i] := TCheckBox.Create(grpPlayers);
        cbplActive[i].Parent := grpPlayers;
        cbplActive[i].Left := 203;
        cbplActive[i].Top := 179;
        cbplActive[i].Width := 49;
        cbplActive[i].Height := 19;
        cbplActive[i].Font.Height := -10;
        cbplActive[i].Caption := 'Active';
        cbplActive[i].TabOrder := 8;
      end;

      curPlayer := -1;
      RefreshForm;
     
      WriteLn('[SC]Form compiled in ' + IntToStr(GetSystemTime - TimeInitForm) + ' milliseconds!');
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      SetArrayLength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      SC_Form.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    procedure MainInitForm;
    begin
      try
        SafeInitForm;
        SafeShowFormModal;
      finally
        FreeForm(SC_Form);
      except
        WriteLn('An error seems to have occurred in: MainInitForm');
      end;
    end;

    Or even..

    Smart Cutta v1.07:
    SCAR Code:
    const
      UseForm       = True;
      SendTXTIngame = True;
      WorldNum      = 155;
      Member        = False;
      Signed        = True;
      TheMouseSpeed = 12;
      RanMouseSpeed = 16;
      SRLStatsId    = '7175';
      SRLStatsPass  = 'nadeem';

    var
      p: Integer;
      SCPlayer: TDataArray;

    procedure DeclarePlayers;
    begin

        if not UseForm then
        begin
          HowManyPlayers := 1; //Change this accordingly
          NumberOfPlayers(HowManyPlayers); // Total Number Of Players
          CurrentPlayer := 0; // The Current Player To Start With

          Players[0].Name         := ''; // Character Name
          Players[0].Pass         := ''; // Character Pass
          Players[0].Nick         := ''; // Nickname 3 - 4 Letter's of char name
          Players[0].Booleans[0]  := True; // True = Make Fire | False = Drop Them
          Players[0].Integers[1]  := 1000; // Loads To Chop
          Players[0].Integers[2]  := 10; // Time in minutes to auto then sleep
          Players[0].Integers[3]  := 0; // Time in minutes to sleep
          Players[0].Integers[4]  := 60; // Chance of performing anti-ban. (enter integers between 0-99) [Enter -1 To make it 1 in a 50 chance)
          Players[0].Integers[5]  := 2;  // Enter division chance for performing antiban. Higher the number, more rare the chance. (Recommended between 2-4) [Enter 1 for NO anti-bans]
          Players[0].Strings [0]  := 'all'; // Type of trees to cut. (All, Normal, Oak, Willow, Yew, Maple, Teak, Mahogany) [TMAHO = Chop Both Teak & Mahogany]
          Players[0].Strings [1]  := '';    // Nickname recorded into the websites proggy list. (Leave blank to use Players[].Nick)
          Players[0].PIN          := '0000'; // Leave to '0000' if no pin.
          Players[0].Active       := True; // True to use player, False if else

          {
          Players[1].Name         := '';
          Players[1].Pass         := '';
          Players[1].Nick         := '';
          Players[1].Booleans[0]  := True;
          Players[1].Integers[1]  := 1000;
          Players[1].Integers[2]  := 10;
          Players[1].Integers[3]  := 0;
          Players[1].Integers[4]  := 60;
          Players[1].Integers[5]  := 2;
          Players[1].Strings [0]  := 'all';
          Players[1].Strings [1]  := '';
          Players[1].PIN          := '0000';
          Players[1].Active       := True;
          }

        end else
        begin

          LoadAllPlayers(SCPlayer);
          HowManyPlayers := CFG[0].Players;
          NumberOfPlayers(HowManyPlayers);
          CurrentPlayer := 0;

          for p:=0 to (CFG[0].Players - 1) do
          begin
            with Players[p] do
            begin
              Name         := SCPlayer[p].Username;
              Pass         := SCPlayer[p].Password;
              Nick         := SCPlayer[p].Nickname;
              Booleans[0]  := SCPlayer[p].FireLogs;
              Integers[1]  := SCPlayer[p].LoadsToC;
              Integers[2]  := CFG[0].TimeAuto;
              Integers[3]  := CFG[0].TimeRest;
              Integers[4]  := CFG[0].ChanceAB;
              Integers[5]  := CFG[0].DivideAB;
              Strings[0]   := SCPlayer[p].CutTrees;
              Strings[1]   := SCPlayer[p].ProgNick;
              PIN          := IntToStr(SCPlayer[p].BankPinC);
              Active       := SCPlayer[p].plActive;
            end;
          end;
        end;

    end;

    {------------------------------------------------------------------------------}
    {===========No Need To Edit Below Unless You Know What Your Doing :)===========}
    {------------------------------------------------------------------------------}

    const
      ScriptName = 'Smart Cutta [Ultimate]';
      Version = '1.07';
      DebugMode = False;

    var
      x, y, i, ChoppingInt, PLID, sess, SleepTime: Integer;
      FireLevels, TreeLevels, TreesChoppedBef, LogoutTime, NoTrees: Integer;
      PostVar: Array [0..19] of String;
      HatchetUsed: String;
      TPA: TPointArray;
      TREE: T2DPointArray;
      TreePoint: TPoint;
      MultiPlayer, BurnAfterChop, BurnLogs, LClick: Boolean;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : DebugTPA                  +
    + Author   : Wizzup?                   +
    + Desc.    : Debug TPA, in Action!     +
    +++++++++++++++++++++++++++++++++++++++}

    Function DebugTPA(Points: TPointArray; BmpName: String): Boolean;

    Var
       Width, Height, ClientBMP, I: Integer;
       xs, ys, xe, ye: Integer;
    Begin
      Try
      Begin
        xe := xs xor xs;
        ye := ys xor ys;
        xs := 1 shl 20;
        ys := 1 shl 20;

        For I := 0 To High(Points) Do
        Begin
          xs := Min(xs, Points[i].X);
          ys := Min(ys, Points[i].Y);

          xe := Max(xe, Points[i].X);
          ye := Max(ye, Points[i].Y);
        End;

        Width := xe - xs;
        Height := ye - ys;

        DisplayDebugImgWindow(0, 0);
        DisplayDebugImgWindow(Width, Height);
        ClientBMP := BitmapFromString(Width, Height, '');

        CopyClientToBitmap(ClientBMP, xs, ys, xe, ye);
        For I := 0 To High(Points) Do
          FastSetPixel(ClientBMP, Points[i].X - xs, Points[i].Y - ys, 255);
        If BmpName <> '' Then
          SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
        SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
        DisplayDebugImgWindow(Width, Height);

        FreeBitmap(ClientBMP);
      End
      Except
        FreeBitmap(ClientBMP);
      End;
      Result := True;
    End;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : StatusMSG | v1.0       +
    + Author   : Nadeem                    +
    + Desc.    : Alters status and calls   +
    +            For sending message.      +
    +++++++++++++++++++++++++++++++++++++++}

    procedure SendMSG; forward;
    function StatusMSG(strStatus: String): Boolean;
    begin
      Status(strStatus);
      SendMSG;
      Result := true;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : SendMSG | v1.0            +
    + Author   : Nadeem                    +
    + Desc.    : Send a message In-Game.   +
    +++++++++++++++++++++++++++++++++++++++}

    procedure SendMSG;
    begin
      if not SendTXTIngame then Exit;
      if IsFKeyDown(12) then
        TypeSend(Readln('Type a message to send below:'));
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : CheckMotion | v1.0        +
    + Author   : Nadeem                    +
    + Desc.    : Checks current motion of  +
    +            Player, based on colors.  +
    +++++++++++++++++++++++++++++++++++++++}

    function CheckMotion(xd, yd, wt: Integer; MainScreen: Boolean): Boolean;
    var
      MX1, MX2, MY1, MY2, t: Integer;
      Moved: Boolean;
      ColorBef: Array [0..3] of Integer;
      ColorNow: Array [0..3] of Integer;
    begin
      StatusMSG('We are currently moving...');
      wait(250);

      case MainScreen of
        'True'  : begin
                    MX1 := MSCX - xd;
                    MX2 := MSCX + xd;
                    MY1 := MSCY - yd;
                    MY2 := MSCY + yd;
                  end;
        'False' : begin
                    MX1 := MMCX - xd;
                    MX2 := MMCX + xd;
                    MY1 := MMCY - yd;
                    MY2 := MMCY + yd;
                  end;
      end;

      MarkTime(t);
      repeat
        ColorBef[0] := GetColor(MX1, MY1);
        ColorBef[1] := GetColor(MX2, MY1);
        ColorBef[2] := GetColor(MX1, MY2);
        ColorBef[3] := GetColor(MX2, MY2);
        wait(wt);
        ColorNow[0] := GetColor(MX1, MY1);
        ColorNow[1] := GetColor(MX2, MY1);
        ColorNow[2] := GetColor(MX1, MY2);
        ColorNow[3] := GetColor(MX2, MY2);
        if (ColorBef[0] = ColorNow[0]) then
          if (ColorBef[1] = ColorNow[1]) then
            if (ColorBef[2] = ColorNow[2]) then
              if (ColorBef[3] = ColorNow[3]) then
                Moved := true;
      until ( (Moved) or (TimeFromMark(t) > 19000) );

      StatusMSG('Movement complete!');
      Result := true;
      wait(250);
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : ClickContinueNOW | v1.0   +
    + Author   : Nadeem                    +
    + Desc.    : Checks if we leveled, and +
    +            If true, then click to    +
    +            Continue.                 +
    +++++++++++++++++++++++++++++++++++++++}

    function ClickContinueNOW: Boolean;
    var
      TheFire, TheTree: Integer;
    begin

      TheFire := DTMFromString('78DA633463606058C8C8800C56C71B8069982' +
               '8A33390684155B37B750FAA1A1320D188AA26CA5307558D069068' +
               '4655D39CED82AA4601484C435513E4AC85A96603AA9A8C2034BB4' +
               '0FE5A4BC03D9E40621DAA9AE2505D14350025BA0F0D');

      TheTree := DTMFromString('78DA63B464606058C0C8800C328274C0344C9' +
               '4D10248B4A3AAC9EDB34255E30C247A51D504E5A399E30124A6A2' +
               'AA094CD042550372CF1A02EED10512D350D5A45699A1AA3100127' +
               'DA86A629A4C51D400007BC20CB2');

      if FindDTM(TheFire, x, y, MCX1, MCY1, MCX2, MCY2) then
        begin
          Mouse(218 + Random(137), 464 + Random(4), 0, 0, true);
          wait(1000);
          FireLevels := FireLevels + 1;
          Result := true;
        end;

      if FindDTM(TheTree, x, y, MCX1, MCY1, MCX2, MCY2) then
        begin
          Mouse(218 + Random(137), 464 + Random(4), 0, 0, true);
          wait(1000);
          TreeLevels := TreeLevels + 1;
          Result := true;
        end;

      FreeDTM(TheFire);
      FreeDTM(TheTree);

    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : GrabHatchetName | v1.0    +
    + Author   : Nadeem                    +
    + Desc.    : Checks current hatchet    +
    +            Name.                     +
    +++++++++++++++++++++++++++++++++++++++}

    function GrabHatchetName: Boolean;
    begin
      if DebugMode then Writeln('Grabbing Hatchet Name...');
      Gametab(5);

      MouseBox(575, 293, 599, 319, 3);
      wait(150 + Random(350));

      try
        HatchetUsed := Capitalize(Between('Remove ', ' /', rs_GetUpText));
      except
        Writeln('Nothing wielded...');
      end;

      if not EndsWith('t', HatchetUsed) then
      begin
        for i := 1 to 28 do
        begin
          if ExistsItem(i) then
          begin
            MMouseItem(i);
            GetMousePos(x, y);
            wait(50+random(100));
            if (pos('atchet', rs_GetUpText) > 0) then
            begin
              HatchetUsed := Capitalize(Between('Wield ', ' /', rs_GetUpText));
              break;
            end;
            wait(RandomRange(399, 799));
          end else if (i > 27) then
          begin
            exit;
          end;
        end;
      end;

      if DebugMode then Writeln('You are using a: ' + HatchetUsed);
      Result := true;

      exit;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : TypeOfTree | v1.0         +
    + Author   : Nadeem                    +
    + Desc.    : Returns the type of tree, +
    +            Based on how what is      +
    +            Asked for.                +
    +++++++++++++++++++++++++++++++++++++++}

    function TypeOfTree (GET, TOT: Integer): String;
    var
      Colors: TIntegerArray;
    begin

      if (GET = 1) then
      begin
        case TOT of
          0: Result := 'hop';
          1: Result := 'ree';
          2: Result := 'ak';
          3: Result := 'illow';
          4: Result := 'ew';
          5: Result := 'eak';
          6: Result := 'ahogany';
          7: Result := 'hop d';
          8: Result := 'aple';
          9: Result := 'hop';
        end;
      end;

      if (GET = 2) then
      begin
        case TOT of
          0 : Colors := [3175015, 4754045, 5278334];
          1 : Colors := [3175015, 5278334];
          2 : Colors := [5808789, 4819838];
          3 : Colors := [2636081, 6061931];
          4 : Colors := [4754045, 1130805];
          5 : Colors := [6861980, 7060899];
          6 : Colors := [1854272, 4492929];
          7 : Colors := [1854272, 6861980];
          8 : Colors := [3099264, 2901367];
      end;

        Result := IntToStr(Colors[Random(Length(Colors))]);

      end;

    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : GlobalReport | v1.0       +
    + Author   : Nadeem                    +
    + Desc.    : Report back before loggin +
    +            Making any changes to     +
    +            Current main action.      +
    +++++++++++++++++++++++++++++++++++++++}

    procedure WriteMeTheReport(FinalProg: Boolean); forward;
    procedure Start; forward;
    function GlobalReport(NextPlaya: Boolean; MSG: String): Boolean;
    begin
      ClearReport;
      WriteMeTheReport(true);
      AddToReport(MSG);

      if NextPlaya then
      begin
        NextPlayer(NextPlaya);
        Start;
      end else
      begin
        Logout;
        LoginPlayer;
      end;

      Result := True;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : GoToSleep | v1.0          +
    + Author   : Nadeem                    +
    + Desc.    : Report back before loggin +
    +            Making any changes to     +
    +            Current main action.      +
    +++++++++++++++++++++++++++++++++++++++}

    function GoToSleep: Boolean;
    begin
      ClearReport;
      WriteMeTheReport(true);

      with Players[CurrentPlayer] do
      begin
        if (TimeFromMark(SleepTime) > (Integers[2] * 60000)) then
        begin
          Logout;
          wait((Integers[3] * 60000) + 19 );
          LoginPlayer;
          Inc(Integers[20]);
          MarkTime(SleepTime);
          Result := True;
        end;
      end;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : WriteMeTheReport | v1.0   +
    + Author   : Nadeem                    +
    + Desc.    : Is the name not enuff? :P +
    +++++++++++++++++++++++++++++++++++++++}

    function RecVars(p: TIntegerArray): Boolean; forward;
    function WebConn (gData: Integer): Boolean; forward;
    procedure WriteMeTheReport(FinalProg: Boolean);
    var
      H, M, S, getpadl1, getpadl2, getpadl3, getpadl4, getpadl5: Integer;
      HR, MN, SC, DLPath: String;
      WMTRLEFT, LogsInv, ProgFile: Integer;
      n, l, t, b, d, ba: String;
      gpadl1, gpadl2, gpadl3, gpadl4, gpadl5, gpadl6: Integer;
      pl, pt, plb, pld, pb, pws, pwn, pfs, pfn, pn: Integer;
    begin

      ClearDebug;
      ClearReport;
      ConvertTime(GetTimeRunning, H, M, S);

      if (H < 9) then
        HR := '0' + IntToStr(H)
      else
        HR := IntToStr(H);

      if (M < 9) then
        MN := '0' + IntToStr(M)
      else
        MN := IntToStr(M);

      if (S < 9) then
        SC := '0' + IntToStr(S)
      else
        SC := IntToStr(S);

      { Trees Chopped .. START }
        LogsInv := BitmapFromString(18, 4, 'beNpLcDiwAIQaEkhDlOliIF5LAnm6AC/0VEE=');

        Players[CurrentPlayer].Integers[11] := TreesChoppedBef + CountItems(LogsInv, 'bmp', [90, 190]);
        Players[CurrentPlayer].Integers[10] := Floor((Players[CurrentPlayer].Integers[11] / 27));

        with Players[CurrentPlayer] do
        begin
          if (Integers[11] < (Integers[12] + Integers[13])) then
            IncEx(Integers[11], ((Integers[12] + Integers[13]) - Integers[11]));
        end;
      { Trees Chopped .. END }

      { }
        WMTRLEFT := (30 - (S/2));

        if ( (FinalProg) xor (WMTRLEFT < 3) ) then
        begin
          with Players[CurrentPlayer] do
          begin
            if Booleans[0] then Integers[18] := GetXP('firemaking');
            Integers[16] := GetXP('woodcutting');
            ReportVars[4] := ReportVars[4] + (Integers[16]-Integers[15]);
            if Booleans[0] then ReportVars[5] := ReportVars[5] + (Integers[18]-Integers[17]);
          end;
        end;
      {  }

      with Players[CurrentPlayer] do
      begin
        getpadl1 := 18 - Length(IntToStr(Integers[10])); // Loads
        getpadl2 := 15 - Length(IntToStr(Integers[11])); // Trees Chopped
        getpadl3 := 18 - Length(IntToStr(Integers[12])); // Logs Burnt
        getpadl4 := 16 - Length(IntToStr(Integers[13])); // Logs Dropped
        getpadl5 := 22 - Length(IntToStr(Integers[14])); // Banked
        // Integers[15] // Tree XP Before
        // Integers[16] // Tree XP Now
        // Integers[17] // Fire XP Before
        // Integers[18] // Fire XP Now
        // Integers[19] // Bird Nests Found
      end;

      if MultiPlayer then
      begin
        ClearDebug;

        Writeln('_____________________________________________________________________________');
        Writeln('| ' + padl(ScriptName, 33) + ' v' + padr(Version + ' ~ By: Nadeem ', 39) + '|');
        Writeln('|' + padl('Time Ran: ', 38) + HR + 'h:' + MN + 'm:' + SC + padr('s', 27) + '|');
        Writeln('|---------------------------------------------------------------------------|');
        Writeln('|    Nick   |   Loads   |   Trees   |   Burnt   |   Dropped   |   Banked    |');
        Writeln('|```````````````````````````````````````````````````````````````````````````|');

        for i:=0 to (HowManyPlayers - 1) do
        begin
          n  := '#' + IntToStr(i) + ': ' + Players[i].Nick;
          l  := IntToStr(Players[i].Integers[10]);
          t  := IntToStr(Players[i].Integers[11]);
          b  := IntToStr(Players[i].Integers[12]);
          d  := IntToStr(Players[i].Integers[13]);
          ba := IntToStr(Players[i].Integers[14]);

          gpadl1 := 12 - Length(n);
          gpadl2 := 12 - Length(l);
          gpadl3 := 12 - Length(t);
          gpadl4 := 12 - Length(b);
          gpadl5 := 14 - Length(d);
          gpadl6 := 13 - Length(ba);

          Writeln('| ' + n + padl('| ', gpadl1) + l + padl('| ', gpadl2) + t + padl('| ', gpadl3) + b + padl('| ', gpadl4) + d + padl('| ', gpadl5) + ba + padl(' |', gpadl6));
        end;
        Writeln('|___________________________________________________________________________|');

        DLPath := AppPath + 'Scripts\Smart Cutta\';
        ProgFile := RewriteFile(DLPath + '[' + IntToStr(sess) + '].SC.Multiplayer.proggie', True);
        WriteFileString(ProgFile, GetDebugText);
        CloseFile(ProgFile);
      end else
      begin
        with Players[CurrentPlayer] do
        begin
          Writeln('++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++');
          Writeln('+' + padl(ScriptName, 35) + ' v' + padr(Version, 27) + '+');
          Writeln('++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++');
          Writeln('+ Time Ran: ' + HR + 'h:' + MN + 'm:' + SC +'s' + padl('+', 10)
                   + ' ++ XP Count Updates In: ' + IntToStr(WMTRLEFT) + 's ++ +');
          Writeln('+ Loads Done: ' + IntToStr(Integers[10]) + padl('+', getpadl1)
                   + ' Woodcutting XP Start: ' + IntToStr(Integers[15]) + '   +');
          Writeln('+ Trees Chopped: ' + IntToStr(Integers[11]) + padl('+', getpadl2)
                   + ' Woodcutting XP Now: ' + IntToStr(Integers[16]) + '     +');
          Writeln('+ Logs Burnt: ' + IntToStr(Integers[12]) + padl('+', getpadl3)
                   + ' Firemaking XP Start: ' + IntToStr(Integers[17]) + '     +');
          Writeln('+ Logs Dropped: ' + IntToStr(Integers[13]) + padl('+', getpadl4)
                   + ' Firemaking XP Now: ' + IntToStr(Integers[18]) + '       +');
          Writeln('+ Banked: ' + IntToStr(Integers[14]) + padl('+', getpadl5)
                   + ' Hatchet Used: ' + HatchetUsed + '           +');
          Writeln('++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++');
        end;
      end;

      AddToReport('+++++++++++++++++++++++++++++++++');
      AddToReport('+   This Has Been A Featured    +');
      AddToReport('+       Presentation By:        +');
      AddToReport('+   Nadeem Syed (SRL: Nadeem)   +');
      AddToReport('+++++++++++++++++++++++++++++++++');
      AddToReport('+      Thank you everyone!      +');
      AddToReport('+ For without your support this +');
      AddToReport('+ script would of never existed +');
      AddToReport('+++++++++++++++++++++++++++++++++');

      with Players[CurrentPlayer] do
      begin
        pl  := Integers[10];
        pt  := Integers[11];
        plb := Integers[12];
        pld := Integers[13];
        pb  := Integers[14];
        pws := Integers[15];
        pwn := Integers[16];
        pfs := Integers[17];
        pfn := Integers[18];
        pn  := Integers[19];
      end;

      RecVars([H, M, S, pl, pt, plb, pld, pb, pws, pwn, pfs, pfn, pn]);
      WebConn(2);

    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : AntiBan | v1.0            +
    + Author   : SRL Devs (Edit: Nadeem)   +
    + Desc.    : Perform Antibanisation :P +
    +++++++++++++++++++++++++++++++++++++++}

    procedure AntiBan;
    begin
      with Players[CurrentPlayer] do
      begin
        if (Random(Integers[4]) > (Integers[4]/Integers[5]) ) then exit;
        case Random(39) of
          0: wait(500+random(10000));
          1: HoverSkill('woodcutting',false);
          2: HoverSkill('firemaking',false);
          3: PickUpMouse;
          4: wait(500+random(1000));
          5: wait(500+random(1000));
          6: RandomMovement;
          7: SleepAndMoveMouse(2000+Random(1500));
          8: SendMSG;
          9..29: MakeCompass(IntToStr(Random(360)));
        end;
      end;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : AntiRandoms | v1.0        +
    + Author   : SRL Devs (Edit: Nadeem)   +
    + Desc.    : Perform Antibanisation :P +
    +++++++++++++++++++++++++++++++++++++++}

    procedure AntiRandoms;
    begin
      FindNormalRandoms;
      FindMod;
      if FindFight then RunAway('s', True, 1, 2000 + Random(2000));
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : FindBirdsNest2            +
    + Author   : Nava2                     +
    + Desc.    : Find birds Nest!          +
    +++++++++++++++++++++++++++++++++++++++}

    function FindBirdsNest2(var fx, fy: Integer): Boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.10, 0.40);

      if not(FindColorsTolerance(arP, 2832187, MSX1, MSY1, MSX2, MSY2, 11)) then
      begin
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      arUC := arC;
      ClearSameIntegers(arUC);
      arL := High(arUC);
      arL2 := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);
        if (X >= 1.06) and (X <= 8.30) and (Y >= 1.14) and (Y <= 8.78) and (Z >= 0.81) and (Z <= 5.83) then
          for j := 0 to arL2 do
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
      end;

      ararP := SplitTPAEx(arAP, 10, 10);
      SortATPAFrom(ararP, Point(MSCX, MSCY));
      arL := High(ararP);

      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 5) then Continue;
        P := MiddleTPA(ararP[i]);
        MMouse(P.x - 4, P.y - 4, 9, 9);
        Wait(100 + Random(100));
        if (IsUpText('Take Bird')) then
        begin;
          Result := True;
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      GetMousePos(fx, fy);
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : FindBirdStuff             +
    + Author   : Nava2                     +
    + Desc.    : Find bird stuff on the    +
    +            Ground :P                 +
    +++++++++++++++++++++++++++++++++++++++}

    function FindBirdStuff : Boolean;

    var
      x, y, SAngle, TAngle, T : Integer;

    begin
      Result := False;
      if Pos('nest falls', GetBlackChatMessage) = 10 then
      begin
        Writeln('PickUpBirdsStuff : Bird''s Nest has dropped, searching.');
        SetAngle(True);
        if FindBirdsNest2(x, y) then
        begin
          Mouse(x, y, 0, 0, True);
          Result := True;
          Flag;
        end else
        begin
          SAngle := Round(rs_GetCompassAngleDegrees);
          TAngle := SAngle;
          MarkTime(T);
          repeat
            TAngle := TAngle + RandomRange(40, 60);
            if TAngle > (SAngle + 360) then
              SetAngle(False);
            if TAngle > (SAngle + 360 * 2) then
            begin
              SetAngle(True);
              TAngle := SAngle;
            end;
            MakeCompass(IntToStr(TAngle));
            if FindBirdsNest2(x, y) then
            begin
              Mouse(x, y, 0, 0, True);
              Flag;
              Result := True;
              Break;
            end;
            Wait(RandomRange(200, 300));
          until (TimeFromMark(T) > 60000) or Result;
          if (TimeFromMark(t) > 60000) and not Result then
            Writeln('PickUpBirdsStuff : Could not find Bird''s nest in 60 seconds.');
          MakeCompass(IntToStr(SAngle));
        end;
      end;
      if Result then Writeln('PickUpBirdsStuff : Found and picked up Birds Nest.');
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : MakeMove | v1.0           +
    + Author   : Nadeem                    +
    + Desc.    : Bank them logs!           +
    +++++++++++++++++++++++++++++++++++++++}

    procedure MakeMove(x, y: Integer; mrx, mry, mmrs: TIntegerArray; Click, Motion, MainScreen: Boolean);
    begin
      StatusMSG('Making A Move...');
      Mouse(x + RandomRange(mrx[0], mrx[1]), y + RandomRange(mry[0], mry[1]), 1, 1, Click);
      if Motion then CheckMotion(mmrs[0], mmrs[1], mmrs[2], MainScreen);
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : OperationBank | v1.0      +
    + Author   : Nadeem                    +
    + Desc.    : Bank them logs!           +
    +++++++++++++++++++++++++++++++++++++++}

    procedure OperationBank(Loc: Integer);
    begin
      StatusMSG('Missioning To Bank...');
      BurnLogs := false;
      MakeCompass(IntToStr(RandomRange(-10, 10)));

      case Loc of
        4 : begin
              if DebugMode then Writeln('Going To First Tree.');
              if FindSymbolIn(x, y, 'tree', 549, 5, 719, 80) then
                MakeMove(x, y, [6, 9], [9, 13], [35, 40, 2000], true, true, false);

              if DebugMode then Writeln('Looking for bank.');
              if not FindSymbol(x, y, 'bank') then
                MakeMove(640, 33, [3, 9], [3, 9], [35, 50, 3000], true, true, false)
              else
                MakeMove(x, y, [2, 4], [-1, -4], [35, 60, 2000], true, true, false);

              wait(1000 + Random(2000));
              if DebugMode then Writeln('Opening Bank.');
              if OpenBankFast('eb') then
                if BankScreen xor PinScreen then
                begin
                  if InPin(Players[CurrentPlayer].PIN) then
                     wait(2000 + RandomRange(3000, 5000));
                     Deposit(2 + Random(24), 28, True);
                     wait(1000 + Random(1000));
                     for i := 1 to 28 do
                     begin
                       if ExistsItem(i) then
                       begin
                         MMouseItem(i);
                         GetMousePos(x, y);
                         wait(100+random(150));
                         Mouse(x, y, 3, 3, false);
                         ChooseOption('eposit-All');
                       end;
                     end;
                     wait(500 + Random(1000));
                     CloseBank;
                     Inc(Players[CurrentPlayer].Integers[14]);
                end;

              if DebugMode then Writeln('Going Back To First Tree.');
              MouseBox(593, 125, 610, 155, 1);
              MakeMove(593, 125, [15, 17], [25, 30], [10, 20, 1500], true, true, false);
              wait(250 + Random(250));
              if FindSymbolIn(x, y, 'tree', MMX1, MMY1, MMX2, MMY2) then
                MakeMove(x, y, [6, 9], [9, 13], [15, 40, 2000], true, true, false);

            end;
      end;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : OperationLogs | v1.0      +
    + Author   : Nadeem                    +
    + Desc.    : Take care of them logs.   +
    +++++++++++++++++++++++++++++++++++++++}

    procedure OperationLogs;
    var
      BurnLogs, NoMoreLogs: Boolean;
      TheLogs, Tinderbox, TreeOnMap, t: Integer;
    begin
      StatusMSG('Taking Care Of Logs...');

      { Pre-Begin .. START }
        GoToSleep;
        WriteMeTheReport(false);
        TreesChoppedBef := Players[CurrentPlayer].Integers[11];
        NoMoreLogs := false;

        TheLogs := BitmapFromString(31, 25, 'z78DAED97810D002008C35' +
             'EE20AFF3FC90F0806852EB207A88EC030EBD1726530C5D938FCA7' +
             '24B7C8575AAF5FCA712D5397D0695D7EFD49AEDB2DEAE47106E62' +
             'EF349983BD77781CF9CEFA5211FF221AF9F90BAE4CC1BE434E757' +
             'DE869555EE7232F39B56FE519954845FDD2F1893E2');

        Tinderbox := BitmapFromString(13, 1, '604109604109604109604' +
             '109604109604109938989988E8D91878789807F7B7272635C5B45' +
             '4141');

        TreeOnMap := DTMFromString('78DA63F4636260B8C880029CD2F5188C80342' +
                  '310FF0702C640A09A0BA86A94625518B8A06A4000004A1107FB');
      { Pre-Begin .. END }

      if ( (ChoppingInt = 4) or (ChoppingInt = 9) ) then
        OperationBank(ChoppingInt)
      else if BurnAfterChop then
        BurnLogs := true
      else
        BurnLogs := false;

      if not FindBitmapMaskTolerance(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2, 10, 2) then BurnLogs := false;

      if BurnLogs then
      begin
        StatusMSG('Burning Logs!');
        GameTab(4);

        repeat

          if FindBitmapMaskTolerance(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2, 10, 2) then
          begin
            Mouse(x, y, 3, 3, true);
          end else
          begin
            for i := 1 to 28 do
            begin
              if ExistsItem(i) then
              begin
                MMouseItem(i);
                GetMousePos(x, y);
                wait(50+random(100));
                if (pos('inderbox', rs_GetUpText) > 0) then
                  Mouse(x, y, 3, 3, true);
              end;
            end;
          end;

          if FindBitmapMaskTolerance(TheLogs, x, y, MIX1, MIY1, MIX2, MIY2, 10, 2) then
          begin
            Mouse(x, y, 3, 3, true);
          end else
          begin
            for i := 1 to 28 do
            begin
              if ExistsItem(i) then
              begin
                MMouseItem(i);
                GetMousePos(x, y);
                wait(50+random(100));
                if (pos('og', rs_GetUpText) > 0) then
                  Mouse(x, y, 3, 3, true);
                wait(RandomRange(399, 799));
              end else if (i > 27) then
              begin
                NoMoreLogs := true;
              end;
            end;
          end;

          wait(250 + Random(350));
          if ClickContinueNOW then wait(100);

          if FindBlackChatMessage('attempt') then
          begin
            MarkTime(t);
            repeat
              wait(100);
              if ClickContinueNOW then wait(100);
            until ( (FindBlackChatMessage('attempt')) or (TimeFromMark(t) > 15000) );
            Inc(Players[CurrentPlayer].Integers[12]);
          end;

          if FindBlackChatMessage('can''t') then
          begin
            if FindDTM(TreeOnMap, x, y, MMX1, MMY1, MMX2, MMY2) then
              MakeMove(x, y, [1, 3], [2, 5], [5, 10, 1500], true, true, false)
            else
              MakeMove(MMCX, MMCY, [6, 13], [6, 13], [5, 10, 1500], true, true, false);
          end;

        until (NoMoreLogs);

      end else
      begin
        StatusMSG('Dropping Inventory!');
        GameTab(4);

        repeat
          for i := 1 to 28 do
          begin
            if ExistsItem(i) then
            begin
              MMouseItem(i);
              GetMousePos(x, y);
              wait(50+random(100));
              if (pos('og', rs_GetUpText) > 0) then
              begin
                Mouse(x, y, 3, 3, false);
                ChooseOption('rop');
                wait(RandomRange(299, 599));
                Inc(Players[CurrentPlayer].Integers[13]);
              end;
            end;
            if (i = 28) then NoMoreLogs := true;
          end;
        until (NoMoreLogs);
      end;

      FreeBitmap(TheLogs);
      FreeBitmap(Tinderbox);
      FreeDTM(TreeOnMap);

    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : SmartFind | v1.0          +
    + Author   : Nadeem                    +
    + Desc.    : Find treeeeeees!!! :P     +
    +++++++++++++++++++++++++++++++++++++++}

    function SmartFind: Boolean;
    var
      Color, CTS, TimeFinding: Integer;
    begin
      if InvFull then Exit;
      Color := StrToInt(TypeOfTree(2, ChoppingInt));
      if DebugMode then Writeln('Using Color: ' + IntToStr(Color));
      TimeFinding := GetSystemTime;

      CTS := GetColorToleRanceSpeed;
      ColorToleranceSpeed(2);
      SetColorspeed2Modifiers(0.039, 0.93);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, 9);
      if DebugMode then DebugTPA(TPA, 'cts ' + inttostr(0));
      ColorToleranceSpeed(CTS);
      SetColorspeed2Modifiers(0.2, 0.2);

      WriteLn(IntToStr(High(TPA) - 1) + ' TPAs found in ' + IntToStr(GetSystemTime - TimeFinding) + ' milliseconds!');
      if DebugMode then Writeln('[' + IntToStr(NoTrees) + '] [SMART FIND] TPAs: ' + IntToStr(Length(TPA)));

      AntiRandoms;
      FindBirdStuff;

      if (Length(TPA) > 19) then Result := true;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : SmartCut | v1.0           +
    + Author   : Nadeem                    +
    + Desc.    : Get them treeeess! xP     +
    +++++++++++++++++++++++++++++++++++++++}

    procedure SmartCut;
    var
      tr, t, TreeOnMap, HoTr, WaitMS: Integer;
      TreeChopped, BeginCutting: Boolean;
    begin
      if InvFull then Exit;
      SetAngle(true);

      repeat

        if (Random(10) > 7) then
          LClick := false
        else
          LClick := true;

        StatusMSG('Looking For Trees...');
        if SmartFind then
        begin
          StatusMSG('Trees Found! Making Moves...');
          TREE := SplitTPAEx(TPA, 6, 6);
          SortATPAFrom(TREE, TreePoint);
          HoTr := (High(TREE) - 1);

          if DebugMode then Writeln('//[SMART CUT] Trees:' + IntToStr(Length(TREE)) + ' [' + IntToStr(HoTr) + ']');

          for tr:=0 to HoTr do
          begin
            StatusMSG('Chopping Tree ' + IntToStr(tr) + '/' + IntToStr(HoTr));
            //wait(2000);

            if (ChoppingInt = 4) then
              BeginCutting := true
            else if (Length(TREE) > 1) then
              BeginCutting := true
            else
              BeginCutting := false;

            if BeginCutting then
            begin
              MiddleTPAEx(TREE[tr], x, y);
              Wait(20 + Random(150));
              MMouse(x, y, 3, 3);
              wait(25 + Random(150));

              if IsUpText(TypeOfTree(1, ChoppingInt)) then
              begin
                if InvFull then Exit;
                GetMousePos(x, y);
                Wait(50 + Random(150));
                Mouse(x, y, 9, 9, LClick);
                if not LClick then ChooseOption('Chop');
                CheckMotion(13, 39, 1500, false);
                TreeChopped := false;
                MarkTime(t);

                repeat
                  wait(100);
                  if ClickContinueNOW then wait(100);
                  AntiRandoms;
                  FindBirdStuff;

                  if (ChoppingInt > 1) then SleepAndMoveMouse(500 + RandomRange(500, 1000));

                  if FindBlackChatMessage('get') then
                  begin
                    if (ChoppingInt > 1) then SleepAndMoveMouse(3000 + RandomRange(1500, 3000));
                    MMouse(x, y, 9, 9);
                    if IsUpText(TypeOfTree(1, ChoppingInt)) then
                      Mouse(x, y, 9, 9, true)
                    else
                      TreeChopped := true;
                  end;

                  AntiRandoms;
                  FindBirdStuff;

                  if ( (ChoppingInt = 4) or (ChoppingInt = 9) ) then
                    WaitMS := RandomRange(25000, 33000)
                  else if (ChoppingInt > 1) then
                    WaitMS := RandomRange(13000, 18000)
                  else
                    WaitMS := RandomRange(6000, 13000);

                  if (TimeFromMark(t) > WaitMS) then
                    TreeChopped := true;

                  if DebugMode then Status(IntToStr(TimeFromMark(t)));

                until (TreeChopped);

              end else
              begin
                Inc(NoTrees);
              end;
            end;
          end;
        end else
        begin
          Inc(NoTrees);
          if (ChoppingInt = 4) then SleepAndMoveMouse(800 + RandomRange(100, 500));
        end;

        if (NoTrees > 9) then
        begin

          WriteMeTheReport(False);
          if (ChoppingInt = 4) then
          begin
            { YEWS..START }
              MakeCompass('n');
              if FindSymbol(x, y, 'water') then
              begin
                if FindSymbolIn(x, y, 'tree', 549, 83, 712, 157) then
                  Mouse(x + RandomRange(3, 6), y - RandomRange(9, 13), 1, 1, true);
                  //MakeMove(x, y, [3, 6], [-9, -13], [0, 0], true, false, false);
              end else
              begin
                if FindSymbolIn(x, y, 'tree', 549, 5, 719, 80) then
                  Mouse(x + RandomRange(3, 6), y + RandomRange(9, 13), 1, 1, true);
                  //MakeMove(x, y, [3, 6], [7, 13], [0, 0], true, false, false);
              end;
            { YEWS..END }
          end else if (ChoppingInt > 1) then
          begin
            { LONG..START }
              SleepAndMoveMouse(3000 + RandomRange(3000, (1000 * ChoppingInt)));
            { LONG..END }
          end else if (NoTrees > 19) then
          begin
            { ALL..START }
              TreeOnMap := DTMFromString('78DA63F4636260B8C880029CD2F5188C80342' +
                        '310FF0702C640A09A0BA86A94625518B8A06A4000004A1107FB');

              if FindDTM(TreeOnMap, x, y, 593, 52, 659, 114) then
                MakeMove(x, y, [1, 3], [2, 5], [5, 10, 1500], true, true, false)
              else
                MakeMove(MMCX, MMCY, [6, 13], [6, 13], [5, 10, 1500], true, true, false);
            { ALL..END }
          end;

          NoTrees := 0;
        end;

      until (InvFull);

    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : RecVars | v1.0            +
    + Author   : Nadeem                    +
    + Desc.    : Record variables in order +
    +            To save data for record.  +
    +++++++++++++++++++++++++++++++++++++++}

    function RecVars(p: TIntegerArray): Boolean;
    var
      TCpH: Integer;
    begin
      TCpH := Round( p[4]/(p[0]+p[1]/60.0) );            /// Thanks to Narcle! :D
      PostVar[0]  := ScriptName;                         // Script Name
      PostVar[1]  := Version;                            // Script Version
      PostVar[2]  := IntToStr(p[0]);                     // Hours
      PostVar[3]  := IntToStr(p[1]);                     // Minutes
      PostVar[4]  := IntToStr(p[2]);                     // Seconds
      PostVar[5]  := HatchetUsed;                        // Hatched Used
      PostVar[6]  := IntToStr(p[3]);                     // Loads Done
      PostVar[7]  := IntToStr(p[4]);                     // Trees Chopped
      PostVar[8]  := IntToStr(p[5]);                     // Logs Burnt
      PostVar[9]  := IntToStr(p[6]);                     // Logs Dropped
      PostVar[10] := IntToStr(p[7]);                     // Logs Banked
      PostVar[11] := IntToStr(p[8]);                     // Woodcutting XP Start
      PostVar[12] := IntToStr(p[9]);                     // Woodcutting XP Now
      PostVar[13] := IntToStr(p[9] - p[8]);              // Woodcutting XP Gained
      PostVar[14] := IntToStr(p[10]);                    // Firemaking XP Start
      PostVar[15] := IntToStr(p[11]);                    // Firemaking XP Now
      PostVar[16] := IntToStr(p[11] - p[10]);            // Firemaking XP Gained
      PostVar[17] := IntToStr(TCpH);                     // Trees Chopped per Hour
      PostVar[18] := IntToStr(p[12]);                    // Bird Nests Found
      PostVar[19] := Capitalize(Players[CurrentPlayer].Strings[0]);  /// Trees chopping

      Result := true;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : WebConn | v1.0            +
    + Author   : Nadeem                    +
    + Desc.    : Connection & interaction  +
    +            To website.               +
    +++++++++++++++++++++++++++++++++++++++}

    function WebConn (gData: Integer): Boolean;
    var
      WebFile, DataFile, gVersion, ScrLoc, addProg, NickN, DLPath: String;
      gConfigO: String;
      DownloadScript, EnterProggie: Boolean;
      ScrStrt, ProggieFile, CFGFile: Integer;
      //ScrPage, getCMD: String;
      //ScrSrc: Integer;
    begin
      StatusMSG('Checking Script Status...');
      ScrLoc := 'http://www.nsyed.com/SCAR/SC/';
      DLPath := AppPath + 'Scripts\Smart Cutta\';

      WebFile := ScrLoc + 'info';
      DataFile := GetPage(WebFile);
      gConfigO := Between('ConfigOverride [', ']', DataFile);
      gVersion := Between('Version [', ']', DataFile);

      case gData of
        1 : begin
              if (gVersion > Version) then
                DownloadScript := true
              else
                WriteLn('Script is up to date, continuing...');
            end;

        2 : begin
              WebFile := ScrLoc + 'SmartCutta.php';
              if (TimeFromMark(ScrStrt) > 60000) then
              begin
                EnterProggie := true;
                MarkTime(ScrStrt);
              end else
              begin
                EnterProggie := false;
              end;
            end;
      end;

      if not (FileExists(DLPath + 'Nadeem[global].cfg') or (gConfigO = '0')) then
      begin
        try
          Status('Downloading Config File...');
          CFGFile := RewriteFile(DLPath + 'Nadeem[global].cfg', false);
          WriteFileString(CFGFile, GetPage(ScrLoc + 'Nadeem%5Bglobal%5D.cfg'));
          CloseFile(CFGFile);
          Writeln(DLPath + 'Nadeem[global].cfg');
        except
          Writeln('Unable to download config file...');
        end;
      end;

      if not FileExists(DLPath + 'SC_Splash.bmp') then
      begin
        try
          Status('Downloading Splash File...');
          CFGFile := RewriteFile(DLPath + 'SC_Splash.bmp', false);
          WriteFileString(CFGFile, GetPage(ScrLoc + 'SC_Splash.bmp'));
          CloseFile(CFGFile);
        except
          Writeln('Unable to download Splash file...');
        end;
      end;

      if DownloadScript then
      begin
        {ScrPage := ScrLoc + 'script';
        case GetApplication.Messagebox('Version ' + gVersion + ', Download?' , 'Download Latest Version', 3) of
        6 : begin
              ScrSrc := ReWriteFile(DLPath + 'Smart Cutta [Ultimate] [' + gVersion + '] [Nadeem].scar', true);
              WriteFileString(ScrSrc, GetPage(ScrPage));
              CloseFile(ScrSrc);
              GetApplication.MessageBox('"Smart Cutta [' + gVersion + '] [Nadeem].scar" has been successfully downloaded.' + chr(13) + 'Please re-open with the new version.', 'Download Succesfull!', 0);
              TerminateScript;
            end else
            begin
              ClearDebug;
              Writeln('It can be VERY dangerous to run an old script...');
              getCMD := Readln('It can be VERY dangerous to run an old script...' + chr(13) +'   Override command?' + chr(13) + '   ''Yes'', or ''No''?');
              if (Lowercase(getCMD) = 'yes') then Exit;
              TerminateScript;
            end;
        end;}

        ClearDebug;
        Writeln('A new version has been released! Please run the [SC]Downloader.scar file. (Make sure downloader is v1.3)');
        TerminateScript;
      end;

      if EnterProggie then
      begin
        ProggieFile := InitializeHTTPClient(False, False);
        ClearPostData(ProggieFile);
        AddPostVariable(ProggieFile, 'user', '43162');
        AddPostVariable(ProggieFile, 'pass', 'nadeem');

        if MultiPlayer then
          NickN := 'multi'
        else if (Players[CurrentPlayer].Strings[1] = '') then
          NickN := Players[CurrentPlayer].Nick
        else
          NickN := Players[CurrentPlayer].Strings[1];

        AddPostVariable(ProggieFile, 'nick', NickN)

        if FileExists(DLPath + 'Nadeem[global].cfg') then
          PLID := StrToInt(ReadINI('Smart Cutta', 'PLID', DLPath + 'Nadeem[global].cfg'));

        AddPostVariable(ProggieFile, 'plid', IntToStr(PLID));
        AddPostVariable(ProggieFile, 'sess', IntToStr(sess));

        for i:=0 to 19 do
          AddPostVariable(ProggieFile, 'var' + IntToStr(i), PostVar[i]);

        addProg := PostHTTPPageEx(ProggieFile, WebFile);
        Writeln('Entering Proggie... Player ID: ' + addProg);
        if (PLID < 1) then PLID := StrToInt(addProg);

        if FileExists(DLPath + 'Nadeem[global].cfg') then
        begin
          WriteINI('Smart Cutta', 'PLID', IntToStr(PLID), DLPath + 'Nadeem[global].cfg');
          WriteINI('Smart Cutta', 'Proggie', 'Your proggies are located at: ' + ScrLoc + 'p/' + IntToStr(PLID), DLPath + 'Nadeem[global].cfg');
        end;

        ClearReport;
        ChangeReportWidth(600);
        AddToReport('View A Detailed Proggie At: ');
        AddToReport(' ' + ScrLoc + 'p/' + IntToStr(PLID) + '/[' + IntToStr(sess) + '].' + NickN + '.html');

        if Multiplayer then
        begin
          AddToReport('');
          AddToReport('Your multiplayer proggie has been saved at: ');
          AddToReport(DLPath + '[' + IntToStr(sess) + '].SC.Multiplayer.proggie');
        end;

        AddToReport('Please do not forget to post your Proggie at SRL Forums! :P (VillaVu.com)');
        AddToReport('');
        AddToReport('+++++++++++++++++++++++++++++++++');
        AddToReport('+      Thank you everyone!      +');
        AddToReport('+ For without your support this +');
        AddToReport('+ script would of never existed +');
        AddToReport('+++++++++++++++++++++++++++++++++');

      end;

      Result := true;
    end;


    {+++++++++++++++++++++++++++++++++++++++
    + Function : Start | v1.0              +
    + Author   : Nadeem                    +
    + Desc.    : So lets begin PLAYA!      +
    +++++++++++++++++++++++++++++++++++++++}

    procedure Start;
    var
      FinishCutta: Boolean;
    begin

      if not LoggedIn then LoginPlayer;
      LogoutTime := Getsystemtime + RandomRange(9*60000, 13*60000);


      SetChat('off', 4);
      SetChat('off', 5);

      if not SendTXTIngame then
      begin
        SetChat('off', 1);
        Mouse(66 + Random(45), 484 + Random(16), 0, 0, true);
      end else
      begin
        SetChat('on', 1);
        Mouse(12 + Random(41), 484 + Random(16), 0, 0, true);
      end;

      with Players[CurrentPlayer] do
      begin
        if Booleans[0] then Integers[17] := GetXP('firemaking');
        Integers[15] := GetXP('woodcutting');
        if Booleans[0] then Integers[18] := Integers[17];
        Integers[16] := Integers[15];

        ChoppingInt := 0;

        case Lowercase(Strings[0]) of
          'all'        : ChoppingInt := 0;
          'normal'     : ChoppingInt := 1;
          'oak'        : ChoppingInt := 2;
          'willow'     : ChoppingInt := 3;
          'yew'        : ChoppingInt := 4;
          'teak'       : ChoppingInt := 5;
          'mahogany'   : ChoppingInt := 6;
          'tmaho'      : ChoppingInt := 7;
          'maple'      : ChoppingInt := 8;
        end;

        Writeln('Chopping Tree: ' + Capitalize(Strings[0]) + ':' + IntToStr(ChoppingInt));
        wait(1000);
      end;

      repeat

        GrabHatchetName;
        WriteMeTheReport(false);
        Gametab(1 + Random(6));
        SetRun(true);
        SetAngle(true);
        MakeCompass(IntToStr(Random(360)));
        if ClickContinueNOW then wait(100);

        SetRun(true);
        StatusMSG('OK. Lets begin cutting!');

        SmartCut;
        OperationLogs;

        WriteMeTheReport(true);

        if (Players[CurrentPlayer].Integers[10] >= (Players[CurrentPlayer].Integers[1])) then
          FinishCutta := true;

        Antiban;
        AntiRandoms;
        GoToSleep;

      until(FinishCutta = true);

      if (Players[CurrentPlayer].Integers[10] >= (Players[CurrentPlayer].Integers[1])) then
      begin
        GlobalReport(True, 'Finished cutting loads. ' + Players[CurrentPlayer].Nick + ' | ' + IntToStr(Players[CurrentPlayer].Integers[10]));
      end else
      begin
        GlobalReport(True, 'Unknown Error...');
      end;

    end;


    {------------------------------------------------------------------------------}
    {============================END..Cutting..Process=============================}
    {------------------------------------------------------------------------------}
    {------------------------------------------------------------------------------}
    {============================START..Setup..Process=============================}
    {------------------------------------------------------------------------------}

    procedure SetupSMART;
    var
      st, wt: String;
    begin
      SmartSetupEx(WorldNum, Member, Signed, False);
      wait(3000);
      SetTargetDC(SmartGetDC);

      repeat
        wt := wt + '.';
        wait(100);
        Status('Waiting for SMART to be enabled.' + wt);
      until (SmartEnabled);

      repeat
        st := st + '.';
        wait(100);
        Status('Connecting To SMART.' + st);
      until (SmartGetColor(253, 233) <> 1118604);

      Status('Connected!');
      wait(1000);
      Status('.Script Started.');
    end;

    procedure SetupSCRIPT;
    var
      wp: String;
    begin

      SRLId := SRLStatsId;
      SRLPassword := SRLStatsPass;
      SetupSRL;
      ScriptID := '1205';

      ClearDebug;
      ClearReport;
      Disguise('Windows Live Hotm...');
      ChangeReportWidth(500);

      MouseSpeed := RandomRange(TheMouseSpeed, RanMouseSpeed);

      try
        DeclarePlayers;
      except
        Writeln('You did not Declare Players correctly, check your DeclarePlayers setup.');
        TerminateScript;
      end;

      Status('Starting ' + ScriptName + ' v' + Version);

      ClearDebug;
      repeat
        wp := wp + '.';
        ReplaceDebugLine(GetDebugLineCount, 'Welcome To.' + wp);
        wait(100);
        ClearDebug;
      until (Length(wp) > 9);

      if(HowManyPlayers > 1) then
      begin
        Writeln('Multi-Player Mode');
        MultiPlayer := true;
      end else
      begin
        Writeln('Single-Player Mode');
        MultiPlayer := false;
      end;

      ActivateClient;

      if not LoggedIn then LoginPlayer;

    end;

    {------------------------------------------------------------------------------}
    {=============================END..Setup..Process==============================}
    {------------------------------------------------------------------------------}
    {------------------------------------------------------------------------------}
    {============================START..MAIN.EXECUTION=============================}
    {------------------------------------------------------------------------------}
    var
      Canvas: TCanvas;
      Buffer, SplashIMG: Integer;
      strMSG: String;
    begin
      ClearDebug;
      if UseForm then
      begin
        GetSelf.WindowState := wsMinimized;
        MainInitForm;
        GetSelf.WindowState := wsMaximized;
      end;
      WebConn(1);
      { Draw Out My Splash Screen! ... START }

        DLPath := AppPath + 'Scripts\Smart Cutta\';
        Buffer:= BitmapFromString(350, 290, '');
        DisplayDebugImgWindow(350, 290);
        SplashIMG := LoadBitmap(DLPath + 'SC_Splash.bmp');
        FastDrawTransparent(0, 0, SplashIMG, Buffer);
        SafeDrawBitmap(Buffer, GetDebugCanvas, 0, 0);

        strMSG   := 'Welcome...To ' + ScriptName + ' v' + Version + '!';
        Canvas   := GetDebugCanvas;
        with Canvas do
        begin
          Font.name := 'Arial';
          Font.Size := 10;
          Font.Color := clBlack;
          TextOut(1, 275, padl(padr(strMSG, 60), 73));
        end;

        FreeBitmap(SplashIMG);

      { Draw Out My Splash Screen! ... END }
      SetupSMART;
      SetupScript;
      MarkTime(sess);
      MarkTime(SleepTime);
      Start;
    end.
    {------------------------------------------------------------------------------}
    {=============================END..MAIN.EXECUTION==============================}
    {------------------------------------------------------------------------------}

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm too busy to read through it all..

    but what I noticed in about 10 seconds is just.. ALL bold words are lowercase.. array not Array..

    and for if (Something) then, it should be if(Something)then.. no space.

    and don't have random blank lines like..

    if not (Username = '*') then Load := True;

    Password := ReadINI('P' + IntToStr(i), 'Password', DLPath + 'Nadeem[global].cfg');

    (also, the if not then should be if(not(Username = '*')then Load := True; ) and no space between those lines (I hope you get what I mean )



    I think you're a really good scripter <3 keep it up

  3. #3
    Join Date
    May 2007
    Posts
    106
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good scripts, bad standards

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It seems like your a really good scripter with knowledge of types forward etc.

  5. #5
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @99_ : Thank you I'll take your suggestions in mind and apply it to my coding skillz

    @Whakey : ty, what would you suggest though?

    @Da 0wner : hehe tyty :P

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You must be retarded whakey, he has damn near perfect standards. Only wrong thing is that he has array and a few other bolded words capitalized.

  7. #7
    Join Date
    Dec 2007
    Location
    Middle of Here and There
    Posts
    417
    Mentioned
    6 Post(s)
    Quoted
    25 Post(s)

    Default

    With just a brief look-over of the script, it looks great. You're on the way to greatness!

  8. #8
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Your knowledge of Types is hawt.
    Jus' Lurkin'

  9. #9
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Looks good, I would recommend SafeDrawBitmap over CopyCanvas .

    I am an array freak:

    SCAR Code:
    0: Result := 'hop';
          1: Result := 'ree';
          2: Result := 'ak';
          3: Result := 'illow';
          4: Result := 'ew';
          5: Result := 'eak';
          6: Result := 'ahogany';
          7: Result := 'hop d';
          8: Result := 'aple';
          9: Result := 'hop';

    SCAR Code:
    StrArr := ['hop', 'ree', 'ak', 'illow', 'ew', 'eak', 'ahogany', 'hop d', 'aple', 'hop'];
      if (GET = 1) then
      For I := 0 to High(StrArr) Do
        If Tot = I Then Result := StrArr[I];

    You'd need to extra var's though :/.

    You could cut out your begins and end else's by using an else statement after an 'if'.

    Looks great man

  10. #10
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    ProphecyOfWolf, that was a 2 month gravedig. Don't do it again please.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  11. #11
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    I'm too busy to read through it all..

    but what I noticed in about 10 seconds is just.. ALL bold words are lowercase.. array not Array..

    and for if (Something) then, it should be if(Something)then.. no space.

    and don't have random blank lines like..

    if not (Username = '*') then Load := True;

    Password := ReadINI('P' + IntToStr(i), 'Password', DLPath + 'Nadeem[global].cfg');

    (also, the if not then should be if(not(Username = '*')then Load := True; ) and no space between those lines (I hope you get what I mean )



    I think you're a really good scripter <3 keep it up
    Quote Originally Posted by Nadeem View Post
    @99_ : Thank you I'll take your suggestions in mind and apply it to my coding skillz

    @Whakey : ty, what would you suggest though?

    @Da 0wner : hehe tyty :P
    Ignore him...
    He's telling a lie.
    ~Hermen

  12. #12
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol yes (nice gravedig), I promise I've gotten even better now This was like before I was a member too

    ty anyway!

    Edit: Please close.



    ~NS

  13. #13
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wait who's telling a lie?

  14. #14
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It should be:
    SCAR Code:
    if not Username = '*' then
     ... // on a new line

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
  •