SRL Archive - RS Scripts

Runescape Drop Log by All that is man


All that is man

2009-10-18 01:38:21

Just a simple form with a neat function….
….Yes, I play runescape legit….

Also does anyone know how I would go about clicking a button that would save it to a file? If that's possible.

{Runescape Drop Log by All that is man}

program FormDesign;
var
frmDropLog: Tform;
lstbxDrops: TListBox;
edtAddDrop: TEdit;
btnAddDrop: TButton;
btnQuickDrops: Array[0..1]of TButton;
trbCharmType: Array[0..3]of TRadioButton;
QuickDropCaptions, CharmTypeCaptions: TStringArray;
lblQuick: TLabel;
i, dn: integer;

procedure AddDrop(tob: TObject);
begin
dn := dn + 1;
lstbxDrops.Items.Add(IntToStr(dn) + '. ' + edtAddDrop.text);
edtAddDrop.text := '';
end;
procedure QuickDrops(tob: TObject);
begin
case tob of
btnQuickDrops[0]: begin
if(trbCharmType[0].checked)then
begin
edtAddDrop.text := 'Gold Charm.';
AddDrop(tob);
end;
if(trbCharmType[1].checked)then
begin
edtAddDrop.text := 'Green Charm.';
AddDrop(tob);
end;
if(trbCharmType[2].checked)then
begin
edtAddDrop.text := 'Crimson Charm.';
AddDrop(tob);
end;
if(trbCharmType[3].checked)then
begin
edtAddDrop.text := 'Blue Charm.';
AddDrop(tob);
end;
end;
btnQuickDrops[1]: begin
edtAddDrop.text := 'Coins.';
AddDrop(tob);
end;

end;
end;
procedure InitForm;
begin
frmDropLog := CreateForm;
lstbxDrops := TListBox.create(frmDropLog);
edtAddDrop := TEdit.create(frmDropLog);
btnAddDrop := TButton.create(frmDropLog);
lblQuick := TLabel.create(frmDropLog);
for i := 0 to 1 do
btnQuickDrops[i] := TButton.create(frmDropLog);
for i := 0 to 3 do
trbCharmType[i] := TRadioButton.create(frmDropLog);
with frmDropLog do
begin
Position := PoScreenCenter;
Width := 300;
Height := 400;
Caption := 'Runescape Drop Log';
Color := 1549141;
Font.Color := clBlack;
end;
with lstbxDrops do
begin
Parent := frmDropLog;
Left := 150;
Top := 10;
Height := 350;
end;
with edtAddDrop do
begin
Parent := frmDropLog;
Left := 10;
Top := 10;
Width := 100;
end;
with btnAddDrop do
begin
Parent := frmDropLog;
Left := 10;
Top := 35;
Height := 20;
Width := 100;
Caption := 'Add Drop';
OnClick := @AddDrop;
end;
with lblQuick do
begin
Parent := frmDropLog;
Left := 10;
Top := 60;
Caption := 'Quick Drops:';
Font.Size := 12;
Font.Name := 'New Times Roman';
end;
QuickDropCaptions := ['Charm', 'Coins'];
for i := 0 to 1 do
begin
with btnQuickDrops[i] do
begin
Parent := frmDropLog;
Left := 10;
Height := 20;
Width := 100;
Top := 160 + (i * 25);
Caption := QuickDropCaptions[i];
OnClick := @QuickDrops;
end;
end;
CharmTypeCaptions := ['Gold', 'Green', 'Crimson', 'Blue'];
for i := 0 to 3 do
begin
with trbCharmType[i] do
begin
Parent := frmDropLog;
Top := 80 + i * 20;
Left := 10;
Caption := CharmTypeCaptions[i];
end;
end;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDropLog.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
end.

Camaro'

2009-10-19 20:16:46

From: All that is man
Just a simple form with a neat function….
….Yes, I play runescape legit….

Also does anyone know how I would go about clicking a button that would save it to a file? If that's possible.

{Runescape Drop Log by All that is man}

program FormDesign;
var
frmDropLog: Tform;
lstbxDrops: TListBox;
edtAddDrop: TEdit;
btnAddDrop: TButton;
btnQuickDrops: Array[0..1]of TButton;
trbCharmType: Array[0..3]of TRadioButton;
QuickDropCaptions, CharmTypeCaptions: TStringArray;
lblQuick: TLabel;
i, dn: integer;

procedure AddDrop(tob: TObject);
begin
dn := dn + 1;
lstbxDrops.Items.Add(IntToStr(dn) + '. ' + edtAddDrop.text);
edtAddDrop.text := '';
end;
procedure QuickDrops(tob: TObject);
begin
case tob of
btnQuickDrops[0]: begin
if(trbCharmType[0].checked)then
begin
edtAddDrop.text := 'Gold Charm.';
AddDrop(tob);
end;
if(trbCharmType[1].checked)then
begin
edtAddDrop.text := 'Green Charm.';
AddDrop(tob);
end;
if(trbCharmType[2].checked)then
begin
edtAddDrop.text := 'Crimson Charm.';
AddDrop(tob);
end;
if(trbCharmType[3].checked)then
begin
edtAddDrop.text := 'Blue Charm.';
AddDrop(tob);
end;
end;
btnQuickDrops[1]: begin
edtAddDrop.text := 'Coins.';
AddDrop(tob);
end;

end;
end;
procedure InitForm;
begin
frmDropLog := CreateForm;
lstbxDrops := TListBox.create(frmDropLog);
edtAddDrop := TEdit.create(frmDropLog);
btnAddDrop := TButton.create(frmDropLog);
lblQuick := TLabel.create(frmDropLog);
for i := 0 to 1 do
btnQuickDrops[i] := TButton.create(frmDropLog);
for i := 0 to 3 do
trbCharmType[i] := TRadioButton.create(frmDropLog);
with frmDropLog do
begin
Position := PoScreenCenter;
Width := 300;
Height := 400;
Caption := 'Runescape Drop Log';
Color := 1549141;
Font.Color := clBlack;
end;
with lstbxDrops do
begin
Parent := frmDropLog;
Left := 150;
Top := 10;
Height := 350;
end;
with edtAddDrop do
begin
Parent := frmDropLog;
Left := 10;
Top := 10;
Width := 100;
end;
with btnAddDrop do
begin
Parent := frmDropLog;
Left := 10;
Top := 35;
Height := 20;
Width := 100;
Caption := 'Add Drop';
OnClick := @AddDrop;
end;
with lblQuick do
begin
Parent := frmDropLog;
Left := 10;
Top := 60;
Caption := 'Quick Drops:';
Font.Size := 12;
Font.Name := 'New Times Roman';
end;
QuickDropCaptions := ['Charm', 'Coins'];
for i := 0 to 1 do
begin
with btnQuickDrops[i] do
begin
Parent := frmDropLog;
Left := 10;
Height := 20;
Width := 100;
Top := 160 + (i * 25);
Caption := QuickDropCaptions[i];
OnClick := @QuickDrops;
end;
end;
CharmTypeCaptions := ['Gold', 'Green', 'Crimson', 'Blue'];
for i := 0 to 3 do
begin
with trbCharmType[i] do
begin
Parent := frmDropLog;
Top := 80 + i * 20;
Left := 10;
Caption := CharmTypeCaptions[i];
end;
end;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDropLog.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
end.


Whats the object of this :)?

Awkwardsaw

2009-10-19 20:37:05

to log your drops you get from killing monsters legit :p

and to save it, let me whip up my procedure to save from my notepad :D

edit:

procedure SaveTehFile;
begin
SaveDialog1 := TSaveDialog.Create(nil);
SaveDialog1.InitialDir := AppPath;
SaveDialog1.Filter := 'Text Documents (*.txt)|*.txt|' +
'All Files|*|';
if SaveDialog1.Execute then
savetoFile(Memo1, Savedialog1.FileName);
SaveDialog1.Free;
end;

Memo1 is the part where the text is, every thing else should be self explanitory, just make a button and a pointer to that proc when clicked, and a save dialog will(should) appear

YoHoJo

2009-10-19 20:39:27

Itd be cool if you could tell it amount of stacked items dropped, so you know how many coins/charms/feathers/stackable times you got :D. Neato idea I guess. The form is cool.

All that is man

2009-10-19 21:08:23

Hmm i might add something like that YoHoJo, also if possible could you move this? Cause I put it here by accident lol its kinda rs - related

Beav

2009-10-26 22:57:36

Very nice, I have always thought something like this would be great.