SRL Archive - First Scripts

My Simple PowerMiner


Shockwave

2007-04-22 16:50:30

This is my first script so dont expect anything special
here it is and please comment on it


//This is my 1st script and is just simple power miner
//set yourself by some rock you wish to mine,drag the hair across & hit play
//Enjoy :D
program Shockwaves_Power_Miner;
{.include srl/srl.scar}
{.include srl/srl/skill/mining.scar}
var
Runs: Integer;
Loads: Integer;

const
Rockcolor = 2503507; //Color of the rock you wish to mine

Procedure Declare_Players;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;

Players[0].Name := 'Username'; //UserName
Players[0].Pass := 'Password'; //Password
Players[0].Nick := 'Nick'; //2-4 letters of username
Players[0].Active := true;
end;

Procedure Login;
begin
if(not(LoggedIn))then
LoginPlayer
end;

Procedure Check_Randoms;
var
i: Integer;
begin
for i := 1 to 16 do
begin
case I of
1: CloseWindow;
2: if FindTalk then
Result := True;
3: if FindDead then
Result := True;
4: if FindMod then
Result := True;
5: if FindMime then
Result := True;
6: if FindMaze then
Result := True;
7: if FindQuiz then
Result := True;
8: if FindDemon then
Result := True;
9: if FindScapeRune then
Result := True;
10: if FindTalk then
Result := True;
11: if FindLamp(LampSkill) then
Result := True;
12: if (FindNewBox) then
begin
Result := True;
if (UseBoxSolver) then
SolveBox
else
GambleNewBox;
end;
13: if FindTrade then
Result := True;
14:
begin
If NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
15: SaveToChatLog;
16: if RC then
Result := True;
end;
Wait(1);
end;
Findtalk;
FindNormalRandoms;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
Runback;
end;
end;

Procedure My_Anti_Ban;
begin
RandomRClickEvery(2 + Random(6));
HoverSkill('Mining',false);
RotateEvery(20 + Random(10));
LeaveScreenEvery(5 + Random(3));
PickupMouse;
SleepAndMoveMouse(500 + Random(1500));
end;

Procedure Mine_Rocks;
begin
MakeCompass('N');
repeat
If(FindColorSpiralTolerance(x,y,rockcolor,5,5,514,337,2))then
MMouse(x,y,3,3);
If (IsUpText('Mine'))then
Mouse(x,y,0,0,true);
Wait(5000 + Random(1000));
FindTalk;
FindNormalRandoms;
Check_Randoms;
until(InvFull);
end;

Procedure Drop;
begin
Gametab(4);
DropTo(2,28);
FindTalk;
FindNormalRandoms;
Check_Randoms;
Loads:=Loads+ 1;
end;

Procedure Progress_Report;
begin
Writeln('////////// Shockwaves Power Miner ////////////');
Writeln('Worked for '+ TimeRunning) ;
Writeln('You have mined '+IntToStr(Runs)+' loads of ore');
Writeln('You have mined '+IntToStr(Runs*28)+' ore ');
Writeln('////////// Shockwaves Power Miner ////////////');
end;

begin
SetupSRL;
Declare_Players;
Login;
repeat
FindNormalRandoms;
ActivateClient;
ClearDebug;
ChatsOff;
My_Anti_Ban;
Mine_rocks;
Drop;
Check_Randoms;
Progress_Report;
until(false);
end.

3Garrett3

2007-04-22 18:08:45

Good miner, Make DTMs of the ores and use that to drop if you can. In FindFastRandoms, Why not put that in Check Randoms,? And then just use CheckRandoms in ur script?