Timer
2010-04-26 17:28:50
Uhh, I mean.. It isn't much.. But I made it in like 10 minutes. Yet, it is very Solid. I used it on a "main" of mine. It got me 99 (from level 32 to 99). I was happy with that, so uh.. Feel free to do whatever you want with this.
Start with empty inventory, food / tinderbox / logs in bank.
Supports Lobbys / Shark. Feel free to add more.

inb4noobs:
Yeah, I know, this script "sucks". Its a 10 minute piece of work that got me 99 cooking, and I'm not saying use this, but anyone can feel free to edit it for them selfs. (it does work, although.)
Start with empty inventory, food / tinderbox / logs in bank.
Supports Lobbys / Shark. Feel free to add more.

{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
var
BankFixed: Boolean;
LastLogLocation, LastITinderBoxBox, LastILogBox: Integer;
LastLogBox: TBox;
LastFishLocation: array[0..1] of TBox;
procedure DeclarePlayers;
begin
NumberOfPlayers(1);
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
BoxRewards := ['tem'];
Strings[0] := 'shark';
WorldInfo := [True, 100, False];
end;
end;
function BankScreen2: Boolean;
var
c: Integer;
begin
if (not LoggedIn) then
Exit;
c := GetTimeRunning + 5000;
repeat
Result := FindTextTPA(4106994, 20, 20, 22, 400, 45, 'Bank', upchars, Nothing);
if Result then
Exit;
Wait(50);
until ((GetTimeRunning > c));
Wait(RandomRange(100, 150));
end;
function GECenter: TPoint;
var
TPA, TPAA: TPointArray;
x, y: Integer;
begin
if (not LoggedIn) then
Exit;
FindColorsSpiralTolerance(MMCX, MMCY, TPAA, 195836, MMX1, MMY1, MMX2, MMY2, 0);
MiddleTPAEx(TPAA, x, y);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(23.75, 23.08);
FindColorsTolerance(TPA, 16120044, x - 60, y - 60, x + 60, y + 60, 3);
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
Result := MiddleTPA(TPA);
end;
function WalkToCenterofGE: Boolean;
var
GE: TPoint;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GE := GECenter;
Mouse(GE.x - 12, GE.y, 5, 5, True);
Wait(500);
Flag;
Wait(1000 + Random(500));
Result := True;
end;
function WalkToFirePlace: Boolean;
var
GE: TPoint;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GE := GECenter;
Mouse(GE.x - RandomRange(25, 40), GE.y - RandomRange(-5, 5), 5, 5, True);
Wait(500);
Flag;
Wait(1000 + Random(500));
Result := True;
end;
function OpenGEBank: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
x, y, i, m: Integer;
Points: TPoint;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 0.67);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 876163, MSX1, MSY1, MSX2, MSY2, 10);;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
ATPA := SplitTPAEx(TPA, 12, 7);
Points := MMToMS(GECenter);
if (Points.x = -1) or (Points.y = -1) then
Points := Point(MSCX + 30, MSCY);
SortATPAFromFirstPoint(ATPA, Point(Points.x - 50, Points.y - 5));
for i := 0 to High(ATPA) do
begin
if (MiddleTPAEx(ATPA[i], x, y)) then
begin
MMouse(x, y, 5, 5);
if (WaitUptext('to Ba', 600)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if (WaitOptionMultiEx(['ank'], 'action', ClickLeft, 2000)) then
begin
MarkTime(m);
while (not BankScreen2) and (not TimeFromMark(m) > 7000) do
Wait(100);
Wait(150 + Random(51));
Result := BankScreen2;
if (Result) then
Deposit(3, 28, True);
Break;
end else
begin
WaitOption('ance', 5000);
Continue;
end;
end else
Continue;
end else
Continue;
end;
end;
procedure FixOurBank;
begin
if (not LoggedIn) then
Exit;
if (BankFixed) then
Exit;
BankFixed := True;
FixBankTab;
FixBank;
end;
function WithDrawLogs: Boolean;
var
Logs, i, x, y: Integer;
OurBox: TBox;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
Logs := DTMFromString('78DA63FCC6C8C0B01188918085A120C37F200D12FD0F048C9F80ACBDA86A181898C0244C94F13990B59D809A3F40D64E026A5881FCAD04D480F8EB08A8F90164ED26A0E635236173FE03593BF0AB01008FD812C0');
if (FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := True;
try
FreeDTM(Logs);
except
end;
Exit;
end;
if (LastLogLocation > 0) then
if (FindDTM(Logs, x, y, LastLogBox.x1, LastLogBox.y1, LastLogBox.x2, LastLogBox.y2)) then
begin
MouseBox(OurBox.x1, OurBox.y1, OurBox.x2, OurBox.y2, 3);
if (WaitUptext('ogs', 500)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Result := True;
Wait(500 + Random(101));
try
FreeDTM(Logs);
except
end;
Exit;
end;
end;
for i := 1 to 40 do
begin
OurBox := BankIndexToMSBox(i);
if (FindDTM(Logs, x, y, OurBox.x1, OurBox.y1, OurBox.x2, OurBox.y2)) then
begin
MouseBox(x - 10, y - 10, x + 10, y + 10, 3);
if (WaitUptext('ogs', 500)) then
begin
LastLogLocation := i;
with LastLogBox do
begin
x1 := OurBox.x1 + 10;
y1 := OurBox.y1 + 10;
x2 := OurBox.x2 - 10;
y2 := OurBox.y2 - 10;
end;
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Wait(500 + Random(101));
Result := True;
try
FreeDTM(Logs);
except
end;
Exit;
end else
Continue;
end else
Continue;
end;
try
FreeDTM(Logs);
except
end;
end;
function WithTinderBox: Boolean;
var
Tinderbox, i, x, y: Integer;
OurBox: TBox;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
Tinderbox := DTMFromString('78DA63DCC9C0C0F091010518EBB033FC07D28C40FC1F0818D701195F19D00013986484F2183700899F04D46C0312BF09A8390824BE13507314487C26A0660F11EE390224DE1250B306487CC2AF0600A9BD149F');
if (FindDTM(Tinderbox, x, y, MIx1, MIy1, MIx2, MIy2)) then
begin
Result := True;
try
FreeDTM(Tinderbox);
except
end;
Exit;
end;
for i := 1 to 40 do
begin
OurBox := BankIndexToMSBox(i);
if (FindDTM(Tinderbox, x, y, OurBox.x1, OurBox.y1, OurBox.x2, OurBox.y2)) then
begin
MouseBox(x - 10, y - 10, x + 10, y + 10, 3);
if (WaitUptext('erbox', 500)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Wait(3000 + Random(1001));
Result := True;
try
FreeDTM(Tinderbox);
except
end;
Exit;
end else
Continue;
end else
Continue;
end;
try
FreeDTM(Tinderbox);
except
end;
end;
function WithDrawFish(Fish: string): Boolean;
var
i, x, y, ii: Integer;
OurBox: TBox;
FishInfo: TVariantArray;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
case (Lowercase(Fish)) of
'shark': FishInfo := [DTMFromString('78DA63B465646038CC8002B2D3D319FE0369A00CC37F2060D407B24E31A0012630C908E5311A03591709A8F104B22E1150E34D841A7720EB007E35007E320C8D'), 0, 'aw s'];
'lobster': FishInfo := [DTMFromString('78DA634C64606038C48002FC742518FE03694620FE0F048C2140C6290634C0042619A13CC62C207194809A74207181809A18207186809A6820719A801A909B0F13509301240E12E12F027E07009B33101A'), 1, 'aw l'];
end;
ii := FishInfo[1];
if (LastFishLocation[ii].x1 > 0) then
if (FindDTM(FishInfo[0], x, y, LastFishLocation[ii].x1, LastFishLocation[ii].y1, LastFishLocation[ii].x2, LastFishLocation[ii].y2)) then
begin
MouseBox(LastFishLocation[ii].x1, LastFishLocation[ii].y1, LastFishLocation[ii].x2, LastFishLocation[ii].y2, 3);
if (WaitUptext(FishInfo[2], 500)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if (WaitOptionMultiEx(['ll'], 'action', ClickLeft, 2000)) then
begin
Wait(550 + Random(51));
Result := True;
try
FreeDTM(FishInfo[0]);
except
end;
Exit;
end else
WaitOption('ance', 5000);
Exit;
end;
end;
for i := 1 to 40 do
begin
OurBox := BankIndexToMSBox(i);
if (FindDTM(FishInfo[0], x, y, OurBox.x1, OurBox.y1, OurBox.x2, OurBox.y2)) then
begin
MouseBox(x - 10, y - 10, x + 10, y + 10, 3);
if (WaitUptext(FishInfo[2], 500)) then
begin
with LastFishLocation[ii] do
begin
x1 := OurBox.x1;
y1 := OurBox.y1;
x2 := OurBox.x2;
y2 := OurBox.y2;
end;
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if (WaitOptionMultiEx(['ll'], 'action', ClickLeft, 2000)) then
begin
Wait(550 + Random(51));
Result := True;
try
FreeDTM(FishInfo[0]);
except
end;
Exit;
end else
begin
WaitOption('ance', 5000);
Continue;
end;
Exit;
end else
Continue;
end else
Continue;
end;
try
FreeDTM(FishInfo[0]);
except
end;
end;
function ManageBanking: Boolean;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
if (WalkToCenterofGE) then
begin
if (not OpenGEBank) then
begin
if (WalkToCenterofGE) then
if (OpenGEBank) then
if (WithTinderBox) then
if (WithDrawLogs) then
if (WithDrawFish(Players[CurrentPlayer].Strings[0])) then
Result := True;
end else
if (WithTinderBox) then
if (WithDrawLogs) then
if (WithDrawFish(Players[CurrentPlayer].Strings[0])) then
Result := True;
if (not Result) then
Logout;
CloseBank;
end;
end;
function GetAnimation: Integer;
var
I : Integer;
begin
I := SmartGetFieldObject(0, 'cn.n');
Result := SmartGetFieldInt(I, 'mb');
SmartFreeObject(I);
if (Result = -1) then
Result := 0;
end;
function FindFire(var _Point: TPoint): Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
_Box: TBox;
i: Integer;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.08, 0.64);
FindColorsTolerance(TPA, 1661302, MSX1, MSY1, MSX2, MSY2, 20);
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
ATPA := SplitTPAEx(TPA, 25, 30);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
for i := 0 to High(ATPA) do
begin
_Box := GetTPABounds(ATPA[i]);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.27, 1.35);
if (FindColorsTolerance(TPA, 6736618, _Box.x1 - 5, _Box.y1 - 5, _Box.x2 + 5, _Box.y2 + 5, 15)) then
begin
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
Result := Length(TPA) >= 10;
if (Result) then
begin
_Point := MiddleTPA(TPA);
MMouse(_Point.x, _Point.y, 2, 2);
GetMousePos(_Point.x, _Point.y);
if (not WaitUptext('Fire', 500)) then
Continue;
Exit;
end;
end else
Continue;
end;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function FindTinderBox(var i: Integer): Boolean;
var
ii, x, y, Tinderbox: Integer;
_Box: TBox;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GameTab(tab_Inv);
Tinderbox := DTMFromString('78DA63DCC9C0C0F091010518EBB033FC07D28C40FC1F0818D701195F19D00013986484F2183700899F04D46C0312BF09A8390824BE13507314487C26A0660F11EE390224DE1250B306487CC2AF0600A9BD149F');
if (LastITinderBoxBox > 0) then
if (ExistsItem(LastITinderBoxBox)) then
begin
_Box := InvBox(LastITinderBoxBox);
if (FindDTM(Tinderbox, x, y, _Box.x1, _Box.y1, _Box.x2, _Box.y2)) then
begin
i := LastITinderBoxBox;
Result := True;
try
FreeDTM(Tinderbox);
except
end;
Exit;
end;
end;
for ii := 1 to 28 do
begin
if (ExistsItem(ii)) then
begin
_Box := InvBox(ii);
if (FindDTM(Tinderbox, x, y, _Box.x1, _Box.y1, _Box.x2, _Box.y2)) then
begin
i := ii;
LastITinderBoxBox := ii;
Result := True;
Break;
end;
end;
end;
try
FreeDTM(Tinderbox);
except
end;
end;
function FindLog(var i: Integer): Boolean;
var
ii, x, y, Logs: Integer;
_Box: TBox;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GameTab(tab_Inv);
Logs := DTMFromString('78DA63FCC6C8C0B01188918085A120C37F200D12FD0F048C9F80ACBDA86A181898C0244C94F13990B59D809A3F40D64E026A5881FCAD04D480F8EB08A8F90164ED26A0E635236173FE03593BF0AB01008FD812C0');
if (LastILogBox > 0) then
if (ExistsItem(LastILogBox)) then
begin
_Box := InvBox(LastILogBox);
if (FindDTM(Logs, x, y, _Box.x1, _Box.y1, _Box.x2, _Box.y2)) then
begin
i := LastILogBox;
Result := True;
try
FreeDTM(Logs);
except
end;
Exit;
end;
end;
for ii := 1 to 28 do
begin
if (ExistsItem(ii)) then
begin
_Box := InvBox(ii);
if (FindDTM(Logs, x, y, _Box.x1, _Box.y1, _Box.x2, _Box.y2)) then
begin
i := ii;
LastILogBox := ii;
Result := True;
Break;
end;
end;
end;
try
FreeDTM(Logs);
except
end;
end;
function FindFish(var i: Integer; Fish: string): Boolean;
var
ii, x, y: Integer;
_Box: TBox;
FishInfo: Integer;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GameTab(tab_Inv);
case (Lowercase(Fish)) of
'shark': FishInfo := DTMFromString('78DA63B465646038CC8002B2D3D319FE0369A00CC37F2060D407B24E31A0012630C908E5311A03591709A8F104B22E1150E34D841A7720EB007E35007E320C8D');
'lobster': FishInfo := DTMFromString('78DA634C64606038C48002FC742518FE03694620FE0F048C2140C6290634C0042619A13CC62C207194809A74207181809A18207186809A6820719A801A909B0F13509301240E12E12F027E07009B33101A');
end;
for ii := 1 to 28 do
begin
if (ExistsItem(ii)) then
begin
_Box := InvBox(ii);
if (FindDTM(FishInfo, x, y, _Box.x1, _Box.y1, _Box.x2, _Box.y2)) then
begin
i := ii;
Result := True;
Break;
end;
end;
end;
try
FreeDTM(FishInfo);
except
end;
end;
function MakeFire: Boolean;
var
iT, iL, iFF: Integer;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GameTab(tab_Inv);
if (FindTinderBox(iT)) then
if (FindLog(iL)) then
if (FindFish(iFF, Players[CurrentPlayer].Strings[0])) then
begin
MouseItem(iT, True);
if (Random(3) = 0) then
Wait(100 + Random(101));
MouseItem(iL, True);
Wait(1000 + Random(500));
while (GetAnimation <> 0) do
Wait(10);
Wait(1500 + Random(501));
Result := True;
end;
if (not Result) then
Logout;
end;
function CookFish: Boolean;
var
mClick: TPoint;
iFF, x, y, m: Integer;
begin
if (not LoggedIn) then
Exit;
FindNormalRandoms;
GameTab(tab_Inv);
if (FindFish(iFF, Players[CurrentPlayer].Strings[0])) then
begin
MouseItem(iFF, True);
if (Random(3) = 0) then
Wait(100 + Random(101));
if (FindFire(mClick)) then
begin
Mouse(mClick.x, mClick.y, 0, 0, True);
if (Random(2) = 0) then
Wait(Random(1000));
MouseBox(218, 388, 294, 469, 3);
if (WaitUpText('Cook', 4000)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if (WaitOptionMultiEx(['ll'], 'action', ClickLeft, 2000)) then
begin
MarkTime(m);
Wait(1000 + Random(2000));
repeat
if (GetAnimation <> 0) then
MarkTime(m);
until (TimeFromMark(m) > 3000) or (not ExistsItem(28));
Result := True;
end;
end;
end;
end;
end;
function ManageCooking: Boolean;
begin
if (not LoggedIn) then
Exit;
if (WalkToFirePlace) then
if (MakeFire) then
if (CookFish) then
Result := True;
end;
begin
Smart_Server := 144;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
if (not LoggedIn) then
LoginPlayer;
MakeCompass('N');
SetAngle(True);
repeat
ManageBanking;
ManageCooking;
until (not LoggedIn);
end.inb4noobs:
Yeah, I know, this script "sucks". Its a 10 minute piece of work that got me 99 cooking, and I'm not saying use this, but anyone can feel free to edit it for them selfs. (it does work, although.)