SCAR Code:
{********************** Version 0.74 Beta ***********************}
{******************* Deoxys' Powerminer Miner *******************}
{******* Made by Deoxys505 ***** Thanks to Nashi for help *******}
{****************************************************************}
//If you want to stop the script, hold 'q' down until it stops.
//Setup Lines 13-20
program Deoxys505PowerMiner;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Mining.scar}
const
RockWait=5500; {//About how long it takes to mine the ore}
RockColor=8750479; {//The rock color you want to mine.}
RockColor2=6004675; {//A second rock color you want to mine; If you only want to mine 1 rock then put 0}
AreYouMining2=(true); {<<Put true if you are mining 2 rocks otherwise put false}
PlayerNick=('eox'); {\\A few Letters from your name. Don't use caps.}
TotalLoads=(25); {\\Loads you want to mine}
PickEquipped=('yes'); {\\If your pick is equipped put yes, otherwise put no}
Completesetup=('yes'); {\\Do you want to set set run or a random bearing (north, etc.}
//If the script has gotten logged out because you got lost.
//Don't mess with unless the script says to.
FalseLost=(0);
var
Loads:integer;
FoundRandom:integer;
FoundGas:integer;
FoundFight:integer;
LostPick:integer;
LostRock:integer;
grewlevel:integer;
MiningMark: Integer; //This will be our time marker
function RBearing: Char;
begin
case Random(4) of
0: Result := 'N';
1: Result := 'E';
2: Result := 'S';
3: Result := 'W';
end;
end;
function antibanrandom: Char;
begin
case Random(10) of
0: Result := '0';
1: Result := '1';
2: Result := '2';
3: Result := '3';
4: Result := '4';
5: Result := '5';
6: Result := '6';
7: Result := '7';
8: Result := '8';
9: Result := '9';
end;
end;
{function Talk: string;
begin
case Random(12) of
0: Result := 'none of yo business';
1: Result := 'more then youres';
2: Result := '50 gajillion';
3: Result := '0.4';
4: Result := 'no comment';
5: Result := 'the answer to life the universe and your question is 42';
6: Result := 'Who cares';
7: Result := 'waz up. jk, leave me alone please';
8: Result := 'If ive told em once ive said it a thousand times. GO AWAY';
9: Result := 'omg guys omg. go away';
10: Result := 'autoers need to die. i hate em.';
11: Result := 'do you tihnk im autoing? i hate autoers they need to die.';
end;
end;}
procedure Couldntfindrock;
begin
logout;
writeln('The script could not find the rock.');
writeln('We think you might have died or got teleported.');
writeln('Please log back in and check,');
writeln('and if you have not died or teleported,');
writeln('Then please reset the script,');
writeln('and add 1 to the FalseLost Constant on line 22');
writeln('After the FalseLost constant gets to 10; reset it back to 0.');
terminatescript;
end;
function Reply: string;
begin
case Random(6) of
0: Result := 'none of yo business';
1: Result := 'more then youres';
2: Result := '50 gajillion';
3: Result := '0.4';
4: Result := 'no comment';
5: Result := 'the answer to life the universe and your question is 42';
end;
end;
procedure FinalReport;
begin
cleardebug;
WriteLn('************* Final Report for Deoxys''s Powerminer *************');
if (loads < 10) then
WriteLn('****************** Mined and Dropped: ' + inttostr(loads) + ' loads ******************')
else
WriteLn('***************** Mined and Dropped: ' + inttostr(loads) + ' loads ******************');
if (LostPick < 10) then
WriteLn('************ You Lost Your Pick-axe Head: ' + inttostr(LostPick) + ' Times **************')
else
WriteLn('************ You Lost Your Pick-axe Head: ' + inttostr(LostPick) + ' Times *************');
if (grewlevel < 10) then
WriteLn('*********************** You Grew: ' + inttostr(grewlevel) + ' Levels *********************')
else
WriteLn('*********************** You Grew : ' + inttostr(grewlevel) + ' Levels *******************');
if (FoundGas < 10) then
WriteLn('********************* You Found Gas: ' + inttostr(FoundGas) + ' Times *******************')
else
WriteLn('********************* You Found Gas: ' + inttostr(FoundGas) + ' Times ******************');
if (FoundRandom < 10) then
WriteLn('********************* Randoms Encountered: ' + inttostr(FoundRandom) + ' *******************')
else
WriteLn('********************* Randoms Encountered: ' + inttostr(FoundRandom) + ' ******************');
WriteLn('******* Made by Deoxys505 ***** Thanks to Nashi for help *******');
terminatescript;
end;
procedure halt;
begin
if iskeydown('q') then
begin
writeln('Pressed down ''q'' script stopped');
finalreport;
end;
end;
procedure haltscript;
begin
logout;
finalreport;
end;
procedure lvltalk;
begin
typesend('yes!!!1 i just grew a mining level');
grewlevel := grewlevel + 1;
doemote(8);
end;
procedure chat;
begin
halt;
if InChat('hello') then
begin
Writeln('Someone is talking to you');
typesend(reply);
end;
if InChat('hi') then
begin
Writeln('Someone is talking to you');
typesend(reply + chr(13));
end;
if InChat('mini') then
begin
if InChat('ed a mining level') then lvltalk
else
begin
Writeln('Someone is talking to you');
typesend(reply);
end;
end;
if InChat('lvl') then
begin
Writeln('Someone is talking to you');
typesend(reply);
end;
if InChat('auto') then
begin
Writeln('Someone is talking to you');
typesend(reply);
end;
if InChat('sup') then
begin
Writeln('Someone is talking to you');
typesend(reply);
end;
if InChat('dead') then
begin
Writeln('Someone is talking to you');
typesend('crud, i died!!!!');
logout
writeln('You died, Script stopping.')
finalreport
end;
halt;
end;
procedure antirandom;
begin
halt;
FindNewBox; //Finds a box
if (FindNewBox = true) then
begin
repeat
FoundRandom := FoundRandom + 1;
OpenBox;
SolveBox;
FindNewBox;
until(FindNewBox = false)
end;
FindDemon;
if (FindDemon = true) then
begin
FoundRandom := FoundRandom + 1;
FindDemon;
end;
FindCerter;
if (FindCerter = true) then
begin
FoundRandom := FoundRandom + 1;
StupidSolveCerter;
end;
TalkToRand;
if (TalkToRand = true) then
begin
FoundRandom := FoundRandom + 1;
TalkToRand;
end
FindLamp('mining'); //if finds the lamp, presses the skill (for xp)
if FindNormalRandoms then
Begin
FoundRandom := FoundRandom + 1;
FindLamp('mining');
End;
SolvePinball;
if (SolvePinball = true) then
begin
SolvePinball
FoundRandom := FoundRandom + 1;
end;
halt;
end;
procedure antirandom2;
begin
halt;
FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
if FindNormalRandoms then
Begin
FoundRandom := FoundRandom + 1;
FindNormalRandoms;
End;
FindTalk; //looks for a few letters from characters name (Nick) for randoms
if FindTalk then
begin
writeln('Someone is talking to you.');
FindTalk;
typesend(reply);
end;
FindPick;
if not findpick then
Begin
LostPick := Lostpick + 1;
finalreport;
writeln('You lost your pick and we can''t find it, so we logged out');
End;
FindFight;
if FindFight then //if finds that you’re in a fight
begin
FindFight
RunAwayDirection('N'); //runs north (s, w, e)
Wait(10000+random(2000)); //waits
RunBack; //runs back
FoundFight := FoundFight + 1;
end;
halt;
end;
procedure dropload;
begin
if invfull then
if (pickequipped = 'yes') then
begin
loads := loads + 1;
DropToPosition(1, 10);
halt
DropToPosition(11, 28);
end;
if (pickequipped = 'no') then
begin
loads := loads + 1;
DropToPosition(2, 10);
halt
DropToPosition(11, 28);
end;
if (loads > totalloads) then haltscript;
end;
procedure antiban2;
begin
RandomRClick;
end;
procedure antiban3;
begin
HoverSkill('mining', false);
end;
procedure antiban4;
begin
HoverSkill('smithing', false);
end;
procedure antiban5;
begin
HoverSkill('attack', false);
end;
procedure antiban6;
begin
PickUpMouse;
end;
procedure antiban7;
begin
AlmostLogout;
end;
procedure antibanrandoms;
begin
antibanrandom;
if (antibanrandom = '0') then
begin
antiban2;
end;
if (antibanrandom = '1') then
begin
antiban3;
end;
if (antibanrandom = '2') then
begin
antiban4;
end;
if (antibanrandom = '3') then
begin
antiban5;
end;
if (antibanrandom = '4') then
begin
antiban6;
end;
if (antibanrandom = '5') then
begin
antiban7;
end;
end;
procedure minerock1;
begin
if findcolorspiral(x,y,rockcolor,3,3,515,336) then
begin
if FindGas(X,Y) then //Checks for gas at where we found the rock color
Begin
FoundGas := FoundGas +1;
Wait(15000 + Random(20000) - Random(10000)); //Waits for gas to go away
End;
halt;
Chat;
halt;
antibanrandoms;
halt;
mmouse(x,y,3,3);
IsUpText('Mine');
if (IsUpText('Mine') = true) then
begin
mouse(x,y,2,2,true);
antirandom2;
MarkTime(MiningMark); //Stores the current system time into MiningMark
repeat
if Random(3) = 1 then
antirandom
else
antirandom2; //Adds randomness =]
if Random(10) = 9 then antiban2; //Don't wanna constantly be hovering skills
Wait(350 + Random(300));
until(TimeFromMark(MiningMark) >= (rockwait-random(2500))); //Not the best practice to use randoms aswell as the original in this circumstance but it adds a little more randomness
end;
if (isuptext('mine') = false) then
begin
Lostrock := lostrock + 1;
if lostrock = (5 + FalseLost) then
begin
Couldntfindrock;
terminatescript;
end;
end;
halt;
end;
end;
procedure minerock2;
begin
if (areyoumining2 = true) then
if findcolorspiral(x,y,rockcolor2,3,3,515,336) then
begin
if FindGas(X,Y) then //Checks for gas at where we found the rock color
Begin
FoundGas := FoundGas +1;
Wait(15000 + Random(20000) - Random(10000)); //Waits for gas to go away
End;
halt;
Chat;
halt;
mmouse(x,y,3,3);
IsUpText('Mine');
if (IsUpText('Mine') = true) then
begin
mouse(x,y,2,2,true);
antirandom2;
MarkTime(MiningMark); //Stores the current system time into MiningMark
repeat
if Random(3) = 1 then
antirandom
else
antirandom2; //Adds randomness =]
if Random(10) = 9 then antibanrandoms; //Don't wanna constantly be hovering skills
Wait(350 + Random(300));
until(TimeFromMark(MiningMark) >= (rockwait+random(2500))); //Not the best practice to use randoms aswell as the original in this circumstance but it adds a little more randomness
end;
if (isuptext('mine') = false) then
begin
Lostrock := lostrock + 1;
if lostrock = (5 + FalseLost) then
begin
Couldntfindrock;
terminatescript;
end;
end;
halt;
end;
if (areyoumining2 = false) then minerock1;
end;
procedure randomtalk;
begin
if random(12) = 1 then
begin
typesend('...');
end;
if random(20) = 2 then
begin
typesend('mining is sooooo boring');
end;
if random(20) = 3 then
begin
typesend('why does this take so long...?');
end;
end;
procedure minero;
begin
repeat
if random(12) <= 2 then makecompass(RBearing);
if random(10) <= 3 then minerock2
else
begin
minerock1;
end;
randomtalk;
Lostrock := lostrock - lostrock;
until(invfull);
dropload;
end;
procedure ProgressReport;
begin
cleardebug;
WriteLn('*********** Progress Report for Deoxys''s Powerminer ************');
if (loads < 10) then
WriteLn('****************** Mined and Dropped: ' + inttostr(loads) + ' loads ******************')
else
WriteLn('***************** Mined and Dropped: ' + inttostr(loads) + ' loads ******************');
if (grewlevel < 10) then
WriteLn('*********************** You Grew: ' + inttostr(grewlevel) + ' Levels *********************')
else
WriteLn('*********************** You Grew : ' + inttostr(grewlevel) + ' Levels *******************');
if (LostPick < 10) then
WriteLn('************ You Lost Your Pick-axe Head: ' + inttostr(LostPick) + ' Times **************')
else
WriteLn('************ You Lost Your Pick-axe Head: ' + inttostr(LostPick) + ' Times *************');
if (FoundGas < 10) then
WriteLn('********************* You Found Gas: ' + inttostr(FoundGas) + ' Times *******************')
else
WriteLn('********************* You Found Gas: ' + inttostr(FoundGas) + ' Times ******************');
if (FoundRandom < 10) then
WriteLn('********************* Randoms Encountered: ' + inttostr(FoundRandom) + ' *******************')
else
WriteLn('********************* Randoms Encountered: ' + inttostr(FoundRandom) + ' ******************');
WriteLn('******* Made by Deoxys505 ***** Thanks to Nashi for help *******');
end;
procedure clrdebug;
begin
cleardebug;
WriteLn('********************** Version 0.74 Beta ***********************');
WriteLn('********************* Deoxys''s PowerMiner **********************');
WriteLn('******* Made by Deoxys505 ***** Thanks to Nashi for help *******');
WriteLn('****************************************************************');
end;
procedure mainloop;
begin
clrdebug; //clears debug and tells who script was made by
SetupSRL;
SetUpSRLMining;
halt;
FindPickHeadColor;
halt;
if completesetup = 'yes' then
begin
runcontrol(true);
halt;
makecompass(RBearing);
end;
repeat
halt;
minero;
halt;
antirandom;
halt;
clrdebug;
halt;
ProgressReport;
halt;
until(IsKeyDown('q')); //stops the script if 's' is down
end;
begin
mainloop; //in case This needs to be edited or to test single parts only
end.