SCAR Code:
{===============================================================
| Gwallunits Powerminer |
| Use on Low Detail and 32 Bit Color Also Highest Brightness |
| My First Script v1.0 |
| |
| |
|===============================================================}
program PowerMiner;
{.include SRL/SRL.Scar}
{.include SRL/SRL/skill/Mining.scar}
Const
RockColor=1654857; // Set The Rock Color here
var
oree: Integer;
OreBitmap:Integer;
var
ErrorColor : String;
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //How many Active PLayers
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Starting Character
Players[0].Name := 'Gwallunit';
Players[0].Pass := 'Youwish';
Players[0].Nick := 'allu';
Players[0].Active := True;
Players[0].String1:='Iron'; // Ore color
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
///////////////////////////////////////////////////////////////
procedure SetOreBitmaps;
begin
if(Players[CurrentPlayer].String1='Copper')then
begin
OreBitmap := BitmapFromString(3,3,'z78DAB3B034333631B08'+
'090E66646C6AE16C82238480037250B40')
ErrorColor := 'Copper';
end;
if(Players[CurrentPlayer].String1='Tin')then
begin
OreBitmap := BitmapFromString(3,2,'8A81808A81808A81808C838'+
'28C83828C8382')
ErrorColor := 'Tin'
end;
if(Players[CurrentPlayer].String1='Iron')then
begin
OreBitmap := BitmapFromString(1,3,'513125513125513125')
ErrorColor := 'Iron'
end;
end;
Function AutoColorOre:Integer;
var Toller,MX,MY: Integer;
begin
repeat;
if(FindBitmapToleranceIn(OreBitmap,MX,MY,MSX1,MSY1,MSX2,MSY2,Toller))then
begin
Result:=GetColor(MX,MY);
Exit;
end;
Toller:=Toller+5;
until (Toller>=10);
WriteLn('Did Not Find '+ErrorColor+' Color!');
end;
//////////////////////////////////////////////////////////////////////////////
procedure RockMine;
begin
if findObj(x, y, 'Mine', RockColor, 20)then //Change this with some better FindObj :p
begin
if not FindGas(x, y) then
Mouse(X,y,4,4,true)
end;
end;
////////////////////////////////////////////////////////////////////
Procedure DropDTM;
begin
Oree := DTMFromString('78DA6314626060106040018C0A12101AC607C' +
'9CB30A0014654354C404218554598AF13AA1A4E20C181AA26C4CB' +
'1A550DC86A365435467262A86A9480043701F7C802095154155E3' +
'A0A286A00DB7703F5');
repeat
if(FindDTM(Oree,x,y,MIX2,MIY2,MIX2,MIY2))then
begin
Mouse(x,y,4,4,False)
ChooseOption(x,y,'drop')
end;
until( not (FindDTM(Oree,x,y,MIX2,MIY2,MIX2,MIY2)))
end;
////////////////////////////////////////////////////////////////
procedure ProgressReport;
begin
ClearDebug;
Writeln('[]=============================[]');
Writeln('---->Gwallunit Powerminer Progress<----');
Writeln(' did ' + IntToStr(oree) + ' Loads' + ' ');
Writeln('---------------------------------------------');
end;
//////////////////////////////////////////////////////////
procedure ReleaseBitmaps;
begin
FreeBitMap(OreBitMap);
end;
{---------------------------------------------------------------
Main Loop
----------------------------------------------------------------}
begin
SetUpSRL;
SetupSRLMining;
repeat
DeclarePlayers;
Setorebitmaps;
LoginPlayer;
Highestangle;
wait(1000+50)
RockMine;
If(not(LoggedIn))then
exit;
DropDTM;
ProgressReport;
ReleaseBitmaps;
until(false)
end.