SCAR Code:
Program MineTest;
{.include SRL/SRL.scar}
Const
IronRock=1779525;
LoadsToDo=10;
Var
IronOre:integer;
X,y,i:integer;
Procedure DeclarePlayers;
begin
HowManyPlayers :=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
Players[0].Name :='username';
Players[0].Pass :='password';
Players[0].Nick :='ser';
Players[0].Active:=True;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
Procedure LoadDTM;
Begin
IronOre := DTMFromString('78DA637466626078C280023C7595184480342' +
'310FF07024607A09A4F0C6880118904D2A640356F09A8F105AA79' +
'8D69178A9A40A09A07A86AEAD23C50D5B802D5DC2060971950CD7' +
'DFC6A0039AB0EA3');
end;
Procedure MineOre;
begin
repeat
If(FindColorTolerance(x,y,IronRock,5,5,514,336,0))then
begin
FindNormalRandoms; //ADDED
Mouse(x,y,5,5,true);
wait(2500)
FindNormalRandoms; //ADDED, not sure if placement is right for either
end else
TerminateScript;
until(InvFull);
end;
Procedure DropOre;
Begin
repeat
if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x,y,1,1);
wait(100)
If Isuptext('Iron ore')then
begin
mouse(x,y,1,1,false);
ChooseOption('Drop');
end else
Writeln('No ore found.');
end;
until Not FindDtm(ironOre,x,y,MIx1,MIy1,MIx2,MIy2)
end;
Begin
SetupSRL;
ClearDebug;
ActivateClient;
DeclarePlayers;
LoginPlayer;
SetAngle(true); // ADDED
MakeCompass('W') //ADDED
i:=LoadsToDo;
repeat
LoadDTM;
MineOre;
DropOre;
FreeDTM(IronOre);
i:=i-1
until(i=0);
logout;
Writeln('There were '+floattostr(i)+' loads made.');
end.
Now it logs in perfectly fine.
Sometimes everything will work fine, (angles,mining,not sure about dropping.)
Others it logs in, says found compass in debug, then never changes angle, mines or terminates like its supposed to.
I have absolutely no idea whats going on now. If some of you guys could try it and see if you can solve some bugs taht would be awesome.
Thanks, Anoobis