inferno
2006-05-26 13:19:44
—————————————————————————————————————————————————————————–
SRL Cooker
By Inferno
—————————————————————————————————————————————————————————–
Now every sub-forum has a script :)
A simple quick script to cook any raw food at the Al'Kharid range.
Please post any bugs, progress reports or comments.
—————————————————————————————————————————————————————————–
Instructions.
—————————————————————————————————————————————————————————–
- In script.
—————————————————————————————————————————————————————————–
Known Issues.
—————————————————————————————————————————————————————————–
- Doesn't work too well with shrimps or anchovies.
- Tell me.
—————————————————————————————————————————————————————————–
Version History:
—————————————————————————————————————————————————————————–
v 1.00 - First release.
—————————————————————————————————————————————————————————–
General Notice:
—————————————————————————————————————————————————————————–
As always, you use this script at your own risk. I'm not responsible for any of you getting hit by the bannage stick. You take a chance when you auto so don't come crying to me if you get banned.
- Scar Resource Library rev 2+
- NAME : Al'Kharid Cooker.
- WRITER : Inferno.
- CATEGORY : Cooking.
- DESCRIPTION : Cooks any raw food at Al'Kharid.
- USAGE : Start in Al'Kharid bank.
- AUTOCOLOR : No, one colour setup.
Script in tags because I don't have enough attatchment allowance left:
{=========================================================================]
[ ]
[ NAME : SRL Cooker. ]
[ WRITER : Inferno ]
[ CATEGORY : Cooking ]
[ DESCRIPTION : Cooks food in Al'Kharid ]
[ USAGE : To cook your food ]
[ AUTOCOLOR : No, one colour setup ]
[ NOTES : None ]
[ ]
[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ 1. Use Runescape with Low Detail, screen brightness on Normal. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames, Passwords etc in DeclarePlayers. ]
[ 4. Set HowManyPlayers inside DeclarePlayers. ]
[ 5. Put your food to cook in first bank slot. ]
[ 6. Start script. ]
[=========================================================================}
Program Cooker;
{.Include Srl/Srl.Scar}
Var
Make10, WithdrawX, TextStar, BankColour, Use,
BreakTime, MustBreak, FoodTotal, Xy, Levels : Integer;
Const
StartPlayer = 0; // Player to start with
RoundTime = 5; // Number of banks to switch players after.
CookPot = 270157; // Colour of the cooking symbol on minimap.
UseBenMouse = False;
Procedure DeclarePlayers;
Begin;
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active:=True;
End;
Procedure SwitchChars;
Begin;
Status('Switching teh player');
If(Players[CurrentPlayer].Banked >= RoundTime)Then
NextPlayer(True);
End;
Function LumbyCheck : Boolean;
Begin;
If(GetColor(30, 418) = 0)And(GetColor(72, 429) = 0)Then
Result := True;
End;
Procedure FindRandoms;
Begin
CloseWindow;
FindNormalRandoms;
If(Not(Loggedin))Then
Begin
Logout;
Exit;
End;
Wait(1);
If(LumbyCheck)Then
NextPlayer(False);
End;
Procedure FlagRand;
Begin;
While (FlagDistance > 4) Do
Begin
Wait(200);
FindRandoms;
End;
End;
Procedure Bitmaps;
Begin;
Make10 := BitmapFromString(15, 11, 'z78DA333040003724608017' +
'B86100EAAAC4EF1E371C8018338977D5E031999830193C26E30F9' +
'3C16332B5521D25EEA7350000E986DE3D');
TextStar := BitmapFromString(8, 6, 'z78DA3330C0062C90486' +
'2007EF516249294B887723351C501D8B236B1');
WithdrawX := BitmapFromString(6, 10, 'z78DA737343000324E086' +
'03E052439E2E5C6A70994F890BF1BB96BA2663AA01005AD75719');
Use := BitmapFromString(15, 9, 'z78DA333000013724608001F' +
'0CBE207A32653CB64371C80129389F1CB6073337E77E23701974B' +
'88311900606BB125');
Xy := BitmapFromString(6, 10, 'z78DA737373733330700393C8C00' +
'D49DC8D0835E4E9C2A50697F994B810BF6BA96B32A61A00D2E850' +
'91');
End;
Procedure Bank;
Begin
If(Not(LoggedIn))Then
Exit;
FindRandoms;
MarkTime(Mark);
Repeat
If(Not(LoggedIn))Then
Break;
OpenBankQuiet('akb');
Until((BankScreen)Or(TimeFromMark(Mark)>60000));
If(BankScreen)Then
Begin
Deposit(1, 28, 2);
FixBank;
Withdraw(1, 1, 28);
End;
CloseWindow;
Players[CurrentPlayer].Banked:= Players[CurrentPlayer].Banked+1;
End;
Procedure GetColours;
Begin
If(BankColour = 0)Then
BankColour := GetSymbolColor(X, Y, 'bank');
End;
Procedure WalkToCooker;
Begin
GetColours;
If(FindColorSpiral(X, Y, Cookpot, 563, 7, 713, 120))Then
Begin
Mouse(X + 3, Y, 3, 3, True);
Wait(200+Random(200));
FlagRand;
Wait(300+Random(100));
End;
End;
Procedure ClickRange;
Begin;
Wait(300+Random(300));
If(FindObj3(X, Y, 'ange', 1715930, 20))Or
(FindObj3(X, Y, 'ange', 1121681, 20))Then
Begin
Mouse(X, Y, 2, 2, False);
MarkTime(Mark);
End;
Repeat
Wait(250);
Until(FindBitmapIn(Use, X, Y, 5, 5, 747, 468))Or(TimeFromMark(Mark) > 10000);
ClickOption('Use', 1)
End;
Procedure WalkToBank; Forward;
Procedure Cook;
Var
Tries, FoodColour : Integer;
Begin
Tries := 0;
Repeat
FoodColour := GetColor(709, 230);
Mouse(584, 231, 4, 4, True);
Wait(300+Random(300));
ClickRange;
MarkTime(Mark);
Repeat
Wait(250);
FindRandoms;
Until((GetColor(147, 366) = 128)And(GetColor(305, 370) = 128))Or(TimeFromMark(Mark) > 10000);
Tries := Tries +1;
Until((GetColor(147, 366) = 128)And(GetColor(305, 370) = 128))Or(Tries >=3);
If(Tries >= 3)Then
Begin
WalkToBank;
WalkToCooker;
Cook;
End;
Mouse(245, 411, 3, 3, False);
MarkTime(Mark);
Repeat
Wait(250);
FindRandoms;
Until(FindBitmapToleranceIn(WithdrawX, X, Y, 12, 347, 512, 489, 15))Or
(FindBitmapToleranceIn(Xy, X, Y, 12, 347, 512, 489, 15))Or(TimeFromMark(Mark) > 3000);
If(TimeFromMark(Mark) > 3000)Then
Cook;
Mouse(X + 4, Y + 20, 0, 0, True);
MarkTime(Mark);
Repeat
Wait(250);
Until(Not(FindColorSpiralTolerance(X, Y, FoodColour, 566, 205, 738, 467, 5)))Or
((GetColor(147, 366) = 128)And(GetColor(305, 370) = 128))Or(TimeFromMark(Mark) > 60000);
If(GetColor(303, 444) = 16711680)Then
Begin
Levels := Levels+1;
Cook;
End;
End;
Procedure WalkToBank;
Begin
If(FindColorSpiral(X, Y, BankColour, 558, 4, 735, 170))Then
Begin
Mouse(X, Y, 3, 3, True);
Wait(200+Random(200));
FlagRand;
Wait(200+Random(200));
End Else
WriteLn('Could not find bank colour on minimap.');
End;
Procedure ProgressReport;
Begin;
ClearReport;
AddToReport('<=======Inferno`s Cooker V 1.0========>');
AddToReport('Worked for '+TimeRunning);
AddToReport('Cooked '+IntToStr(FoodTotal)+' pieces of food');
AddToReport('Gained '+IntToStr(Levels)+' levels');
AddToReport('<======================================>');
End;
Procedure TakeBreak;
Var
TimeTo : Integer;
Begin;
TimeTo:= Random(6);
If(TimeTo = 0)Then
Begin
Logout;
Status('5 Minute break');
Wait(300000+Random(120000));
BreakTime := 0;
LoginPlayer;
End Else
If(TimeTo = 1)Then
Begin
Logout;
Status('10 Minute break');
Wait(600000+Random(150000));
BreakTime := 0;
LoginPlayer;
End Else
If(TimeTo = 2)Then
Begin
Logout;
Status('20 Minute break');
Wait(1200000+Random(300000));
BreakTime := 0;
LoginPlayer;
End Else
If(TimeTo = 3)Then
Begin
Logout;
Status('30 Minute break');
Wait(1800000+Random(600000));
BreakTime := 0;
LoginPlayer;
End Else
If(TimeTo = 4)Then
Begin
Logout;
Status('45 Minute break');
Wait(2700000+Random(750000));
BreakTime := 0;
LoginPlayer;
End Else
If(TimeTo = 5)Then
Begin
Logout;
Status('One hour break');
Wait(3600000+Random(900000));
BreakTime := 0;
LoginPlayer;
End;
End;
(*Main EventLoop*)
Begin
SetUpSrl;
MouseSpeed := 25;
BenMouse := UseBenMouse;
SymbolAccuracy := 0.4;
DeclarePlayers;
CurrentPlayer:= StartPlayer; // CurrentPlayer = Array Index
Bitmaps;
ClearDebug;
ActivateClient;
Wait(1000);
If(LoggedIn)Then
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
If(Not(LoggedIn))Then
LoginPlayer;
SetChat('off', 1);
SetChat('off', 3);
Brightness('V');
Repeat
Repeat
Face('N');
Bank;
WalkToCooker;
Cook;
WalkToBank;
FoodTotal := FoodTotal + 27;
ProgressReport;
BreakTime := BreakTime + Random(3) + 1;
MustBreak := 120+Random(60);
If(BreakTime = MustBreak)Or(BreakTime > MustBreak)Then
Begin
TakeBreak;
BreakTime := 0;
End;
Until(Players[CurrentPlayer].Banked >= RoundTime);
SwitchChars;
If(Not(LoggedIn))Then
NextPlayer(False);
Until(False);
End.P.s - Tried using FindRange in SrlCooking but it doesn't work. ;)