Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program NewScript;
- {$DEFINE SMART}
- {$i SRL\SRL.scar}
- {$i Reflection\Reflection.Simba}
- const
- //Just hit play - smart options are here. (Fill smart options in first)
- S_World = 33;
- S_Signed = True;
- S_Member = True;
- var
- ScriptForm: TForm;
- Label1: TLABEL;
- CheckBox1: TCHECKBOX;
- CheckBox2: TCHECKBOX;
- Label2: TLABEL;
- DropDown2: TCOMBOBOX;
- Label3: TLABEL;
- Radios: TRADIOGROUP;
- Label4: TLABEL;
- Editable1: TEDIT;
- Label5: TLABEL;
- Editable2: TEDIT;
- Button1: TBUTTON;
- Button2: TBUTTON;
- Button3: TBUTTON;
- function FormCanProceed: Boolean;
- begin
- if (Editable1.TEXT = '') or (Editable2.TEXT = '') then
- begin
- Result := False;
- writeln('Form cannot proceed because you did not fill in username/password');
- Exit;
- end;
- if (CheckBox1.STATE = cbUnchecked) and (CheckBox2.STATE = cbUnchecked) then
- begin
- Result := False;
- writeln('Form cannot proceed because you did not choose whether to cut or string or do both');
- Exit;
- end;
- if (DropDown2.ITEMINDEX = -1) then
- begin
- Result := False;
- writeln('Form cannot proceed because you did not choose what type of log to fletch');
- Exit;
- end;
- if (Radios.ITEMINDEX = -1) then
- begin
- Result := False;
- writeln('Form cannot proceed because you did not choose short or longbows');
- Exit;
- end;
- Result := True;
- end;
- procedure SavePlayerInfo(Sender: TObject);
- begin
- if not(FormCanProceed) then
- Exit;
- WriteINI('user', 'name', Base64Encode(Editable1.TEXT), ScriptPath + 'PlayerInfo.ini');
- WriteINI('user', 'pass', Base64Encode(Editable2.TEXT), ScriptPath + 'PlayerInfo.ini');
- end;
- procedure LoadPlayerInfo(Sender: TObject);
- begin
- Editable1.TEXT := Base64Decode(ReadINI('user', 'name', ScriptPath + 'PlayerInfo.ini'));
- Editable2.TEXT := Base64Decode(ReadINI('user', 'pass', ScriptPath + 'PlayerInfo.ini'));
- end;
- const
- LongBows = 0;
- Cut = 1;
- Strng = 2;
- LogType = 0;
- LOG_REG = 0;
- LOG_OAK = 1;
- LOG_WILLOW = 2;
- LOG_MAPLE = 3;
- LOG_YEW = 4;
- LOG_MAGIC = 5;
- procedure EndForm(Sender: TObject);
- begin
- if not(FormCanProceed) then
- Exit;
- HowManyPlayers := 1;
- NumberOfPlayers(1);
- Players[0].Name := Editable1.TEXT;
- Players[0].Pass := Editable2.TEXT;
- Players[0].Active := True;
- case Radios.ITEMINDEX of
- 0: Players[0].Booleans[LongBows] := False;
- 1: Players[0].Booleans[LongBows] := True;
- end;
- Players[0].Integers[LogType] := DropDown2.ITEMINDEX;
- ScriptForm.CLOSE;
- end;
- procedure InitForm;
- begin
- //Primary Form
- ScriptForm := CreateForm;
- ScriptForm.Height := 200;
- ScriptForm.Width := 300;
- ScriptForm.CAPTION := 'Fletcher';
- //Label1: "Choose what to do:" (string/fletch)
- Label1 := TLABEL.Create(ScriptForm);
- Label1.Parent := ScriptForm;
- Label1.Top := 5;
- Label1.Left := 10;
- Label1.CAPTION := 'Choose what to do:';
- //CheckBox1: [ ] String
- CheckBox1 := TCHECKBOX.Create(ScriptForm);
- CheckBox1.Parent := ScriptForm;
- CheckBox1.Top := 26;
- CheckBox1.Left := 10;
- CheckBox1.CAPTION := 'Cut';
- //CheckBox2: [ ] Fletch
- CheckBox2 := TCHECKBOX.Create(ScriptForm);
- CheckBox2.Parent := SCriptForm;
- CheckBox2.Top := 26;
- CheckBox2.Left := 55;
- CheckBox2.CAPTION := 'String';
- //Label2: "Choose what type of log:" (regular/oak/etc.)
- Label2 := TLABEL.Create(ScriptForm);
- Label2.Parent := ScriptForm;
- Label2.Top := 55;
- Label2.Left := 10;
- Label2.CAPTION := 'Choose what type of log:';
- //DropDown2: Log types
- DropDown2 := TCOMBOBOX.Create(ScriptForm);
- DropDown2.Parent := ScriptForm;
- DropDown2.ITEMS.Add('Normal');
- DropDown2.ITEMS.Add('Oak');
- DropDown2.ITEMS.Add('Willow');
- DropDown2.ITEMS.Add('Maple');
- DropDown2.ITEMS.Add('Yew');
- DropDown2.ITEMS.Add('Magic');
- DropDown2.Top := 76;
- DropDown2.Left := 10;
- //Label3: "Shortbows or Longbows?" (Shortbow/Longbow)
- Label3 := TLABEL.Create(ScriptForm);
- Label3.Parent := ScriptForm;
- Label3.CAPTION := 'Shortbows or Longbows?';
- Label3.Top := 110;
- Label3.Left := 10;
- //Radios: Shortbow/Longbow
- Radios := TRADIOGROUP.Create(ScriptForm);
- Radios.Parent := ScriptForm;
- Radios.ITEMS.Add('Short');
- Radios.ITEMS.Add('Long');
- Radios.Top := 126;
- Radios.Left := 10;
- Radios.Width := 80;
- Radios.Height := 65;
- //Label4: "Username:" (Player username)
- Label4 := TLABEL.Create(ScriptForm);
- Label4.Parent := ScriptForm;
- Label4.Top := 5;
- Label4.Left := 160;
- Label4.CAPTION := 'Username:';
- //Editable1: Username
- Editable1 := TEDIT.Create(ScriptForm);
- Editable1.Parent := ScriptForm;
- Editable1.Top := 21;
- Editable1.Left := 160;
- Editable1.Width := Editable1.Width + 10; //Increasing default width by 10 pixels
- //Label5: "Password:" (Player password)
- Label5 := TLABEL.Create(ScriptForm);
- Label5.Parent := ScriptForm;
- Label5.Top := 48;
- Label5.Left := 160;
- Label5.CAPTION := 'Password:';
- //Editable2: Password
- Editable2 := TEDIT.Create(ScriptForm);
- Editable2.Parent := ScriptForm;
- Editable2.Top := 64;
- Editable2.Left := 160;
- Editable2.Width := Editable2.Width + 10; //Increasing default width by 10 pixels
- Editable2.PASSWORDCHAR := '*';
- //Button1: Save player information
- Button1 := TBUTTON.Create(ScriptForm);
- Button1.Parent := ScriptForm;
- Button1.Top := 98;
- Button1.Left := 160;
- Button1.CAPTION := 'Save Player Info';
- Button1.ONCLICK := @SavePlayerInfo;
- Button1.Width := 95;
- //Button2: Load player information
- Button2 := TBUTTON.Create(ScriptForm);
- Button2.Parent := ScriptForm;
- Button2.Top := 132;
- Button2.Left := 160;
- Button2.CAPTION := 'Load Player Info';
- Button2.ONCLICK := @LoadPlayerInfo;
- Button2.Width := 95;
- //Button3: Start script
- Button3 := TButton.Create(ScriptForm);
- Button3.Parent := ScriptForm;
- Button3.Top := 165;
- Button3.Left := 160;
- Button3.Caption := 'Start Script!';
- Button3.ONCLICK := @EndForm;
- Button3.Width := 95;
- end;
- procedure ShowFormModel;
- begin
- ScriptForm.SHOWMODAL;
- end;
- procedure ShowForm;
- var
- v: TVariantArray;
- begin
- ThreadSafeCall('InitForm', v);
- SetLength(v, 0);
- ThreadSafeCall('ShowFormModel', v);
- end;
- begin
- ShowForm;
- Smart_Server := S_World;
- Smart_Signed := S_Signed;
- Smart_Members := S_Member;
- Smart_SuperDetail := False;
- SetupSRL;
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- R_UpdateHooks;
- if not(LoggedIn) then
- begin
- LogInPlayer;
- Wait(3000 + Random(2000));
- SetAngle(True);
- MakeCompass('n');
- end else
- PlayerStartTime := GetSystemTime;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement