Heysus
2008-10-11 16:46:37
Uses reflection, has AntiBan and AntiRandom (Not sure how well the antirandom works though)
Instructions:
1. Go to Edgeville
2. Clear your inventory except for 14 empty buckets.
3. Start
Please post if theres a way i could improve it or if i'm doing anything wrong.
program HeysusClaySoftener;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.scar}
var
x,y,i,n,c,A,
SoftClay,Clay,Bucket_Empty,Bucket_Water: Integer; // bmps/dtms
ClayCount: Integer;
P,P1,P2,P3,P4: TPoint;
Done: Boolean;
const
World = 121;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='Username';
Players[0].Pass :='Password';
Players[0].Nick :='Nick';
Players[0].Active:=True;
end;
Procedure ProgressReport;
begin
ClearDebug;
Writeln('Heysus Clay Softener');
Writeln('');
Writeln('Time: ' + TimeRunning);
Writeln('Clay Softened: ' + inttostr(ClayCount));
SRLRandomsReport;
end;
Function Location: String;
begin
P := GetMyPos
Result:='Outside';
if ((P.x <= 3098) and (P.x >= 3091)
and (P.y <= 3499) and (P.y >= 3488))
then Result:= 'Bank';
ProgressReport;
end;
Procedure AntiRandom;
begin
if not LoggedIn then exit;
FindNormalRandoms;
if FindFight then
begin
RunAway('w',true,1,15000+random(10000));
AntiRandom;
end;
end;
Procedure AntiBan;
begin
c:=random(200)
case c of
0: HoverSkill('smithing',false);
1: PickUpMouse;
2: BoredHuman;
3: SleepAndMoveMouse(250+random(250));
4: SleepAndMoveMouse(750+random(750));
end;
GameTab(4);
end;
Function Check_Clay: Boolean;
begin
Result:=false;
AntiRandom;
GameTab(4);
if CountItemsIn('inv','dtm',Clay,[0]) >= 1 then
Result:=true;
end;
Function Find_Bank: Boolean;
begin
AntiRandom;
result:=false
if Bankscreen = false then
begin
OpenBankReflection('eb');
i:=0
repeat
Wait(500+random(5));
AntiRandom;
inc(i)
until((BankScreen = true) or (i=4))
end;
if BankScreen = true then result:=true
end;
Procedure Bank;
begin
if Bankscreen = false then exit;
if(FindColorTolerance(x,y,2700606,228,299,255,317,10)) then
Mouse(x,y,3,3,true); // Turn Bank Notes Off
n := 0
if FindDTM(SoftClay,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
n := CountItemsIn('inv','dtm',SoftClay,[0]);
Mouse(x,y,5,5,false);
Wait(50+random(50));
if ChooseOption('All')
then ClayCount := ClayCount + n;
Wait(500+random(500));
end;
n:= 14-CountItemsIn('inv','dtm',Clay,[0]);
if ((FindDTM(Clay,x,y,MSX1,80,MSX2,MSY2)) and (n>0)) then
begin
Mouse(x,y,5,5,false);
Wait(50+random(50));
ChooseOption('All');
Wait(500+random(500));
end;
AntiRandom;
CloseBank;
ProgressReport;
end;
Procedure Soften_Clay;
begin
if CountItemsIn('inv','bmp',Bucket_Water,[30]) = 0
then exit;
if BankScreen = true then CloseBank;
if FindBitmapToleranceIn(Bucket_Water,x,y,MIX1,MIY1,MIX2,MIY2,30) then
begin
Mouse(x,y,5,5,true);
Wait(200+random(200));
if FindDTM(Clay,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
AntiRandom;
Mouse(x,y,5,5,true);
Wait(800+random(400));
Mouse(255,413,6,6,false);
Wait(100+random(100));
ChooseOption('All');
i:=0
repeat
Wait(500+random(10));
AntiRandom;
AntiBan;
inc(i)
until((FindBitmapToleranceIn(Bucket_Water,x,y,MIX1,MIY1,MIX2,MIY2,30)=false) or (i=40))
end;
end;
end;
Procedure Find_Fountain;
begin
if(FindColorTolerance(x,y,7464434,720,104,728,112,20)=false) then
Mouse(724,108,6,6,true); // Turn Run On
if CountItemsIn('inv','bmp',Bucket_Water,[30]) >= 1
then exit;
if TileOnMS( Point(3084, 3501) ,0) = false then
WalktoTile(Point(3086,3500),2,2);
AntiRandom;
if FindBitmapToleranceIn(Bucket_Empty,x,y,MIX1,MIY1,MIX2,MIY2,30) then
begin
Mouse(x,y,5,5,true);
Wait(200+random(200));
P1 := TileToMS(Point(3084, 3500),0);
P2 := TileToMS(Point(3083, 3500),0);
P3 := TileToMS(Point(3084, 3501),0);
P4 := TileToMS(Point(3083, 3501),0);
Mouse((P1.x + P2.x + P3.x + P4.x)/4, (P1.y + P2.y + P3.y + P4.y)/4,5,5,true);
i:=0
repeat
wait(500+random(5));
AntiRandom;
AntiBan;
inc(i)
until((FindBitmapToleranceIn(Bucket_Empty,x,y,MIX1,MIY1,MIX2,MIY2,30)=false) or (i=25))
end;
end;
Procedure SetupScript;
begin
SetupSRL;
SmartSetupEx(World, True, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);
DeclarePlayers;
if R_LoggedIn = false then LoginPlayer;
SoftClay := DTMFromString('78DA639CCDC4C0C0C2C8800C125C391852803' +
'448F43F10304E07AAF9C580061819E4A06AC0BCA540357F8950C3' +
'CE885FCD4CA01A3E026AFA806A38F0AB0100F0C60B80');
Clay := DTMFromString('78DA634C666060E8654001536BFC185280342' +
'310FF0702C65820A38F010D3032C841D580798940A28B809A2C20' +
'D143404D2A9098845F0D006BDA0AF9');
Bucket_Empty:= SRL_GetBitmap(96);
Bucket_Water:= SRL_GetBitmap(97);
end;
Begin
SetupScript;
R_SetAngle(100);
repeat
if Check_Clay = false then
begin
if Find_Bank then Bank;
end;
if Check_Clay = true then
begin
Find_Fountain;
Soften_Clay;
if Location = 'Outside' then
Find_Fountain;
end;
AntiRandom;
ProgressReport;
until(done = true)
Logout;
ProgressReport;
Writeln('');
Writeln('Done.');
end.