SCAR Code:
// README!
//------------------------------------------------------------------------------
// Hylian Loach's AutoMiner. Mines the Ores, drops them when inventory is full
// Working on banking
//
// VERSION Alpha
// - Alpha version
//
// TODO
// - Banking abilities
// - Everything
//------------------------------------------------------------------------------
//
//--- HOW TO SETUP ---
// Read the below, then run the script. No script editing is required.
//
//--- ORE CODE LIST ---
// Remember to set the Ore to mine for each character!
// Here is a list of all the Ore codes
// (type in lowercase, seperated by a comma):
// cu pb fe ag c
// au mith addy rune
//
// Where:
// cu - Copper
// pb - Tin
// fe - Iron
// ag - Silver
// c - Coal
// au - Gold
// mith - Mithril
// addy - Adamantite
// rune - Runite
//
// Use the codes like this:
// c,mith,addy,rune - This mines Coal, Mithril, Addy and Rune
// cu,pb,fe - This mines Copper, Tin, and Iron
// fe,c - This mines Iron and Coal
// Or whatever combination you want
//
//--- LOCATION CODE LIST ---
// To be done
program name;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/Users.scar}
{.include SRL/SRL/skill/Mining.scar}
var
// RSconfigForm
RSconfigForm : TForm;
ProgNameLabel : TLabel;
SectionLabel : TLabel;
WorldLabel : TLabel;
WorldNoEdit : TEdit;
useSignedCheck : TCheckBox;
useHighQualityCheck : TCheckBox;
startRSButton : TButton;
// ScriptconfigForm
ScriptconfigForm : TForm;
prognamelabel2 : TLabel;
Section2Label : TLabel;
SRLIDLabel : TLabel;
SRLPassLabel : TLabel;
CuLabel : TLabel;
PbLabel : TLabel;
FeLabel : TLabel;
AgLabel : TLabel;
CLabel : TLabel;
AuLabel : TLabel;
MithLabel : TLabel;
AddyLabel : TLabel;
RuneLabel : TLabel;
gbColors : TGroupBox;
gbSRLID : TGroupBox;
SRLIDEdit : TEdit;
SRLPassEdit : TEdit;
CuEdit : TEdit;
PbEdit : TEdit;
FeEdit : TEdit;
AgEdit : TEdit;
CEdit : TEdit;
AuEdit : TEdit;
MithEdit : TEdit;
AddyEdit : TEdit;
RuneEdit : TEdit;
scriptconfigButton : TButton;
// HL AutoMiner
initialized: boolean;
CuColor, PbColor, FeColor, AgColor, CColor, AuColor, MithColor, AddyColor, RuneColor: integer;
procedure DeclarePlayers;
begin
// We are using the player form
SRLPlayerForm(true, [], ['Location'], ['OresToMine'], []);
CheckUserNicks;
end;
procedure AutoChat;
var
saidname: boolean;
begin
// Automatically say stuff
// This isn't foolproof
if FindBlackChatMessage(Players[CurrentPlayer].Nick) then saidname := true;
// This calls the function if they said our name, or a 10% chance.
if saidname or (Random(100)<10) then
begin
// Oh my god, somebody said our name (or part of our name)
// Let's see...
// Is someone asking us for our level?
if ((FindBlackChatMessage('level?') or FindBlackChatMessage('lv?')) and FindBlackChatMessage('what')) or
(FindBlackChatMessage('your') and (FindBlackChatMessage('level?') or FindBlackChatMessage('lv?')) or
FindBlackChatMessage('levels?') or FindBlackChatMessage('lvl?') or FindBlackChatMessage('lv?'))
then
begin
case Random(2) of
0: SayCurrentLevels('mining');
1:
begin
TypeSend('checking');
wait(5000+Random(1000));
SayCurrentLevels('mining');
end;
end;
end;
// Are they laughing at an apparent joke (only 'serious' laughing)
if ((FindBlackChatMessage('omg') and FindBlackChatMessage('lol')) or
FindBlackChatMessage('rofl') or
(FindBlackChatMessage('haha') and FindBlackChatMessage('lol')) or
FindBlackChatMessage('heh') or
FindBlackChatMessage('lmao') or FindBlackChatMessage('lmfao') or
(FindBlackChatMessage('haha') and (FindBlackChatMessage('omg') or FindBlackChatMessage('rofl'))) or
(FindBlackChatMessage('lol') and FindBlackChatMessage('funny')))
then
begin
case Random(3) of
0: TypeSend('heh');
1: TypeSend('lol');
2: TypeSend('haha');
end;
end;
// Are they swearing?
if (FindBlackChatMessage('***') or FindBlackChatMessage('4uck'))
then
begin
case Random(50) of
0: TypeSend(':O');
1: TypeSend('*****?');
2: TypeSend(':/');
3: TypeSend('nuh uh');
4: TypeSend('reported');
5: TypeSend('omg');
6: TypeSend('reportd...');
7: TypeSend('...');
8: TypeSend('stars');
9: TypeSend('heh');
10: TypeSend('lol');
11: TypeSend('typo?');
12: TypeSend('hate the censor');
end;
end;
// Are they complementing us?
if saidname and (
FindBlackChatMessage('grats') or FindBlackChatMessage('nice') or
FindBlackChatMessage('wow'))
then
begin
case Random(5) of
0: TypeSend('ty');
1: TypeSend('thanks');
2: TypeSend(':)');
end;
end;
// Are they accusing us of autoing :(
// We need to set more replies! Somebody has caught onto us.
if saidname and (
FindBlackChatMessage('autoing') or FindBlackChatMessage('botting') or
FindBlackChatMessage('macroing') or FindBlackChatMessage('hacking') or
FindBlackChatMessage('autoer') or FindBlackChatMessage('botter') or
FindBlackChatMessage('macroer') or FindBlackChatMessage('hacker'))
then
begin
case Random(15) of
0:
begin
TypeSend('huh?');
Wait(5000+Random(1000));
TypeSend('why would i?');
end;
1: TypeSend('uhh no');
2: TypeSend(':(');
3: TypeSend('mmnn...');
4:
begin
case Random(5) of
0: TypeSend('um');
1: TypeSend('orly');
2: TypeSend('oi');
3: TypeSend('lol');
end;
wait(1000+Random(1000));
case Random(5) of
0: TypeSend('listen');
1: TypeSend('heres a song');
2: TypeSend('s.i.n.g.i.n.g. time!');
3: TypeSend('noob');
end;
wait(5000+Random(2000));
case Random(2) of
0: TypeSend('were no strangers to love');
end;
wait(3000+Random(1000));
TypeSend('asdfg');
end;
5:
begin
TypeSend('ok');
wait(1000+Random(1000));
TypeSend('whatever');
end;
6:
begin
case Random(3) of
0: TypeSend('hrm');
1: TypeSend('uh');
2: TypeSend('no.');
end;
Wait(1000+Random(20000));
case Random(5) of
0: TypeSend('bbqsauce?');
1: TypeSend('spartaaaa');
2: TypeSend('you dont make sense');
3: TypeSend('how about no');
end;
Wait(1000+Random(5000));
TypeSend('lol');
end;
7: TypeSend('noob');
8: TypeSend('your strange');
9: TypeSend('your very strange');
10: begin
case Random(3) of
0: TypeSend('tomato pie yes?');
1: TypeSend('potato pie yes?');
2: TypeSend('i like pies too');
end;
Random(3000+Random(1000));
case Random(5) of
0: TypeSend('what i just said is as random as you');
1: TypeSend('that was random as you');
2: TypeSend('random pies etc');
3: TypeSend('hackers are noob as pie');
4: TypeSend('ur wrong');
end;
end;
11: TypeSend('wrong');
12: TypeSend('no comment');
end;
end;
// Insulting us or someone else
if FindBlackChatMessage('noob') or FindBlackChatMessage('nub') or
FindBlackChatMessage('nooby') or FindBlackChatMessage('lamer') or
FindBlackChatMessage('idiot') or FindBlackChatMessage('jerk')
then
begin
case Random(10) of
0: TypeSend('oh hey');
1: TypeSend(':(');
2: TypeSend('you too');
3: TypeSend('thanks');
4: TypeSend('no problem');
5: TypeSend('whatever');
6: TypeSend('i love you too');
end;
end;
// Saying hi to us or someone else
if FindBlackChatMessage('hello') or FindBlackChatMessage('hi') or
FindBlackChatMessage('hey') or FindBlackChatMessage('sup')
then
begin
case Random(15) of
0: TypeSend('hi');
1: TypeSend('hello');
2: TypeSend('hey');
3: TypeSend('sup');
4: TypeSend('hum sup lo');
5: TypeSend('ello');
6: TypeSend('yo');
7: TypeSend('how are ya');
end;
end;
end else
begin
// Say random irrelevant crap
wait(Random(5000));
// Approximately 1% chance to say something random
// This is to prevent getting attention to ourselves, while maintaining
// a real person's chat skills
case Random(2000) of
0: TypeSend('testing');
1: TypeSend('lol');
2: TypeSend('asdf');
3: TypeSend('qwerty');
4: TypeSend('spam');
5: TypeSend('oops');
6: TypeSend('?');
7: TypeSend('!');
8: TypeSend('test');
9: TypeSend('testing');
10: TypeSend('blah');
11: TypeSend('omg');
12: TypeSend('wtf');
13: TypeSend('brb');
14: TypeSend('brb sec');
15: TypeSend('mmm');
end;
// Are they complimenting someone
if FindBlackChatMessage('grats') or FindBlackChatMessage('nice') or
FindBlackChatMessage('good work') or FindBlackChatMessage('great work')
then
begin
case Random(10) of
0: TypeSend('grats');
1: TypeSend('congrats');
2: TypeSend('gw');
3: TypeSend('wow');
end;
end;
// Talking about hackers
if FindBlackChatMessage('bot') or FindBlackChatMessage('hacker') or
FindBlackChatMessage('autoer') or FindBlackChatMessage('macro')
then
begin
case Random(20) of
0: TypeSend('i hate people who cheat');
1: TypeSend('seen any?');
2: TypeSend('seen some?');
3: TypeSend('i think i saw one some time ago');
4: TypeSend('jagex is better than cheaters');
5: TypeSend('ban all cheats');
6: TypeSend('all cheats shud be banned');
7: TypeSend('whats that');
8: TypeSend('ooo');
9: TypeSend('dam this game still has em?');
10: TypeSend('i dont think ive seen any');
end;
end;
end;
saidname := false;
end;
procedure AntiRandoms;
begin
If (FindFight) then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('mining');
AutoChat;
end;
procedure AntiBan;
begin
If not(LoggedIn) then
NextPlayer(false);
Case Random(15) of
1: RandomRClick;
2: HoverSkill('Mining',false);
3: PickUpMouse;
4: AlmostLogout;
5: RandomMovement;
6: BoredHuman;
7: DoEmote(RandomRange(1,37));
8: GetAllLevels;
9: ExistsItem(RandomRange(1,28));
10: GameTab(RandomRange(1,10));
end;
end;
procedure Initialize(sender: TObject);
var
World: integer;
Signed, hiQuality: boolean;
begin
// Clear the debug and report screens
ClearDebug;
ClearReport;
// Take stuff from form and shove into variables
World := strtoint(WorldNoEdit.text);
if(useHighQualityCheck.Checked) then
begin
hiQuality := true;
end else
begin
hiQuality := false;
end;
if(useSignedCheck.Checked) then
begin
Signed := true;
end else
begin
Signed := false;
end;
// Close the form
RSconfigForm.ModalResult := mrOk;
// Launch S.M.A.R.T.
SmartSetupEx(World, hiQuality, Signed);
while not(SmartReady)
do wait(100);
SetTargetDC(SmartGetDC);
SetupSRL;
SetupMining;
DeclarePlayers;
// Initialization complete
initialized := true;
end;
procedure ScriptConfigure(sender: TObject);
begin
// Take stuff from form and place into global variables
SRLID := SRLIDEdit.Text;
SRLPassword := SRLPassEdit.Text;
CuColor := strtoint(CuEdit.Text);
PbColor := strtoint(PbEdit.Text);
FeColor := strtoint(FeEdit.Text);
AgColor := strtoint(AgEdit.Text);
CColor := strtoint(CEdit.Text);
AuColor := strtoint(AuEdit.Text);
MithColor := strtoint(MithEdit.Text);
AddyColor := strtoint(AddyEdit.Text);
RuneColor := strtoint(RuneEdit.Text);
ScriptconfigForm.ModalResult := mrOk;
// Save to an INI
WriteINI('SRLID','SRLID',SRLIDEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('SRLID','SRLPassword',SRLPassEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Cu',CuEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Pb',PbEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Fe',FeEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Ag',AgEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','C',CEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Au',AuEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Mith',MithEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Addy',AddyEdit.Text,ScriptPath+'\HLMiner.ini');
WriteINI('Miner','Rune',RuneEdit.Text,ScriptPath+'\HLMiner.ini');
end;
procedure ScriptConfigure_form;
begin
ScriptconfigForm := CreateForm;
ScriptconfigForm.Left := 254;
ScriptconfigForm.Top := 95;
ScriptconfigForm.BorderStyle := bsDialog;
ScriptconfigForm.Caption := 'Script Configuration';
ScriptconfigForm.ClientHeight := 499;
ScriptconfigForm.ClientWidth := 275;
ScriptconfigForm.Color := clBtnFace;
ScriptconfigForm.Font.Color := clWindowText;
ScriptconfigForm.Font.Height := -13;
ScriptconfigForm.Font.Name := 'Arial';
ScriptconfigForm.Font.Style := [];
ScriptconfigForm.Visible := False;
ScriptconfigForm.PixelsPerInch := 96;
prognamelabel2 := TLabel.Create(ScriptconfigForm);
prognamelabel2.Parent := ScriptconfigForm;
prognamelabel2.Left := 8;
prognamelabel2.Top := 8;
prognamelabel2.Width := 176;
prognamelabel2.Height := 33;
prognamelabel2.Caption := 'HL AutoMiner';
prognamelabel2.Font.Color := clWindowText;
prognamelabel2.Font.Height := -29;
prognamelabel2.Font.Name := 'Arial';
prognamelabel2.Font.Style := [];
prognamelabel2.ParentFont := False;
Section2Label := TLabel.Create(ScriptconfigForm);
Section2Label.Parent := ScriptconfigForm;
Section2Label.Left := 24;
Section2Label.Top := 48;
Section2Label.Width := 140;
Section2Label.Height := 20;
Section2Label.Caption := 'Script Configuration';
Section2Label.Font.Color := clWindowText;
Section2Label.Font.Height := -16;
Section2Label.Font.Name := 'MS Sans Serif';
Section2Label.Font.Style := [];
Section2Label.ParentFont := False;
SRLIDLabel := TLabel.Create(ScriptconfigForm);
SRLIDLabel.Parent := ScriptconfigForm;
SRLIDLabel.Left := 24;
SRLIDLabel.Top := 104;
SRLIDLabel.Width := 45;
SRLIDLabel.Height := 16;
SRLIDLabel.Caption := 'SRL ID:';
SRLIDLabel.Font.Color := clWindowText;
SRLIDLabel.Font.Height := -13;
SRLIDLabel.Font.Name := 'Arial';
SRLIDLabel.Font.Style := [];
SRLIDLabel.ParentFont := False;
SRLPassLabel := TLabel.Create(ScriptconfigForm);
SRLPassLabel.Parent := ScriptconfigForm;
SRLPassLabel.Left := 24;
SRLPassLabel.Top := 128;
SRLPassLabel.Width := 92;
SRLPassLabel.Height := 16;
SRLPassLabel.Caption := 'SRD Password:';
SRLPassLabel.Font.Color := clWindowText;
SRLPassLabel.Font.Height := -13;
SRLPassLabel.Font.Name := 'Arial';
SRLPassLabel.Font.Style := [];
SRLPassLabel.ParentFont := False;
CuLabel := TLabel.Create(ScriptconfigForm);
CuLabel.Parent := ScriptconfigForm;
CuLabel.Left := 24;
CuLabel.Top := 192;
CuLabel.Width := 45;
CuLabel.Height := 16;
CuLabel.Caption := 'Copper:';
PbLabel := TLabel.Create(ScriptconfigForm);
PbLabel.Parent := ScriptconfigForm;
PbLabel.Left := 24;
PbLabel.Top := 216;
PbLabel.Width := 21;
PbLabel.Height := 16;
PbLabel.Caption := 'Tin:';
FeLabel := TLabel.Create(ScriptconfigForm);
FeLabel.Parent := ScriptconfigForm;
FeLabel.Left := 24;
FeLabel.Top := 240;
FeLabel.Width := 25;
FeLabel.Height := 16;
FeLabel.Caption := 'Iron:';
AgLabel := TLabel.Create(ScriptconfigForm);
AgLabel.Parent := ScriptconfigForm;
AgLabel.Left := 24;
AgLabel.Top := 264;
AgLabel.Width := 35;
AgLabel.Height := 16;
AgLabel.Caption := 'Silver:';
CLabel := TLabel.Create(ScriptconfigForm);
CLabel.Parent := ScriptconfigForm;
CLabel.Left := 24;
CLabel.Top := 288;
CLabel.Width := 30;
CLabel.Height := 16;
CLabel.Caption := 'Coal:';
AuLabel := TLabel.Create(ScriptconfigForm);
AuLabel.Parent := ScriptconfigForm;
AuLabel.Left := 24;
AuLabel.Top := 312;
AuLabel.Width := 31;
AuLabel.Height := 16;
AuLabel.Caption := 'Gold:';
MithLabel := TLabel.Create(ScriptconfigForm);
MithLabel.Parent := ScriptconfigForm;
MithLabel.Left := 24;
MithLabel.Top := 336;
MithLabel.Width := 39;
MithLabel.Height := 16;
MithLabel.Caption := 'Mithril:';
AddyLabel := TLabel.Create(ScriptconfigForm);
AddyLabel.Parent := ScriptconfigForm;
AddyLabel.Left := 24;
AddyLabel.Top := 360;
AddyLabel.Width := 70;
AddyLabel.Height := 16;
AddyLabel.Caption := 'Adamantite:';
RuneLabel := TLabel.Create(ScriptconfigForm);
RuneLabel.Parent := ScriptconfigForm;
RuneLabel.Left := 24;
RuneLabel.Top := 384;
RuneLabel.Width := 41;
RuneLabel.Height := 16;
RuneLabel.Caption := 'Runite:';
gbColors := TGroupBox.Create(ScriptconfigForm);
gbColors.Parent := ScriptconfigForm;
gbColors.Left := 8;
gbColors.Top := 168;
gbColors.Width := 257;
gbColors.Height := 249;
gbColors.Caption := 'Ore Colors';
gbColors.TabOrder := 10;
gbSRLID := TGroupBox.Create(ScriptconfigForm);
gbSRLID.Parent := ScriptconfigForm;
gbSRLID.Left := 8;
gbSRLID.Top := 80;
gbSRLID.Width := 257;
gbSRLID.Height := 81;
gbSRLID.Caption := 'SRL ID Configuration';
gbSRLID.TabOrder := 11;
SRLIDEdit := TEdit.Create(ScriptconfigForm);
SRLIDEdit.Parent := ScriptconfigForm;
SRLIDEdit.Left := 128;
SRLIDEdit.Top := 104;
SRLIDEdit.Width := 121;
SRLIDEdit.Height := 24;
SRLIDEdit.TabOrder := 8;
SRLIDEdit.Text := '1234';
SRLPassEdit := TEdit.Create(ScriptconfigForm);
SRLPassEdit.Parent := ScriptconfigForm;
SRLPassEdit.Left := 128;
SRLPassEdit.Top := 128;
SRLPassEdit.Width := 121;
SRLPassEdit.Height := 24;
SRLPassEdit.PasswordChar := '*';
SRLPassEdit.TabOrder := 9;
SRLPassEdit.Text := 'abcdef';
CuEdit := TEdit.Create(ScriptconfigForm);
CuEdit.Parent := ScriptconfigForm;
CuEdit.Left := 128;
CuEdit.Top := 192;
CuEdit.Width := 121;
CuEdit.Height := 24;
CuEdit.TabOrder := 12;
CuEdit.Text := '4483473';
PbEdit := TEdit.Create(ScriptconfigForm);
PbEdit.Parent := ScriptconfigForm;
PbEdit.Left := 128;
PbEdit.Top := 216;
PbEdit.Width := 121;
PbEdit.Height := 24;
PbEdit.TabOrder := 13;
PbEdit.Text := '9868961';
FeEdit := TEdit.Create(ScriptconfigForm);
FeEdit.Parent := ScriptconfigForm;
FeEdit.Left := 128;
FeEdit.Top := 240;
FeEdit.Width := 121;
FeEdit.Height := 24;
FeEdit.TabOrder := 14;
FeEdit.Text := '2832732';
AgEdit := TEdit.Create(ScriptconfigForm);
AgEdit.Parent := ScriptconfigForm;
AgEdit.Left := 128;
AgEdit.Top := 264;
AgEdit.Width := 121;
AgEdit.Height := 24;
AgEdit.TabOrder := 15;
AgEdit.Text := '9737893';
CEdit := TEdit.Create(ScriptconfigForm);
CEdit.Parent := ScriptconfigForm;
CEdit.Left := 128;
CEdit.Top := 288;
CEdit.Width := 121;
CEdit.Height := 24;
CEdit.TabOrder := 16;
CEdit.Text := '2702653';
AuEdit := TEdit.Create(ScriptconfigForm);
AuEdit.Parent := ScriptconfigForm;
AuEdit.Left := 128;
AuEdit.Top := 312;
AuEdit.Width := 121;
AuEdit.Height := 24;
AuEdit.TabOrder := 17;
AuEdit.Text := '4367286';
MithEdit := TEdit.Create(ScriptconfigForm);
MithEdit.Parent := ScriptconfigForm;
MithEdit.Left := 128;
MithEdit.Top := 336;
MithEdit.Width := 121;
MithEdit.Height := 24;
MithEdit.TabOrder := 18;
MithEdit.Text := '6899783';
AddyEdit := TEdit.Create(ScriptconfigForm);
AddyEdit.Parent := ScriptconfigForm;
AddyEdit.Left := 128;
AddyEdit.Top := 360;
AddyEdit.Width := 121;
AddyEdit.Height := 24;
AddyEdit.TabOrder := 19;
AddyEdit.Text := '4873546';
RuneEdit := TEdit.Create(ScriptconfigForm);
RuneEdit.Parent := ScriptconfigForm;
RuneEdit.Left := 128;
RuneEdit.Top := 384;
RuneEdit.Width := 121;
RuneEdit.Height := 24;
RuneEdit.TabOrder := 20;
RuneEdit.Text := '8288335';
scriptconfigButton := TButton.Create(ScriptconfigForm);
scriptconfigButton.Parent := ScriptconfigForm;
scriptconfigButton.Left := 8;
scriptconfigButton.Top := 424;
scriptconfigButton.Width := 257;
scriptconfigButton.Height := 65;
scriptconfigButton.Caption := 'Save Settings';
scriptconfigButton.Font.Color := clWindowText;
scriptconfigButton.Font.Height := -21;
scriptconfigButton.Font.Name := 'Arial';
scriptconfigButton.Font.Style := [];
scriptconfigButton.ParentFont := False;
scriptconfigButton.TabOrder := 21;
scriptconfigButton.OnClick := @ScriptConfigure;
// Read from the INI file if it exists
if FileExists(ScriptPath+'\HLMiner.ini') then
begin
SRLIDEdit.Text := ReadINI('SRLID','SRLID',ScriptPath+'\HLMiner.ini');
SRLPassEdit.Text := ReadINI('SRLID','SRLPassword',ScriptPath+'\HLMiner.ini');
CuEdit.Text := ReadINI('Miner','Cu',ScriptPath+'\HLMiner.ini');
PbEdit.Text := ReadINI('Miner','Pb',ScriptPath+'\HLMiner.ini');
FeEdit.Text := ReadINI('Miner','Fe',ScriptPath+'\HLMiner.ini');
AgEdit.Text := ReadINI('Miner','Ag',ScriptPath+'\HLMiner.ini');
CEdit.Text := ReadINI('Miner','C',ScriptPath+'\HLMiner.ini');
AuEdit.Text := ReadINI('Miner','Au',ScriptPath+'\HLMiner.ini');
MithEdit.Text := ReadINI('Miner','Mith',ScriptPath+'\HLMiner.ini');
AddyEdit.Text := ReadINI('Miner','Addy',ScriptPath+'\HLMiner.ini');
RuneEdit.Text := ReadINI('Miner','Rune',ScriptPath+'\HLMiner.ini');
end;
end;
procedure RSOptionSelect_form;
begin
// Show a form for World/Signed/Detail selection.
RSconfigForm := CreateForm;
RSconfigForm.Left := 250;
RSconfigForm.Top := 114;
RSconfigForm.BorderStyle := bsDialog;
RSconfigForm.Caption := 'Runescape Configuration';
RSconfigForm.ClientHeight := 215;
RSconfigForm.ClientWidth := 285;
RSconfigForm.Color := clBtnFace;
RSconfigForm.Font.Color := clBlack;
RSconfigForm.Font.Height := -29;
RSconfigForm.Font.Name := 'Arial';
RSconfigForm.Font.Style := [];
RSconfigForm.Visible := False;
RSconfigForm.PixelsPerInch := 96;
RSconfigForm.hint := 'Configuration to run SMART on. Enter your details and press the button.';
ProgNameLabel := TLabel.Create(RSconfigForm);
ProgNameLabel.Parent := RSconfigForm;
ProgNameLabel.Left := 8;
ProgNameLabel.Top := 8;
ProgNameLabel.Width := 269;
ProgNameLabel.Height := 33;
ProgNameLabel.Caption := 'HL AutoMiner';
SectionLabel := TLabel.Create(RSconfigForm);
SectionLabel.Parent := RSconfigForm;
SectionLabel.Left := 8;
SectionLabel.Top := 48;
SectionLabel.Width := 176;
SectionLabel.Height := 18;
SectionLabel.Caption := 'Runescape Configuration';
SectionLabel.Font.Color := clBlack;
SectionLabel.Font.Height := -16;
SectionLabel.Font.Name := 'Arial';
SectionLabel.Font.Style := [];
SectionLabel.ParentFont := False;
WorldLabel := TLabel.Create(RSconfigForm);
WorldLabel.Parent := RSconfigForm;
WorldLabel.Left := 8;
WorldLabel.Top := 80;
WorldLabel.Width := 144;
WorldLabel.Height := 16;
WorldLabel.Caption := 'Enter the World Number:';
WorldLabel.Font.Color := clBlack;
WorldLabel.Font.Height := -13;
WorldLabel.Font.Name := 'Arial';
WorldLabel.Font.Style := [];
WorldLabel.ParentFont := False;
WorldNoEdit := TEdit.Create(RSconfigForm);
WorldNoEdit.Parent := RSconfigForm;
WorldNoEdit.Left := 160;
WorldNoEdit.Top := 80;
WorldNoEdit.Width := 65;
WorldNoEdit.Height := 17;
WorldNoEdit.Hint := 'Enter the world number';
WorldNoEdit.Font.Color := clBlack;
WorldNoEdit.Font.Height := -13;
WorldNoEdit.Font.Name := 'Arial';
WorldNoEdit.Font.Style := [];
WorldNoEdit.MaxLength := 3;
WorldNoEdit.ParentFont := False;
WorldNoEdit.TabOrder := 8;
WorldNoEdit.Text := '16';
useSignedCheck := TCheckBox.Create(RSconfigForm);
useSignedCheck.Parent := RSconfigForm;
useSignedCheck.Left := 8;
useSignedCheck.Top := 104;
useSignedCheck.Width := 265;
useSignedCheck.Height := 17;
useSignedCheck.Caption := 'Use Signed Applet';
useSignedCheck.Checked := True;
useSignedCheck.Font.Color := clBlack;
useSignedCheck.Font.Height := -13;
useSignedCheck.Font.Name := 'Arial';
useSignedCheck.Font.Style := [];
useSignedCheck.ParentFont := False;
useSignedCheck.State := cbChecked;
useSignedCheck.TabOrder := 9;
useHighQualityCheck := TCheckBox.Create(RSconfigForm);
useHighQualityCheck.Parent := RSconfigForm;
useHighQualityCheck.Left := 8;
useHighQualityCheck.Top := 128;
useHighQualityCheck.Width := 265;
useHighQualityCheck.Height := 17;
useHighQualityCheck.Caption := 'High Quality';
useHighQualityCheck.Checked := True;
useHighQualityCheck.Font.Color := clBlack;
useHighQualityCheck.Font.Height := -13;
useHighQualityCheck.Font.Name := 'Arial';
useHighQualityCheck.Font.Style := [];
useHighQualityCheck.ParentFont := False;
useHighQualityCheck.State := cbChecked;
useHighQualityCheck.TabOrder := 10;
startRSButton := TButton.Create(RSconfigForm);
startRSButton.Parent := RSconfigForm;
startRSButton.Left := 16;
startRSButton.Top := 160;
startRSButton.Width := 249;
startRSButton.Height := 33;
startRSButton.Caption := 'Start Runescape';
startRSButton.Font.Color := clBlack;
startRSButton.Font.Height := -24;
startRSButton.Font.Name := 'Arial';
startRSButton.Font.Style := [];
startRSButton.ParentFont := False;
startRSButton.TabOrder := 11;
startRSButton.OnClick := @Initialize;
end;
// Thanks to the various form tutorials
procedure RSconfigForm_Modal;
begin
RSconfigForm.ShowModal;
end;
procedure ScriptconfigForm_Modal;
begin
ScriptconfigForm.ShowModal;
end;
procedure SafeInitForm(proc:string);
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall(proc, v);
end;
procedure SafeShowFormModal(form_modal:string);
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall(form_modal, v);
end;
procedure SetupAccount;
begin
LoginPlayer;
If Not (LoggedIn) then wait(100);
SetChat('on',1);
SetChat('on',2);
SetChat('off',3);
SetChat('off',4);
SetRun(true);
SetAngle(true);
MakeCompass('N');
GetAllLevels;
end;
begin
initialized := false;
// Load script configuration
SafeInitForm('ScriptConfigure_form');
SafeShowFormModal('ScriptconfigForm_Modal');
// Get worlds and stuff
SafeInitForm('RSOptionSelect_form');
SafeShowFormModal('RSconfigForm_Modal');
// Check if initialization has finished
if not(initialized) then wait(100);
SetupAccount;
end.