SCAR Code:
{/----------------------------------------------------------------------\\
| |
| .: YoHoJo's [P]ower [M]iner [S]upreme :. |
| Version: 1.00 |
| |
| Please Post Progress Reports |
| Please Monitor The Script And Leave Details About How It Runs |
| All Of This Will Help Make The Script Better! |
\\----------------------------------------------------------------------//
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {
//----------------------------------------------------------------------\\
| .:Script Features:. |
| ¤ Tested With SCAR Divi 3.22 & SRL Developers Revision (v294) |
| ¤ Powermines Copper, Tin, or Iron Ore |
| ¤ Super Fast Dropping |
| ¤ Some Decent Antiban |
| ¤ More To Come, All Suggestions and Feedback Appreciated! |
\\----------------------------------------------------------------------//
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {
//----------------------------------------------------------------------\\
| .:Version History:. |
| ¤1.00: |
| -Initial Release, Should Work :p, Feedback Appreciated |
\\----------------------------------------------------------------------//
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {
//----------------------------------------------------------------------\\
| .:Credits:. |
| ¤ZephyrsFury: |
| -Helped with random small things |
| -Supporting and Beveling In me |
| ¤IceFire908 |
| -Giving me basic idea for mining procedure |
| -Helped with random small things |
| -Being a dick and a jerk which motivated me to finish |
| |
| ¤The SRL Developers for creating |
| ¤Kaitnieks and Freddy1990 for SCAR |
| ¤The SRL Community for Testing/Being Awesome |
| ¤Anyone Else Who I've Forgotten To Put Here! |
\\----------------------------------------------------------------------//
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {
//----------------------------------------------------------------------\\
| .:Setup:. |
| ¤Basic Setup Lines 54-61 |
| ¤Player Array Setup Starts At Line 78 onwards |
\\----------------------------------------------------------------------// }
Program YoHoJosPMS;
{.Include SRL\SRL\Misc\SMART.SCAR}
{.include SRL\SRL.scar}
{.Include SRL\SRL\Misc\Debug.SCAR}
Const
NumbOfPlayers= 4; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first character)
LoadsPerLogin= 2; //How Many Loads To Do Per Login!
LoadsTotal= 4; //How Many Total Lods To Do Per Character!
World= 102; //Server to log into, if you are using SMART.
SSigned= True; //True for singed, False for unsigned client;
Version= '1.00'; //No Touchy!
DropGems= True; //Drop Gems?(They are useless!)
var
RockPattern: Array Of TIntegerArray;
TOres,TLoads,WeMined,StartTime,GemDTM:Integer;
procedure DeclarePlayers;
var
i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 5; //Seconds to try mining rock before clicking another.
end;
with Players[1] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 5; //Seconds to try mining rock before clicking another.
end;
with Players[2] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 5; //Seconds to try mining rock before clicking another.
end;
with Players[3] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 3; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 5; //Seconds to try mining rock before clicking another.
end;
with Players[4] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 3; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 5; //Seconds to try mining rock before clicking another.
end;
SetArrayLength(RockPattern,2);
RockPattern[0]:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
RockPattern[1]:=[1,5,9,13,17,21,25,26,22,18,14,10,6,2,3,7,11,15,19,23,27,28,24,20,16,12,8,4];
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Function CheckAndClick(X,Y:Integer):Boolean;
Begin
MMouse(x,y,3,3);
Wait(200+Random(100));
if(IsUptext('ine'))then
begin
Result:=True;
GetMousePos(x,y);
Mouse(x,y,0,0,True);
Wait(100);
FFlag(0);
end;
end;
Function OreInLast:Boolean;
Begin
If(GetColor(703,458))and(GetColor(702,441) = 131072)Then
If(InvFull)Then
Result:=True;
End;
Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Mining',False);
1: Begin
PickUpMouse;
SleepAndMoveMouse(3000+Random(500));
End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin
GameTab(Tab_Stats);
Wait(3000+Random(500));
GameTab(Tab_Inv);
End;
5: HoverSkill('random',False);
End;
End;
Function GemThere(x1,y1,x2,y2:Integer):Boolean;
var
x,y:Integer;
Begin
If(FindDTM(Gemdtm,x,y,x1,y1,x2,y2))Then
Result:=True;
End;
Procedure FastDropOres(Incr:Boolean);
var
OreMid,I,X,Y,J,R:Integer;
SlotBox:TBox;
AntiB:TIntegerArray;
Begin
If(Not(LoggedIn))Then
Exit;
J:=0
R:=Random(2);
StatsGuise('Dropping Ores');
OreMid := DTMFromString('78DA63CC626260E0606440054C601226CA584' +
'C849A3C209F8F809A6C209F19BF1A00AD2101F4');
GemDTM:= DTMFromString('78DA639CC6C4C0F0920105F00BA632FC07D28' +
'C40FC1F08187B806A9E30A0012630C908E5312E04F29F1250331D' +
'C8BF4340CD4C20FF037E350047640D0E');
AntiB:=[(Random(28)+1) , (Random(28)+1) , (Random(28)+1)];
For I:=0 to 27 Do
Begin
FindNormalRandoms;
SlotBox:=InvBox(RockPattern[R][I]);
If(FindDTm(OreMid,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2))Then
Begin
MouseItem(RockPattern[R][I],False);
If((InIntArray(AntiB, I)))Then
Begin
Case Random(2) Of
0:Begin
ChooseOptionMultiEx(['xami'],'player',ClickLeft);
Wait(200+Random(100));
MouseItem(RockPattern[R][I],False);
End;
1:Begin
ChooseOptionMultiEx(['Use'],'player',ClickLeft);
Wait(250+Random(100));
MouseItem(RockPattern[R][I],True);
Wait(250+RandoM(100));
MouseItem(RockPattern[R][I],False);
End;
End;
End;
ChooseOptionMultiEx(['rop'],'player',ClickLeft);
Inc(J);
Wait(150+Random(100));
End;
If(GemThere(SlotBox.X1,SlotBox.Y1,SlotBox.X2,Slotbox.Y2))Then
If DropGems=True Then
Begin
Mouse(x,y,4,4,False);
Wait(150+Random(100));
ChooseOpTionMultiEx(['rop'],'player',ClickLeft);
End;
End;
If Incr Then
Begin
TOres:=TOres + J;
Inc(TLoads);
Players[CurrentPlayer].Integers[80]:= Players[CurrentPlayer].Integers[80] + J; //Ores
Inc(Players[CurrentPlayer].Integers[81]); //Total Loads
Inc(Players[CurrentPlayer].Integers[82]); //Temp Loads
End;
FreeDTM(GemDTM);
FreeDTM(OreMid);
End;
Function MineRock(WutRock:Integer):Boolean;
var
I,PlusOne,tMine, HighRock:Integer;
RockInFoI: TIntegerArray;
RockInFoE: TExtendedArray;
RockPts:TPointArray;
RockPtsBox: T2DPointArray;
RockPt: TPoint;
Begin
If Not(LoggedIn) Then Exit;
StatsGuise('Searching For Rock');
If OreInLast Then Exit;
Case WutRock of
1: Begin
RockInFoE:=[0.01 , 2.25];
RockInFoI:=[3701475, 10];
End;
2: Begin
RockInFoE:=[0.03 , 0.09];
RockInFoI:=[4088717, 9];
End;
3: Begin
RockInFoE:=[0.27 , 0.13];
RockInFoI:=[9408662, 9];
End;
4: Begin
RockInFoE:=[0.13 , 0.18];
RockInFoI:=[2567749, 6];
End;
End;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(RockInFoE[0],RockInFoE[1]);
FindColorsSpiralTolerance(MSCX,MSCY,RockPts,RockInfoI[0],MSX1,MSY1,MSX2,MSY2,RockInfoI[1]);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
RockPtsBox:= TPAtoATPAEx(RockPts,20,20);
//SortTPAFrom(RockPts, Point(MSCX, MSCY));
SortATPAFrom(RockPtsBox,Point(MSCX,MSCY));
HighRock:=High(RockPtsBox);
For I:=0 To HighRock Do
Begin
Wait(200+Random(150));
//If (InRange(GetArrayLength(RockPtsBox[I]),RockInFoI[2],RockInFoI[3])) Then
Begin
DebugATPA(RockPtsBox,'')
RockPt:= MiddleTPA(RockPtsBox[I]);
If CheckAndClick(RockPt.x,RockPt.y) Then
Begin
MarkTime(tMine);
StatsGuise('Mining Rock');
Players[CurrentPlayer].Loc:='Mining';
PlusOne:=InvCount+1;
Repeat
Wait(150);
FindNormalRandoms;
If Random(50)=1 Then SleepAndMoveMouse(500+Random(100));
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
Result:=True;
Exit;
End;
End;
End;
End;
procedure PlayerStats; {modified from Dankness and Tarajunky <3}
var
Active: string;
i: Integer;
begin
AddToReport ('');
AddToReport ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
AddToReport('# : Nick = A : Level Worked Mined Loads Location');
for i := 0 to HowManyPlayers - 1 do
begin
if (Players[i].Active) then Active:='T' else Active:='F';
AddToReport(Padr(Inttostr(I),2) + ': ' + Padr(Players[i].Nick,4) + ' = ' + Padr(Active,5)
+''+Padr(inttostr(Players[i].level[15]),5)+''
+''+Padr(MsToTime(Players[i].Worked,Time_Bare),10)+''
+'Ore:'+Padr(IntToStr(Players[i].integers[80]),8)+''
+''+Padr(IntToStr(Players[i].integers[81]),7)+' '
+'L:'+Players[i].Loc);
end;
AddToReport ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
end;
procedure ProgressReport; {modified from Dankness and Tarajunky <3}
var
Sec,Orerate,LoadRate:integer;
begin
SRLRandomsReport;
Sec:= (1+((Getsystemtime-StartTime)/1000));
OreRate:=(3600*(TOres))/(Sec);
LoadRate:=(3600*(TLoads))/(Sec);
Writeln(' ');
Writeln ('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
Writeln ('| --> YoHoJos PMS '+Version+ ' <-- |');
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
Writeln(' | Worked for '+ TimeRunning);
Writeln(' | Mined '+IntToStr(TOres)+' ores at a rate of '+IntToStr(OreRate)+' per hour');
Writeln(' | Mined '+IntToStr(TLoads)+' loads at a rate of '+IntToStr(LoadRate)+' per hour');
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
PlayerStats;
end;
Function OverAnd:Boolean;
Begin
If(not(Players[CurrentPlayer].Integers[82]=0)) Then
If(Players[CurrentPlayer].Integers[82] Mod LoadsPerLogin)=0 Then
Result:=True;
End;
Begin
Smart_Server := World;
Smart_Signed := Ssigned;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
StartTime:=GetSystemTime;
Repeat
StatsGuise(Players[CurrentPlayer].Nick + ' logging in');
LoginPlayer;
Wait(1000+Random(500));
Players[CurrentPlayer].Integers[82]:=0; //Temp Loads
Players[CurrentPlayer].Level[15]:=GetSkillLevel(15);
StatsGuise(Players[CurrentPlayer].Nick + ' Mining Lv ' +IntToStr(Players[CurrentPlayer].Level[15]));
SetRun(True);
SetAngle(True);
FastDropOres(False);
MarkTime(WeMined);
Repeat
If MineRock(Players[CurrentPlayer].Integers[1]) Then MarkTime(WeMined);
If (TimeFromMark(WeMined) > 90000) Then
Begin
Players[CurrentPlayer].Loc:='Cant Find Rock :(';
StatsGuise('NP:Cnt.Fnd.Rock');
Logout;
Break;
End;
If OreInLast Then FastDropOres(True);
If (Players[CurrentPlayer].Integers[81] = LoadsTotal) Then
Begin
Players[CurrentPlayer].Loc:='Finished Loads!';
StatsGuise('NP:Fin.All.Load');
Logout;
Break;
End;
Until (OverAnd);
StatsGuise('NP:NextPlayer');
NextPlayer(LoggedIn);
ProgressReport;
If AllPlayersInactive Then
Begin
LogOut;
TerminateScript;
End;
Until(False);
End.