SRL Archive - First Scripts

w100 cookah


remco1337

2012-06-02 13:13:17

Im trying to make a w100 cookah but i can“t make an cook option and findfire hopefully you guys can help me :

program ShantayCooker;
{$DEFINE SMART}
{$i srl\srl.simba}



procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
function ClickFire: Boolean;
var
x, y, CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
Writeln('Clicking Fire...');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3058939, 216, 134, 348, 198, 20);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 5, 5);

for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y); //Returns the middle coords of the current TPA in the ATPA
Mouse(x, y, 2, 2, True);
Wait(500 + Random(100));
Break;
end;
Result := DidRedClick;
end;
function FindShantayChest: boolean; //ty erik
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;

tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);

if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpText('Open', 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreen found');
result:= true;

break;
end;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

procedure Antiban;
begin
case Random(2300) of
0..1: begin; HoverSkill('cooking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
2..3: begin; HoverSkill('firemaking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
4: begin; HoverSkill('random', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
5..7: RandomRClick;
8..10: PickUpMouse;
11..13: RandomMovement;
14..16: BoredHuman;
17: ExamineInv;
18..22: SleepAndMoveMouse(Random(5000));

end;
end;

Procedure Bank;
var X, Y, P: Integer;
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
x := MSCX;
y := MSCY;
if not LoggedIn or FindNormalRandoms then
Exit;
Antiban;
// 5859188
//if FindObjTPA(X,Y, 2572631,5 ,1 ,20 ,20, 600, ['Open']) then
//if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
if FindShantayChest then
Mouse(X, Y, 3, 3, False);
WaitOption('Open', 500);

if Bankscreen then
Wait(RandomRange(800, 1500));
if InvFull then DepositAll;
WithDraw(0,0,0);
Closebank;


if PinScreen then
InPin(Players[CurrentPlayer].Pin);


end;

Procedure Startup;
begin

if not LoggedIn then
LoginPlayer;
If loggedIn then
debugln('Starting up');
MakeCompass('N');
GameTab(Tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
end;
Procedure Mainloop;
Begin
repeat
debugln('Performing the mainloop');
Startup;
Bank;
ClickFire;
until not LoggedIn
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
repeat
MainLoop;
until(AllPlayersInactive)
end.