Chris
2012-01-18 11:22:43
6 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
HTML, XHTML, MySQL, PHP(little bit) and JavaScript
Are you a member of any other communities?
Nope :p
Tell us about yourself…
From: Chris
I am Chris, I live in Holland, I will finish the Senior General Secondary Education (if thats a correct translation from dutch) this year, I am 16 year old (yes I started playing RuneScape when I was 10) and erm.. what else do you want to know? Ask me :p
Please show us one (or multiple) of your scripts.
Some stuff to know:
I have made this script to get 99 cooking, it already got me from 70 to 94 and im still using it, once I have reached 99 I will release it in public and add stuff like sharks and monkfish :p
{
Al Kharid cooking script by Chris J (my first script)
Instructions:
* Have your fish in the third bank thingy.
* Make sure you are at the Al Kharid bank, next to the Bank Booth
* Change the ToDo=0 to the amount of fish you want to be cooked
* Change the "Fish2Cook" number to the number of the fish you want to cook :)
* Fill your username and password in below or log in yourself
Good luck achieving 99 cooking!
}
program AKCookerByChrisJ;
{.Include SRL/SRL/Misc/smart.simba}
{.include SRL/SRL.simba}
Const
{
1 = Salmon
2 = Tuna
3 = Lobster
4 = Swordfish
5 = Plain Pizza
}
Fish2Cook = 2; // What fish are you cooking?
ToDo = 3750; // How much fish do you want to cook?
Time2Run = 0; // The maximum time you want to cook before switching players
BankRow = 0; // For 'ToDo' and 'Time2Run', 0 = unlimited :)
BankCol = 2;
{ while isMoving do
wait(200+random(200)); }
var LoadsDone, Raw_Fish, Cooked_Fish, StartTime:Integer;
MyFish:string;
NextAcc:Boolean;
procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := ''; // Your Username
Players[0].Pass := ''; // Your Password
Players[0].Pin := ''; // Your bank PIN (if you have one)
Players[0].Active := True;
{
Players[1].Name := ''; // Your second account's Username
Players[1].Pass := ''; // Your second account's Password
Players[1].Pin := ''; // Your second account's bank PIN
Players[1].Active := True;
}
end;
function GetRunTime:string;
var
RunTime, MinutesRan, SecondsRan, SecondsMinusMinutes:Integer;
TempVar:string;
begin
RunTime := GetSystemTime - StartTime;
SecondsRan := RunTime / 1000;
if RunTime < 60000 then
begin
result := 'Ran for: ' + IntToStr(RunTime / 1000) + ' seconds.';
end;
if RunTime > 60000 then
begin
MinutesRan := (RunTime / 1000)/60;
TempVar := IntToStr(MinutesRan);
SecondsMinusMinutes := StrToInt(TempVar);
SecondsMinusMinutes := SecondsRan - (SecondsMinusMinutes * 60);
result := 'Ran for: ' + IntToStr(MinutesRan) + ' minutes and '
+ IntToStr(SecondsMinusMinutes) + ' seconds.';
end;
end;
function GetMinutesRan:Integer;
var
RunTime:Integer;
begin
RunTime := GetSystemTime - StartTime;
RunTime := RunTime / 1000;
result := RunTime;
end;
function GetRangePos:Tpoint;
var
TPA:TPointArray;
A:TIntegerArray;
ATPA:T2DPointArray;
I, H, x, y, L, R:Integer;
Tp:Tpoint;
begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1450139, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAtoATPA(TPA, 65);
If Length(ATPA) = 0 then
begin
exit;
end;
H := High(ATPA);
writeln('TPAs found: ' + inttostr(H + 1));
SetArrayLength(A, H + 1);
for I := 0 to H do
begin
MiddleTPAEx(ATPA[I], x, y);
L := High(ATPA[I]) + 1;
A[I] := L;
writeln('TPA: ' + inttostr(I) + ', co-ords: ' + inttostr(x) +
', ' + inttostr(y) + ' Tpoints found in this TPA: ' + inttostr(L));
end;
R := 0;
for i := 0 to High(a) do
if (a[R] < a[i]) then
R := i;
writeln(R);
writeln('TPA ' + inttostr(R) + ' is the range.');
MiddleTPAEx(ATPA[R], x, y);
writeln('found range');
Tp.x := x;
Tp.y := y;
result := Tp;
end;
function LoadFishDetails:Boolean;
begin
case Fish2Cook of
1:
begin
MyFish := 'almon';
Raw_Fish := DTMFromString('mggAAAHicY2NgYBAAYkkgFgJiLiBmBWJhIOaD8kHi3FB1HEA8OSYISDJhYF4G7IARB4YAALByAg8=');
Cooked_Fish := DTMFromString('mlwAAAHicY2dgYOAHYnEo5gZidiDmAWIRIBYEYj4kMQEglgRiISDeYSUFJJmwYl4giQsz4sFQAADhwAJe');
end;
2:
begin
MyFish := 'una';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYOACYmkg5gFiQSCWBWJJIBYGYkUgPrJ7N5BkgmMOBlTAiIZBAACjUwL9');
Cooked_Fish := DTMFromString('mlwAAAHicY2dgYBACYhEglgBiaSDmAWJ2IBYGYn6onABUjBUqzwbEyRFhQJIJK+ZlwA0Y8WAoAADSTwIJ');
end;
3:
begin
MyFish := 'obster';
Raw_Fish := DTMFromString('mlwAAAHicY2dgYBACYmEgFodiEJ8diFmAmBfK5gRiESCWgfJBanLsFIEkE1YM0ocLMOLBUAAAuf8ByQ==');
Cooked_Fish := DTMFromString('mlwAAAHicY2dgYBABYkkoBrF5gJgbiAWgWAKIeaFiIDlhIJYF4lWhIBkmrBikHhdgxIOhAADm9wI8');
end;
4:
begin
MyFish := 'ordfish';
Raw_Fish := DTMFromString('mggAAAHicY2NgYBACYikozQnE3EAsBsR8QMwPFeOFigkD8Y6mQ0CSCQOD1GADjDgwBAAA8hYC5A==');
Cooked_Fish := DTMFromString('mggAAAHicY2NgYOAGYlEglgNiCSAWAGJpIBaBsvmBmAOI2aFi06IXAkkmDMwKJLFhRhwYAgDdtwKe');
end;
5:
begin
MyFish := 'izza';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYBACYlUgFgFiSSAWB2JBIGYDYhkgXrFgIpBkgmMuBlTAiIZBAACS+gKg');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYOAHYhkgVgRiUSAWB2IJIOYFYlYg7qyJBpJMcMzFgAoY0TAIAAB4QgIb');
end
end;
result := True;
end;
function Finished:boolean;
var x, y:Integer;
begin
if FindDTM(Cooked_Fish, x, y, 560, 211, 596, 243) then
begin
Inc(LoadsDone);
{ writeln(' ');
writeln('Loads Done: ' +inttostr(LoadsDone));
writeln(' '); }
if ToDo = 0 then
begin
result := False;
end;
if ToDo > 1 then
begin
if (LoadsDone * 28) > ToDo then
begin
result := True;
end else
result := False;
end;
end else
if Time2Run > 1 then
begin
if GetMinutesRan > Time2Run then
begin
writeln('Time is up, switching to next player.');
result := True;
end;
end;
end;
procedure customdepositAll;
//var x, y, DepositBMP:integer;
begin
DepositAll;
{DepositBMP:= BitmapFromString(14, 12, 'meJxd0cELAUEUx3EHbdkWxcGSyJ' +
'YtN+HgQGnZwyZKUm5Kubi6OTr6F/0zvvrlNU29pjczn5n3Zrc434p' +
'/lIOgPtoT1UZS6cza2aN/ePd2LyJeXj3WnBx/4/Qi3FrcJbvbpzG2' +
'AOxGyZqEI6yQYwjuN8nuJj2RhIM5gHJqgxHmSlYYlYOZgknAJG71W' +
'h5Z6FqqGGYK027+WREkulOYF6l5sBkxq66A0aG8yzgIc6WeQ5N8KL' +
'coUtiTMH6BFVXdUpgyxsOxJ3WnSWvSlTSp7/kFAJFnpw==');
if FindBitmapToleranceIn(DepositBMP, x, y, 342, 291, 391, 330, 25) then
begin
FreeBitmap(DepositBMP);
x := x + random(15);
y := y + random(14);
Mouse(x, y, -4, -4, True);
if BankScreen then
begin
Writeln('Deposited Inventory');
end;
end else
begin
FreeBitmap(DepositBMP);
Writeln('DepositAll failed');
Writeln('RuneScape got updated, logging and terminating');
LogOut;
NextPlayer(False);
end; }
end;
procedure SetUp;
begin
Smart_Members := False;
Smart_Server := 1;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
if LoadFishDetails then
writeln('Loaded the Fish DTMs, starting in 2 seconds.');
MouseSpeed := 12 + random(2);
wait(2000 + random(500));
StartTime := GetSystemTime - 2000;
if (not(LoggedIn)) then
begin
Loginplayer;
wait(1200 + random(400));
end;
end;
procedure FindRandoms;
begin
if (not(LoggedIn)) then
begin
Loginplayer;
end;
FindNormalRandoms;
end;
procedure Bank;
var x, y, kill:Integer;
Bank_Booth:TPointArray;
begin
if (FindDTM(Raw_Fish, x, y, 553, 211, 598, 248)) then
begin
Exit;
end;
MakeCompass('n');
FindRandoms;
while isMoving do
wait(200+random(200));
{ if (not(BankScreen or PinScreen)) then
begin
wait(500 + random(400));
mouse(217, 130, 3, 3, False);
WaitOptionMulti(['se-qu','uickly','ancel'], 1500);
wait(500 + random(300));
findcolortolerance(Bank_Booth, x, 9350042, 144, 112, 229, 189, 20);
end; }
begin
MouseSpeed := 16 + random(2);
if FindColorsSpiralTolerance(MSCX, MSCY, Bank_Booth, 9350042, 144, 112, 229, 178, 41) then
begin
writeln('Found our color ' + IntToStr(Length(Bank_Booth)) + ' times in our Bank_Booth array');
MiddleTPAEx(Bank_Booth, x, y);
mouse(x, y, 3, 3, False);
writeln('right clicked mid TPA');
wait(500 + random(100));
//mouse(x + random(5), y + 40 + random(10), 3, 3, True);
WaitOptionMulti(['ank bank','uickly','ancel'], 1500);
wait(1800 + random(300));
end;
end;
if (BankScreen or PinScreen) then
begin
writeln('bank is open');
end else
begin
if FindColorsTolerance(Bank_Booth, 9350042, 144, 112, 229, 178, 50) then
begin
writeln('Found our color ' + IntToStr(Length(Bank_Booth)) + ' times in our Bank_Booth array');
MiddleTPAEx(Bank_Booth, x, y);
mouse(x + 15, y, 3, 3, False);
writeln('right clicked mid TPA (second try)');
wait(700 + random(100));
mouse(x + random(5), y + 40 + random(10), 3, 3, True);
//WaitOptionMulti(['se-qu','ank','ancel'], 1500);
wait(1800 + random(300));
end;
if (not(BankScreen or PinScreen)) then
begin
wait(1000);
if (not(BankScreen or PinScreen)) then
begin
writeln('Couldnt open bank, Logging out and terminating script');
Logout;
NextPlayer(False);
NextAcc := True;
Exit;
end;
end;
end;
wait(500 + random(200));
if PinScreen then
begin
InPin(Players[0].Pin);
end;
if invcount > 0 then
begin
CustomDepositAll;
writeln('deposited full inventory');
Wait(200 + random(150));
end;
//x := 129 + random(26);
//y := 99 + random(20);
//mouse(x , y, 0, 0, False);
//wait(500 + random(300));
//Mouse(x, y + 104 + random(20), 15, 0, True);
repeat
inc(kill);
wait(50);
until (withdraw(BankCol,BankRow,0) or (kill = 20))
//Wait(300 + random(100));
MakeCompass('N');
MouseSpeed := 15;
// wait(700+ random(300));
//if (not(FindDTM(Raw_Fish, x, y, 553, 211, 598, 248))) then
//begin
//writeln('couldnt find raw fish, banking again');
//FindRandoms;
{if findSymbol(x, y, 'bank') then
mouseFlag(x, y, randomRange(-10, 10), randomRange(-12, 12), 0);
Wait(6900 + random(300)); }
//Bank;
//end;
end;
procedure Cook;
var x, y, kill, RunTime:Integer;
Tp:TPoint;
begin
if NextAcc then
Exit;
FindRandoms;
MouseSpeed := 19 + random(2);
while isMoving do wait(200+random(200));
Tp := GetRangePos;
x := Tp.x;
y := Tp.y;
mouse(x, y, 4, 4, True);
MouseSpeed := 11 + random(2);
MMouse(351 + random(151), 289 + random(43), 3, 3);
repeat
inc(kill);
wait(150 + random(100));
until (kill=20) or (FindDTM(Raw_Fish, x, y, 218, 393, 281, 434))
if (kill>19) then
begin
MouseSpeed := 12 + random(2);
invmouse(1,1);
wait(300 + random(200));
MouseSpeed := 19 + random(2);
Tp := GetRangePos;
x := Tp.x;
y := Tp.y;
mouse(x, y, 4, 4, True);
MouseSpeed := 11 + random(2);
end;
if FindDTM(Raw_Fish, x, y, 218, 393, 281, 434) then
begin
x := x + random(10);
y := y + random(10);
mouse(x, y, 0, -3, true);
writeln('clicked on the "cook all" thingy');
wait(800 + random(450));
writeln('I am cooking :)');
writeln(' ');
RunTime := GetSystemTime - StartTime;
writeln(GetRunTime);
writeln('Loads Done: ' +inttostr(LoadsDone));
writeln(' ');
kill := 0;
wait(4000);
end else
begin
wait(4000);
end;
if (FindDTM(Raw_Fish, x, y, 218, 393, 281, 434)) then
begin
x := x + random(10);
y := y + random(10);
mouse(x, y, 0, -3, true);
kill := -10;
end;
Wait(56000 + random(500));
FindRandoms;
MMouse(565 + random(111), 96 + random(68), 3, 3);
repeat
wait(400 + random(100));
inc(kill);
until (kill=25) or FindDTM(Cooked_Fish, x, y, 682, 424, 724, 463);
FindRandoms;
MouseSpeed := 13 + random(2);
end;
procedure ToBank;
begin
if NextAcc then
Exit;
FindRandoms;
writeln('going to bank');
mouse(613,147,0,-3,true);
Wait(6700 + random(300));
end;
procedure ToRange;
var KebabBMP, x, y, W, W2, I:Integer;
FoundBMP:Boolean;
BitmapsFound:TPointArray;
begin
if NextAcc then
Exit;
wait(400 + random(100));
FindRandoms;
SetArrayLength(BitmapsFound, 4);
for I := 0 to 3 do
begin
case I of
0:
begin
KebabBMP := BitmapFromString(5, 4, 'meJxjZAxXqs6CIE3tH0CSvZcHiIBs' +
'IGJkDBe2TgGSQGSf0B9RuwaZBAAZmBNk');
if (FindBitmapToleranceIn(KebabBMP, x, y, 590, 5, 685, 66, 15)) then
begin
BitmapsFound[0] := IntToPoint(x, y);
end else
FoundBMP := False;
FreeBitmap(KebabBMP);
end;
1:
begin
KebabBMP := BitmapFromString(4, 5, 'meJxjZAwXtk45AAZMTC2MMK59Qn9E' +
'7Roge8GCBUAGkAthA0kIAwgA0mIZBQ==');
if (FindBitmapToleranceIn(KebabBMP, x, y, 590, 5, 685, 66, 15)) then
begin
BitmapsFound[1] := IntToPoint(x, y);
end else
FoundBMP := False;
FreeBitmap(KebabBMP);
end;
2:
begin
KebabBMP := BitmapFromString(4, 5, 'meJw7cIAw4FH0w4oAqfQe2Q==');
if (FindBitmapToleranceIn(KebabBMP, x, y, 590, 5, 685, 66, 15)) then
begin
BitmapsFound[2] := IntToPoint(x, y);
end else
FoundBMP := False;
FreeBitmap(KebabBMP);
end;
3:
begin
KebabBMP := BitmapFromString(5, 4, 'meJwTtk6RjV4jbJ0CRDyKfsKo3AMH' +
'DqBxgWABDAAAK08Wzg==');
if (FindBitmapToleranceIn(KebabBMP, x, y, 590, 5, 685, 66, 15)) then
begin
BitmapsFound[3] := IntToPoint(x, y);
end else
FoundBMP := False;
FreeBitmap(KebabBMP);
end;
end;
end;
BitmapsFound := ClearTPAFromTPA(BitmapsFound, [Point(0, 0)]);
MiddleTPAEx(BitmapsFound, x, y);
mouse(x - random(3), y + random(5), 0, 0,true);
writeln('clicked between icons');
W := 1000 + random(4000);
W2 := (5000 - W);
wait(W);
invmouse(1,1);
MMouse(random(MSX2), random(MSY2), 3, 3);
Wait(W2 + 1500 + random(300));
// almost arrived at range ;)
if (not(FindDTM(Raw_Fish, x, y, 682, 424, 724, 463))) then
begin
writeln('couldnt find raw fish, going back to bank');
FindRandoms;
ToBank;
Bank;
ToRange;
end;
end;
begin
SetUp;
repeat
Bank;
ToRange;
Cook;
ToBank;
until Finished or NextAcc
writeln('Cooked '+inttostr(ToDo)+' Fishes, starting on next account.');
logout;
NextAcc := False;
NextPlayer(False);
LoadsDone := 0;
StartTime := GetSystemTime;
LogInPlayer;
repeat
Bank;
ToRange;
Cook;
ToBank;
until Finished
end.