SCAR Code:
program RockSmasher;
{Made By R0B0T1 Be sure to set up variables and players below.
-you can add more than the specified players, if you know how.
-You can also use less. Might need to change colors....}
{.Include SRL/SRL.scar}
{.Include SRL/SRL/Skill/Mining.scar}
Const
HowManyPlayers:= 5;//How many? remember player 0 counts as 1
MaxTimeWait:= 10;//Max time to wait to mine. Seconds
RunDirection:= 'N';//Set depending on location
LoadsPerPlayer:= 25;//Well....
Wield:= False;//Yo pick wielded homey?
RockColor:= 2832993;//*caugh* (current Iron)
Rounds:= 30;//Times declared players will be looped through
UseBMP:= True;//Use BMP method?
TimeToWait:= 5;//If above is false. Seconds. Not MS
Procedure DeclarePlayers;
begin;
Var NumPlayers:Integer;
NumPlayers:= HowManyPlayers;
NumberOfPlayers(NumPlayers);
CurrentPlayer:=1;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active:=True;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active:=True;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active:=True;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active:=True;
end;
Var
mined, missedore, i:Integer;
DidRandomHappen, Result, UnKnown, Pmod, Mime:Boolean;
Info:String;
Procedure CreateBMPs;
begin;
mined := BitmapFromString(116, 12, 'z78DAE5994B0EC2300C44AF' +
'044815ED3291B8FF959080459099C9D82E6D285D78913A9F3A2F5' +
'327A9A5D4B9D4C69E1E4F95CB5FB696DB72916C5B6B29D37CFE50' +
'62ADF2D63B2A548BF7C57BF44623615F33B2495F9D182AF14411F' +
'6461ED492B8CD7F698C876D38898DC1CEE03F709B8F1BD7B4CBB2' +
'5CA7374B396929ED282D9AA3988E65E8CD44C9AB09BB2AED98DC4' +
'A9C64AC4C8832929379603B864F548E3C5B7FDEA37B6CC61FD10B' +
'DB04F3F8E649675CF1F4D68AB56CEBA212AE57526C9B5ACA7C29E' +
'AA7CCA07D6B69CC70ABB4D629A12B11454929411914A748D14C85' +
'31652DACD5B2BB44892D67892BA79399188D1D4F3AAA18B75693A' +
'D62C72206DBB475390FBA27D8070DCD2DCD1C829A10E356202AAF' +
'7EEE6F4CAF9495634BD72357FBCE5F18FC557996F25BDC4A79C2B' +
'37D3D4F58576FD7E216E4CF12B70A632165EE780A7ADB396B1A47' +
'6F95AF4B440C9ED524F204F42F767BD25D7C8C5B294F08E5DEBA3' +
'2E85AEA505D61F794DA9781D5E4E0D6BB7EE9BE2C96276C6AF3B7' +
'0F7B8D563ECB1DEEC4F57B370E99BB21EF99D8680C8CB6A6F49B3' +
'267CE791086F3A7DFB1B3DC7FA0B4BD73C953CA73F263738BD6E9' +
'F7EE1D1A7B07E72791BE');
missedore := BitmapFromString(266, 15, 'z78DAED5C5B6E1B310C' +
'BC521A2048FC6903C9FD8FD4024D506F7749CD7086DAF5C31F82A' +
'17D4914C5E190922EE7F3E5E37CB99C3F4FAFEDE5DF6F45E5E9FC' +
'F6F16B50E66FB82E6B6D50CA39324CCB973FBFAFAFEB7220875C2' +
'6EBABBA0C91515E8F757AE7A2BFFA77750DDC771E79CB48022E79' +
'EE5BBE9E4EEF6F8B727E1B7279AE5B88941D5A1D942FE9EF9F5DF' +
'AF91F5AA1A8C68B20797FF336DC357648B688FDDF619DF25980E8' +
'89600FBF35BC7BDECDC48BFF1036E95D2A555C3245191EA0FC6E7' +
'9B795AE6994B78F880E083882D717F59FB5063504E9C0AF7B4510' +
'1D71589BD6C70E82F7E7736743C3BBBDCD898C63D13BAFCDD1F17' +
'78A3F0F8D7E8E0E7B610AEB110557171268F09F07D8A15B1B2F6F' +
'3A4E3400E15CF78D23CAD8AD6741C37CDCB01E8877A47B38FA6C9' +
'5A53DE89D894D48D8D1ECCFE7BE01D1721C59ACB1591D65200D17' +
'34D9C03BE664345829B1B3CF956179224847D4DDCBD9239DF146B' +
'06B78C47A2C415F6E003BC8F1F2F662D0F22B4458DC393FA2C5EA' +
'5EC43BF0F75863568B6C089C43C9C72BBF07F9A292D9C9B571D0F' +
'7CD9CF556CE08CD778F9E45F2507D6D18B42AD519FCAAA245842E' +
'45D801E8246EFD724DABD5B333829630F2455832C838B268C2BE6' +
'DA30D012244F7E465685BC81ED1D283E74B5863F2E810FDC963C8' +
'F88CC36D4218530D7096F6BB52C631E8FB158220D63E8A6EE1CFE' +
'2C882D4BBEE89E413F9F32E8B4ACF148477C8D831D05EA1A7B53B' +
'6D6F2BCD71DCCE443E5B6E318A2302D8A21065D21A9C77D03690D' +
'56D12A7A096973C07AFB6D422908A9E74F86C485668519FB29581' +
'4D062CFCCED891464E7034A765CE6A26A06FB406AE7C0F9CE7222' +
'C0C7F278B14D0DB4A73DF3B8B3B6CC2C6D51252D4B8552D92A660' +
'871457C47907B08222671335DF12D26A53A4144110A8FD29070CF' +
'32F2C6709F84E1E71C2635636EC0898886DF423CB96D66FE88FC2' +
'A0ADEB1543ECC87D2D04298088A22192903EEBB2AB47C68EB5C76' +
'E6ED51CDE21AC1C8E7C335B2F64CF13C98E419E21B232D31B5560' +
'79071919C3EDBF013B0469D057D35CBC127BC1BD2696B12AFE92B' +
'9A7355D355930625D68099BE808580D3BDA560E18B0A3E603D7B2' +
'E72CEF10EAA1DC0D9C6BC8E3E74536545BDDC7E61FDB72E5F87B0' +
'64FADB0096943915702AC4489CF20DEBB62E5D868278E3B7D3229' +
'C6ACC8B983E4B614FCC5F1AE98D75845FE172CA3CFB6B0597E3C5' +
'78EC71E916CF2D14AD7FAF9F9AD7DCCBD1E391750F66FEE75CE06' +
'39BEFA7ABF1B2B5D276CECDB5ABC2FC75973DB7DCA41890F1EBAA' +
'7476B21BEA3FC317797EBBB638E7046936B9FDD31FB3B077327EE' +
'E16AB4847BA186EBBB73B4E27190825D7BF668A75AB9CEBFBA5D5' +
'F5ACEE03CCBF6FDF5DDB60E671C2E4C9979C2899715B2BB62F73A' +
'E3AB4FAA1D2722023B7F9FD8712BDEB86B5FEA0D330E6FD4E868D' +
'8915B92EBAB1D1C04C7A9996C0890E76FC1F7A03E');
end;
Procedure Sig;
begin;
WriteLn('R0b0t1 made this');
end;
Procedure FreeBMPs;
begin;
Freebitmap(mined);
Freebitmap(missedore);
end;
Function FindFastRandoms:Boolean; //WT-Fakawi... I think. I edited
Var i:Integer;
begin;
For i := 1 to 12 Do
begin;
Case I of
1: If FindDead then
UnKnown:= True;
Result:= True;
2: If FindMod then
Pmod := True;
Result:= True;
3: If FindMime then
UnKnown := True;
Result := True;
Players[CurrentPlayer].loc:= 'Mime';
4: If FindMaze then
Result := True;
UnKnown := True;
Players[CurrentPlayer].loc:= 'Maze';
5: If FindQuiz then
begin;
Result := True;
SolveQuiz;
end;
6: If FindDemon then
Result := True;
7: begin;
If NoGameTab then
begin;
UnKnown := True;
Players[CurrentPlayer.loc := 'No GameTab';
end;
end;
8: begin;
If InBlack then
begin;
Result:= True;
UnKnown := True;
Players[CurrentPlayer].loc := 'InBlack';
end;
end;
9: If FindFrogCave Then
begin;
SolveFrogSwamp;
end;
10: if FindScapeRune then
Result := True;
UnKnown:= True;
Players[CurrentPlayer].loc:= 'ScapeRune';
11: if FindTalk then // Call it twice
Result := True;
end;
Wait(1);
end;
If (Result = True) Then
DidRandomHappen := True;
If (UnKnown = True) Then
begin;
Info:= Players[CurrentPlayer].loc;
WriteLn('Lost Player. Reason: ' + Info);
Logout;
NextPlayer(false);
end;
If (Pmod = true) Then
begin;
Logout;
Wait(60000);
NextPlayer(true);
end;
end;
Procedure AntiRandoms;
begin;
FindPick;
FindTalk;
FindNormalRandoms;
FindFastRandoms;
FindLamp('mining');
If (FindFight = True) Then
begin;
RunAwayDirection(RunDirection);
Wait(10000+random(2000));
RunBack;
end;
If (ClickToContinue = True) Then
begin;
TalkToRand;
end;
If (FindNewBox = True) Then
begin;
OpenBox;
Wait(3000);
SolveBox;
end;
If FindCerter Then
begin
Result:= True;
CerterLoadBmps;
Wait(500);
SolveCerter;
Wait(500);
CerterFreeBmps;
end;
end;
Procedure AntiBans; //Yakman, edit by me.
begin;
case Random(10) of
0: IdleTime(1000 + Random(200), 500, 1.0);
1: IdleTime(1000 + Random(350), 1075, 1.0);
2: SleepAndMoveMouse(2500 + Random(2500));
3: SleepAndMoveMouse(2500 + Random(1500));
4: SleepAndmoveMouse(500 + Random(500));
5: IdleTime(100 + Random(250), 750, 0.5);
6: RotateEvery(0+Random(5));
7: BoredEvery(0+Random(5));
8: PickupEvery(0+Random(5);
9: begin;
Var g:Integer;
g:= random(2);
If (g = 0) Then
HoverSkill('mining');
If (g = 1) Then
HoverSkill('smithing');
end;
Procedure FindGas;
begin;
Var x, y:Integer;
If FindGas(x, y) Then
begin;
RunAwayDirection(RunDirection);
Wait(10000 + Random(2000));
RuneBack;
end;
end;
Procedure Mine;
begin;
If (UseBMP = True) Then
begin;
repeat;
Var x, y:Integer;
If FindObjOre2(x, y, 'ock', RockColor, 5, 2) Then
begin;
MMouse(x, y, 5, 5);
FindGas;
Mouse(x, y, 3, 3, True);
Wait(1000+Random(1500));
AntiRandoms;
If not (FindBitmap(missedore, x, y)) Then
begin;
FindBitmap(mined, x, y);
Wait(3000+Randoms(3000));
If not (FindBitmap(mined, x, y)) Then
begin;
Var v:Integer;
repeat;
Wait(1000);
FindBitmap(mined, x, y);
v:= v+1;
until (v = MaxTimeWait);
end;
end;
end;
until (invfull);
If (UseBMP = False) Then
begin;
repeat;
Var x, y:Integer;
FindGas;
If not (LoggedIn) Then
NextPlayer(true);
If (FindColorTolerance(x, y, RockColor, 0, 0, 500, 300)) Then
MMouse(x, y, 5, 1);
If (IsUpText('Mine')) Then
Mouse(x, y, 3, 3, True);
Wait(TimeToWait*1000 + Random(2000));
until (invfull);
end;
end;
Procedure Drop;
begin;
If (Wield = True) Then
begin;
DropAll;
i:= i + 1;
end;
If (Wield = False) Then
begin;
DropTo(2, 28);
i:= i + 1;
end;
end;
Procedure All;
begin;
i:= 0
SetUpSRL;
FindPickHeadColor;
LoadBMPs;
repeat;
Antibans;
Mine;
AntiRandoms;
Drop;
until(i = LoadsPerPlayer);
NextPlayer(True);
i:= 0;
end;
Procedure ProgressReport;
begin;
ClearDebug;
WriteLn('______________________________________');
WriteLn('RockSmasher by r0b0t1 ');
WriteLn(' Progress Report ');
WriteLn(' Did '+InttoStr(i)' Loads on ');
WriteLn(' '+Players[CurrentPlayer].Name);
WriteLn('Worked For: ' + ScriptTime2(2) + ' ');
WriteLn('Loops Worked: ' + InttoStr(loopnum) );
WriteLn('Loops Left: '+InttoStr(Rounds-loopnum) );
SRLRandomsReport;
end;
Var loopnum:Integer;
begin
loopnum:= 0;
repeat;
loopnum:= loopnum + 1
All;
until(loopnum = Rounds);
ProgressReport;
FreeBMPs;
end.