Doesn't look bad, only you have to be logged in when it starts…
Why don't you use SRL's DeclarePlayers?
Btw, the
tags mess with standards ;_;
[scar]
{
___ ___ ___ ___ _____ _____ ___ ___
| | | | | | | | | | | | | | |\ | | | |
|___| | | | | | |___ |___| | | | | | \ | |___ |___|
| | | | | | | | \ | | | | | \ | | | \
| |___| |__|__| |___ | \ | | | __|__ | \| |___ | \
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|| ||
|| How do I stop the script? ||
|| Instead of pressing Ctrl + Alt + S, use F9. ||
|| ||
|| What does this do? ||
|| This script mines all quick spawn ores. ||
|| ||
|| Will I get caught or banned? ||
|| Most likely not as there are good Anti Bans and Anti Randoms. ||
|| ||
|| Where should I use this script? ||
|| Al Kharid has all of the ore that this script has. ||
|| ||
|| How do I set the script up? ||
|| Scroll down and then fill in the empty spaces. ||
|| ||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}
Program PowerMiner;
{.include SRL/SRL.Scar}
Var
X, Y, I : Integer;
RockColor : Array [0..2] Of Integer;
Procedure DeclarePlayers;
Begin
CurrentPlayer := 0; // Starting player
HowManyPlayers := 1; // How many players in total?
NumberOfPlayers(HowManyPlayers);
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // Nickname, 3 - 4 letters of username
Players[0].Active := True; // Use this player?
Players[0].BoxRewards := ['XP', 'xp']; // Reward box reward uptext (default = lamp)
Players[0].Integers[0] := 0; // How many rocks to mine
Players[0].Strings[0] := 'iron'; // What rock to mine (copper, tin, iron, coal)
Players[0].Booleans[0] := True; // Pickaxe equipped?
End;
Procedure DeclareColors;
Begin
Case Capitalize(Players[CurrentPlayer].Strings[0]) Of
'Copper': Begin
RockColor[0] := 4813728
RockColor[1] := 4351888
RockColor[2] := 4154250
End;
'Tin': Begin
RockColor[0] := 9539996
RockColor[1] := 9737632
RockColor[2] := 9342617
End;
'Iron': Begin
RockColor[0] := 2964578
RockColor[1] := 2371919
RockColor[2] := 2832991
End;
'Coal': Begin
RockColor[0] := 2241331
RockColor[1] := 2834239
RockColor[2] := 2636603
End;
End;
End;
Procedure AntiBan;
Var
RCompass : TStringArray;
Begin
LampSkill := 'Mining';
FindNormalRandoms;
RCompass := ['E', 'S', 'W'];
MakeCompass(RCompass);
Wait(2500 + Random(1000));
MakeCompass('N');
Case Random(25) Of
0: BoredHuman;
1: RandomMovement;
2: PickUpMouse;
3: HoverSkill('Mining', False);
4: MMouse(Random(X), Random(Y), 0, 0);
5: TypeSend('Mining Levels?');
End;
End;
Procedure MineRock;
Var
Inv1, Inv2 : Integer;
Begin
AntiBan;
If FindObj(x, y, 'ine', RockColor[I], 10) Then
Begin
Inv1 := InvCount;
Inv2 := Inv1;
Mouse(x, y, 6, 6, False);
ChooseOption('ine');
While Inv1 < Inv2 Do
Begin
Wait(50 + Random(50));
Inv2 := InvCount;
End;
Inc(Players[CurrentPlayer].Integers[1]);
End;
End;
Procedure DropRock;
Begin
Case Players[CurrentPlayer].Booleans[0] Of
True : Begin
For I := 1 To 28 Do
DropItem(I);
End;
False : Begin
For I := 4 To 28 Do
DropItem(I);
End;
End;
End;
Procedure ProgressReport;
Begin
WriteLn('|||||||||||||||||||||||||||||||||||');
WriteLn('|| Power Miner ||');
WriteLn('|||||||||||||||||||||||||||||||||||');
WriteLn('Time Running: ' + TimeRunning);
WriteLn('Rocks Mined: ' + IntToStr(Players[CurrentPlayer].Integers[1]));
WriteLn('|||||||||||||||||||||||||||||||||||');
WriteLn('|| Created By: Devoker ||');
WriteLn('|||||||||||||||||||||||||||||||||||');
End;
Procedure MainLoop;
Begin
Wait(1000 + Random(500));
SetAngle(True);
MakeCompass('N');
If InvFull Then
DropRock
Else
MineRock;
End;
Begin
SetupSRL;
DeclareColors;
DeclarePlayers;
ActivateClient;
If Not LoggedIn Then
LoginPlayer;
Repeat
MainLoop;
Until(IsFKeyDown(9) or (Players[CurrentPlayer].Integers[1] >= Players[CurrentPlayer].Integers[0]));
ProgressReport;
End.
I changed quite a lot, some standards but also some scripting stuff, and I added DeclarePlayers.
I made your MineRock procedure to this:
Procedure MineRock;
Var
Inv1, Inv2 : Integer;
Begin
AntiBan;
If FindObj(x, y, 'ine', RockColor[I], 10) Then
Begin
Inv1 := InvCount; //Get the current inv count (e.x: 5)
Inv2 := Inv1; //Is now also 5
Mouse(x, y, 6, 6, False);
ChooseOption('ine'); //Begin mining...
While Inv1 < Inv2 Do //When you start mining, they are both 5.
Begin
Wait(50 + Random(50));
Inv2 := InvCount; //Gets the InvCount again, if this is MORE than the variable we took BEFORE mining (Inv1), we know we gained 1 ore!
End;
Inc(Players[CurrentPlayer].Integers[1]); //Replaced 'M' with this.
End;
End;