SRL Archive - OSR Help

need help with cooking script


QAZ

2012-06-06 17:18:42

ok, well basically sorted everything with the script, all looked well. i ran the script and it went to the range used the food on the range, but it won't click the cook all option which comes up at the bottom


anybody know how to sort this, here's the script



program AlKharidCooker;
{$i SRL/SRL/Misc/smart.simba}
{$i SRL/SRL.simba}
Const



{============================================================================}
{ /"""" |"""" """|""" | | /"""\ }
{ \___ |___ | | | |__ / }
{ \ | | | | | }
{ ____/ |____ | \ _ /| | }
{============================================================================}
{} {}
{} Fish2Cook = 'tuna'; {}
{{ [anchovies, shrimps, trout, salmon, tuna, lobster, swordfish, pizza )}
{{ or shark] )}
{} {}
{} LoadsToDo = 0; // When to switch to the next player, or stop. {}
{} Time2Run = 0; // 0 = Stop when your out of raw food {}
{} {}
{} Username = 'USERNAME'; // Your RuneScape username {}
{} Password = 'PASSWORD'; // Password {}
{} Bank_Pin = 'Pin'; // And Bank Pin {}
{} {}
{} BankRow = 0; {}
{} BankCol = 2; {}
{} {}
{} SRLStats_Username = ''; {}
{} SRLStats_Password = ''; {}
{} {}
{============================================================================}



var LoadsDone, Raw_Fish, Cooked_Fish, StartTime, FishCooked, FishBurned, XpPerFish,
LoopKill:Integer;
MyFish, DoingATM, Fish:string;
NextAcc, IsFishBurned, AddToStats, OutOfFish:Boolean;


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := Username;
Players[0].Pass := Password;
Players[0].Pin := Bank_Pin;
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 GetMinutesRan:Integer;
var
RunTime:Integer;
begin
RunTime := GetSystemTime - StartTime;
RunTime := RunTime / 1000;
RunTime := RunTime / 60;
result := RunTime + 1;
end;


function GetRangePos(var Tp:TPoint):Boolean;
var
TPA, TPA2, TPA3:TPointArray;
A:TIntegerArray;
ATPA:T2DPointArray;
I, H, x, y, L, R:Integer;
begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1510000, MSX1, MSY1, MSX2, MSY2, 15);
//writeln('First TPA contains ' + inttostr(High(TPA)) + ' TPoints.');
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 2177098, MSX1, MSY1, MSX2, MSY2, 20);
//writeln('Second TPA contains ' + inttostr(High(TPA2)) + ' TPoints.');
FindColorsSpiralTolerance(MSCX, MSCY, TPA3, 5664130, MSX1, MSY1, MSX2, MSY2, 3);
//writeln('Third TPA contains ' + inttostr(High(TPA3)) + ' TPoints.');
TPA := CombineTPA(TPA, TPA2);
TPA := CombineTPA(TPA, TPA3);
//writeln('Combined TPA contains ' + inttostr(High(TPA)) + ' TPoints.');
if Length(TPA) = 0 then
begin
if FindObj(x, y, 'ange', 5400699, 15) then // 1581994 , 1450139



begin


wait(1200 + random(300));
result := True;
end else
result := False;
exit;
end;
ATPA := TPAtoATPA(TPA, 65);
H := High(ATPA);
SetArrayLength(A, H + 1);
for I := 0 to H do
begin
MiddleTPAEx(ATPA[I], x, y);
L := High(ATPA[I]) + 1;
A[I] := L;
end;
R := 0;
for i := 0 to High(a) do
if (a[R] < a[i]) then
R := i;
MiddleTPAEx(ATPA[R], x, y);
Tp.x := x;
Tp.y := y + 10;
result := True;
end;


function BankOpen(i: Integer):Integer;
begin
if BankScreen or PinScreen then
begin
Result := i - 1;
end else
result := 5;
end;


procedure IncVars;
begin
if IsFishBurned then
begin
stats_IncVariable('Food Burnt', 1);
IsFishBurned := False;
end else
begin
case Fish of
'Anchovies':
begin
stats_IncVariable('Anchovies Cooked', 1);
end;
'Shrimps':
begin
stats_IncVariable('Shrimp Cooked', 1);
end;
'Trout':
begin
stats_IncVariable('Trout Cooked', 1);
end;
'Salmon':
begin
stats_IncVariable('Salmon Cooked', 1);
end;
'Tuna':
begin
stats_IncVariable('Tuna Cooked', 1);
end;
'Lobster':
begin
stats_IncVariable('Lobster Cooked', 1);
end;
'Swordfish':
begin
stats_IncVariable('Swordfish Cooked', 1);
end;
'Pizza':
begin
//stats_IncVariable('Plain Pizza Cooked', 28);
end;
'Monkfish':
begin
stats_IncVariable('Monkfish Cooked', 1);
end;
'Shark':
begin
stats_IncVariable('Shark Cooked', 1);
end;
'Rocktail':
begin
stats_IncVariable('Rocktail Cooked', 1);
end;
end;
stats_IncVariable('Cooking EXP (Gained)', XpPerFish);
end;
end;


function LoadFishDetails:Boolean;
begin
case Fish of
'':
begin
writeln('You have not entered which fish you are going to cook, please fill it in and start the script again');
writeln('Terminating script..');
TerminateScript;
end;
'anchovies':
begin
MyFish := 'hovi';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYGBnYWD4z8zA8JMZQk9iZGCYD8TTgXgpEMfFJQNVMcExBwMqYETDIAAAu8oGsg==');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYBACYjkgFoTSkkAsAhXnAmJji2ggyQTHrAwQwArFjGgYBABavgGM');
XpPerFish := 30;
end;
'shrimps':
begin
MyFish := 'hrim';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYIgH4gwgLgTiFCC2BmJPILYAYgcgntreCCSZ4JiDARUwomEQAAAQ2gRM');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYDADYjsg9gdiVyC2AWJPILYCYgsgnpYkCiSZ4JiDARUwomEQAADGIAMj');
XpPerFish := 30;
end;
'trout':
begin
MyFish := 'rout';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYDAHYisgdoWyFYBYGYgloXjv1i1AkgmOORhQASMaBgEA1lsDnw==');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYOAFYmEglgZiLiBWAGIlIJYEYlkg7qoqB5JMcMzBgAoY0TAIAACB3AJP');
XpPerFish := 70;
end;
'salmon':
begin
MyFish := 'almo';
Raw_Fish := DTMFromString('mggAAAHicY2NgYBAAYkkgFgJiLiBmBWJhIOaD8kHi3FB1HEA8OSYISDJhYF4G7IARB4YAALByAg8=');
Cooked_Fish := DTMFromString('mlwAAAHicY2dgYOAHYnEo5gZidiDmAWIRIBYEYj4kMQEglgRiISDeYSUFJJmwYl4giQsz4sFQAADhwAJe');
XpPerFish := 90;
end;
'tuna':
begin
MyFish := 'una';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYOACYmkg5gFiQSCWBWJJIBYGYkUgPrJ7N5BkgmMOBlTAiIZBAACjUwL9');
Cooked_Fish := DTMFromString('mlwAAAHicY2dgYBACYhEglgBiaSDmAWJ2IBYGYn6onABUjBUqzwbEyRFhQJIJK+ZlwA0Y8WAoAADSTwIJ');
XpPerFish := 100;
end;
'lobster':
begin
MyFish := 'obst';
Raw_Fish := DTMFromString('mlwAAAHicY2dgYBACYmEgFodiEJ8diFmAmB5gRiESCWgfJBanLsFIEkE1YM0ocLMOLBUAAAuf8ByQ==');
Cooked_Fish := DTMFromString('mlwAAAHicY2dgYBABYkkoBrF5gJgbiAWgWAKIeaFiIDlhIJYF4lWhIBkmrBikHhdgxIOhAADm9wI8');
XpPerFish := 120;
end;
'swordfish':
begin
MyFish := 'ordf';
Raw_Fish := DTMFromString('mggAAAHicY2NgYBACYikozQnE3EAsBsR8QMwPFeOFigkD8Y6mQ0CSCQOD1GADjDgwBAAA8hYC5A==');
Cooked_Fish := DTMFromString('mggAAAHicY2NgYOAGYlEglgNiCSAWAGJpIBaBsvmBmAOI2aFi06IXAkkmDMwKJLFhRhwYAgDdtwKe');
XpPerFish := 140;
end;
'pizza':
begin
MyFish := 'izza';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYBACYlUgFgFiSSAWB2JBIGYDYhkgXrFgIpBkgmMuBlTAiIZBAACS+gKg');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYOAHYhkgVgRiUSAWB2IJIOYFYlYg7qyJBpJMcMzFgAoY0TAIAAB4QgIb');
XpPerFish := 143;
end;
'monkfish':
begin
MyFish := 'onkf';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYBACYlUgFgFiSSAWB2JBIGYDYhkgXrFgIpBkgmMuBlTAiIZBAACS+gKg');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYOAHYhkgVgRiUSAWB2IJIOYFYlYg7qyJBpJMcMzFgAoY0TAIAAB4QgIb');// redo both
XpPerFish := 150;

writeln('Monkfish is not working, please try some other kind of fish'); // says enough.
TerminateScript;
end;
'shark':
begin
MyFish := 'hark';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYBABYgkorQjEokDMDcQyQCwExJXFxUCSCY45GFABIxoGAQB6GwIl');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYBABYmEgVgRicSDmAWJRIOYDYhYgDnM0AJJMcMzBgAoY0TAIAABVMwFw');
XpPerFish := 210;
end;
'rocktail':
begin
MyFish := 'ockt';
Raw_Fish := DTMFromString('mWAAAAHicY2FgYBACYlUgFgFiSSAWB2JBIGYDYhkgXrFgIpBkgmMuBlTAiIZBAACS+gKg');
Cooked_Fish := DTMFromString('mWAAAAHicY2FgYBABYmEgVgRicSDmAWJRIOYDYhYgDnM0AJJMcMzBgAoY0TAIAABVMwFw'); // redo both
XpPerFish := 225;

writeln('Rocktail is not working, please try some other kind of fish'); // THIS.
TerminateScript;
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);
if LoadsToDo = 0 then
result := False;
if LoadsToDo >= 1 then
begin
if LoadsDone >= LoadsToDo then
begin
result := True;
end else
result := False;
end;
end;
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; // made this after the money pouch update,
begin // changed it to this after SRL got updated.
DepositAll;
end;


procedure PrintProggy; // proggys
var
CookPerHour:Integer;
begin
ClearDebug;
CookPerHour := FishCooked*GetTimeRunning/3600000;

writeln(' ');
writeln('~~~~~~~~~~ Al Kharid Cooker by Chris ~~~~~~~~~~');
writeln('Cooking Fish: ' + Fish2Cook + ' Cooked: ' + inttostr(FishCooked) + ',' + ' Burned: ' +
inttostr(FishBurned) + '.');
writeln(' Experience Gained: ' + inttostr(FishCooked * XpPerFish));
writeln(' Time Ran: ' + TimeRunning);
writeln(' Cooking per hour: ' + inttostr(CookPerHour));
writeln(' Experience per hour: ' + inttostr(CookPerHour*XpPerFish));
writeln(' Current Activity: ' + DoingATM);
if AddToStats then
begin
IncVars;
Stats_Commit;
end;
end;


procedure SetUp;
var a, b:string;
begin
Smart_Members := False;
Smart_Server := 1;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
if SRLStats_Username = '' then
begin
a := 'Anonymous';
end else
a := SRLStats_Username;
if SRLStats_Password = '' then
begin
b := 'anon1337';
end else
b := SRLStats_Password;
SetupSRLStats(600, a, b);
DeclarePlayers;
Fish := LowerCase(Fish2Cook);
AddOnTerminate('FreeDTMs');
LoadFishDetails;
MouseSpeed := 12 + random(2);
DoingATM := 'Setting up';
//wait(2000 + random(500));
PrintProggy;
case Fish of
'anchovies': Fish := 'Anchovies';
'shrimps': Fish := 'Shrimps';
'trout': Fish := 'Trout';
'salmon': Fish := 'Salmon';
'tuna': Fish := 'Tuna';
'lobster': Fish := 'Lobster';
'swordfish': Fish := 'Swordfish';
'pizza': Fish := 'Pizza';
'monkfish': Fish := 'Monkfish';
'shark': Fish := 'Shark';
'rocktail': Fish := 'Rocktail';
end;
if (not(LoggedIn)) then
begin
ClearDebug;
Loginplayer;
wait(1200 + random(400));
end;
ClickNorth(SRL_ANGLE_HIGH);
end;


procedure FindRandoms;
begin
if (not(LoggedIn)) then
begin
Loginplayer;
end;
FindNormalRandoms;
end;


procedure Bank;
var x, y, kill, i:Integer;
Bank_Booth:TPointArray;
s:string;
// TPoint:TPoint;
begin
DoingATM := 'Banking';
if (FindDTM(Raw_Fish, x, y, 553, 211, 598, 248)) then
begin
Exit;
end;
FindRandoms;
if OutOfFish then
begin
LogOut;
NextAcc := True;
if HowManyPlayers = 1 then
begin
Writeln('Out of fish, Terminating Script');
PrintProggy;
TerminateScript;
end else
Writeln('Out of fish, going to the next account');
Exit;
end;
if NextAcc then
Exit;
PrintProggy;
while isMoving do
wait(200+random(200));

MouseSpeed := 16 + random(2);
for i := 0 to BankOpen(i) do
begin
// writeln(inttostr(i));
case i of
0:
begin
if FindColorsSpiralTolerance(MSCX, MSCY, Bank_Booth, 9350042, 144, 112, 229, 178, 25) then
begin
MiddleTPAEx(Bank_Booth, x, y);
mouse(x, y, 3, 3, True);
wait(1400 + random(300));
repeat
wait(500 + random(330));
inc(kill);
until ((BankScreen) or (PinScreen) or (kill = 7))
kill := 0;
end;
//if (BankScreen or PinScreen) then
// Exit;
end;
1:
begin
if FindColorsTolerance(Bank_Booth, 9350042, 144, 112, 229, 178, 50) then
begin
MiddleTPAEx(Bank_Booth, x, y);
mouse(x + 15, y, 3, 3, True);
wait(800 + random(100));
//WaitOptionMulti(['se-qu','ank','ancel'], 1500);
repeat
wait(500 + random(330));
inc(kill);
until ((BankScreen) or (PinScreen) or (kill = 7))
kill := 0;
end;
//if (BankScreen or PinScreen) then
// Exit;
end;
2:
begin
mouse(220, 163, 3, 3, True);
//wait(800 + random(200));
//WaitOptionMulti(['se-qu','ank','ancel'], 1500);
repeat
wait(300 + random(330));
inc(kill);
until ((BankScreen) or (PinScreen) or (kill = 14))
kill := 0;
// if (BankScreen or PinScreen) then
// Exit;
end;
3:
begin
Logout;
writeln('Couldnt find bank..');
NextPlayer(False);
NextAcc := True;
Exit;
end;
end;
end;

// bankscreen open or procedure killed

wait(500 + random(200));
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if invcount > 0 then
begin
CustomDepositAll;
Wait(300 + random(150));
end;
//x := 129 + random(26);
//y := 99 + random(20);
//mouse(x , y, 0, 0, False);
//wait(600 + random(300));
//Mouse(x, y + 104 + random(20), 15, 0, True);
DoingATM := 'Withdrawing Raw food';
PrintProggy;
//mouse(x, y, 0, 0, False);
//wait(10000);
//TPoint.x := x;
//TPoint.y := y;
//TPoint := MSTPointToBankPoint(TPoint);
repeat
inc(kill);
wait(50);
until (withdraw(BankCol, BankRow, 0) or (kill = 5))
//Wait(400 + random(100));
MouseSpeed := 16;
if GetMMLevels('run', s) < 23 then
begin
RestUntil(84);
end;
end;


procedure ToBank;
begin
FindRandoms;
DoingATM := 'Going to bank';
if NextAcc then
Exit;
mouse(613,143,1,-3,true); // the only blind click ^^
PrintProggy;
Wait(6700 + random(300));
end;


procedure Cook;
var x, y, i, kill, kill2, Antiban, When:Integer;
Tp:TPoint;
InventSpotsX1, InventSpotsY1, InventSpotsX2, InventSpotsY2:TIntegerArray;
begin
FindRandoms;
DoingATM := 'Finding Range';
PrintProggy;
if NextAcc then
Exit;
MouseSpeed := 19 + random(2);
while isMoving do wait(200+random(200));

if not(GetRangePos(Tp)) then
begin
writeln('GetRangePos returned false');
NextPlayer(False);
NextAcc := True;
Exit;
end;
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);
DoingATM := 'Finding Range';
PrintProggy;
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);
if not(GetRangePos(Tp)) then
begin
writeln('Range wasnt found..');
NextPlayer(False);
NextAcc := True;
Exit;
end;
x := Tp.x;
y := Tp.y;
mouse(x, y, 4, 4, True);

MouseSpeed := 11 + random(2);
end;
while isMoving do wait(200+random(200));
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);
wait(800 + random(450));
kill := 0;
end;
SetArrayLength(InventSpotsX1, 28);
SetArrayLength(InventSpotsY1, 28);
SetArrayLength(InventSpotsX2, 28);
SetArrayLength(InventSpotsY2, 28);

InventSpotsX1 :=
[560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683];

InventSpotsX2 :=
[601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724];

InventSpotsY1 :=
[210, 210, 210, 210,
247, 247, 247, 247,
284, 284, 284, 284,
321, 321, 321, 321,
357, 357, 357, 357,
393, 393, 393, 393,
429, 429, 429, 429];

InventSpotsY2 :=
[247, 247, 247, 247,
284, 284, 284, 284,
321, 321, 321, 321,
357, 357, 357, 357,
393, 393, 393, 393,
429, 429, 429, 429,
465, 465, 465, 465];

DoingATM := 'Cooking';
AddToStats := True;
AntiBan := random(2);

if AntiBan = 1 then
begin
When := random(23);
end else
When := -1;

for i := 0 to 27 do
begin
repeat
Wait(random(398));
inc(Kill2);
until (not(FindDTM(Raw_Fish, x, y, InventSpotsX1[I], InventSpotsY1[I],
InventSpotsX2[I], InventSpotsY2[I])) or (Kill2 = 30))
FindRandoms;
if Kill2 = 30 then
break;
if (not(FindDTM(Cooked_Fish, x, y, InventSpotsX1[I], InventSpotsY1[I],
InventSpotsX2[I], InventSpotsY2[I])) and ExistsItem(I + 1) and
not(FindDTM(Raw_Fish, x, y, InventSpotsX1[I], InventSpotsY1[I],
InventSpotsX2[I], InventSpotsY2[I])) ) then { and not(FindDTM(Raw_Fish,
x, y, InventSpotsX1[I + 1], InventSpotsY1[I + 1], InventSpotsX2[I + 1],
InventSpotsY2[I + 1])) }
begin
IsFishBurned := True;
inc(FishBurned);
end else
inc(FishCooked);
if not(ExistsItem(I + 1)) then
begin
ToBank;
writeln('Out of fish.');
NextPlayer(False);
NextAcc := True;
OutOfFish := True;
Exit;
end;
PrintProggy;
if i = 26 then
MMouse(565 + random(111), 96 + random(68), 3, 3);

//antiban
if i = When then
begin
DoingATM := 'AntiBan';
PrintProggy;
if GameTab(tab_Stats) then
begin
HoverSkill(Skill_Cooking, False);
wait(500 + random(300));
GameTab(tab_Inv);
wait(200 + random(250));
end else
FindRandoms;
DoingATM := 'Cooking';
end;
//end of antiban

Kill2 := 0;
end;
AddToStats := False;

FindRandoms;
if NextAcc then
Exit;
MouseSpeed := 13 + random(2);
end;


procedure ToRange;
var KebabBMP, x, y, W, W2, I:Integer;
AnyBMPsFound:Boolean;
BitmapsFound:TPointArray;
Tp:TPoint;
begin
if NextAcc then
Exit;
AnyBMPsFound := False;
//wait(400 + random(100));
FindRandoms;
if NextAcc then
Exit;
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, MMX1, mmy1, mmx2, mmy2, 15)) then
begin
BitmapsFound[0] := IntToPoint(x, y);
FreeBitmap(KebabBMP);
AnyBMPsFound := True;
end else
FreeBitmap(KebabBMP);
end;
1:
begin
KebabBMP := BitmapFromString(4, 5, 'meJxjZAwXtk45AAZMTC2MMK59Qn9E' +
'7Roge8GCBUAGkAthA0kIAwgA0mIZBQ==');
if (FindBitmapToleranceIn(KebabBMP, x, y, MMX1, mmy1, mmx2, mmy2, 15)) then
begin
BitmapsFound[1] := IntToPoint(x, y);
FreeBitmap(KebabBMP);
AnyBMPsFound := True;
end else
FreeBitmap(KebabBMP);
end;
2:
begin
KebabBMP := BitmapFromString(4, 5, 'meJw7cIAw4FH0w4oAqfQe2Q==');
if (FindBitmapToleranceIn(KebabBMP, x, y, MMX1, mmy1, mmx2, mmy2, 15)) then
begin
BitmapsFound[2] := IntToPoint(x, y);
FreeBitmap(KebabBMP);
AnyBMPsFound := True;
end else
FreeBitmap(KebabBMP);
end;
3:
begin
KebabBMP := BitmapFromString(5, 4, 'meJwTtk6RjV4jbJ0CRDyKfsKo3AMH' +
'DqBxgWABDAAAK08Wzg==');
if (FindBitmapToleranceIn(KebabBMP, x, y, MMX1, mmy1, mmx2, mmy2, 15)) then
begin // 590, 5, 685, 66, 15)
BitmapsFound[3] := IntToPoint(x, y);
FreeBitmap(KebabBMP);
AnyBMPsFound := True;
end else
FreeBitmap(KebabBMP);
end;
end;
end;
if not(AnyBMPsFound) then
begin
writeln('Furnace and kebab icon not found..');
NextPlayer(False);
NextAcc := True;
Exit;
end;
BitmapsFound := ClearTPAFromTPA(BitmapsFound, [Point(0, 0)]);
MiddleTPAEx(BitmapsFound, x, y);
mouse(x - random(3), y + random(5), 0, 0,true);
W := 1000 + random(4000);
W2 := (5000 - W);
wait(W);
DoingATM := 'Going to range';
PrintProggy;
invmouse(1,1);
MMouse(random(MSX2), random(MSY2), 3, 3);
Wait(W2 + 1500 + random(300));
// almost arrived at range ;)
if not(FindColor(x, y, 131072, 560, 210, 601, 247)) then // back to bank
begin
FindRandoms;
if NextAcc then
Exit;
if not(GetRangePos(Tp)) then
begin
NextPlayer(False);
NextAcc := True;
Exit;
end;
x := Tp.x + 18 + random(5);
y := Tp.y;
Mouse(x, y, +3, +3, True);
Wait(1000 + random(200));
if loopkill >= 3 then // failsafe
begin
writeln('something failed.');
NextPlayer(False);
NextAcc := True;
Exit;
end;
inc(loopkill);
ToBank; // fish not found, click next to range and
Bank; // get new fish
ToRange;
end;
end;


begin
SetUp;
repeat
Bank;
ToRange;
Cook;
ToBank;
until Finished or NextAcc
LogOut;
if HowManyPlayers = 1 then
begin
writeln('Succesfully finished');
PrintProggy;
TerminateScript;
end;
writeln('Starting on next account');
if not(NextAcc) then
NextPlayer(False);
NextAcc := False;
LoadsDone := 0;
StartTime := GetSystemTime;
LogInPlayer;
repeat
Bank;
ToRange;
Cook;
ToBank;
until Finished or NextAcc
LogOut;
writeln('Finished all accounts.');
PrintProggy;
TerminateScript;
end.

QAZ

2012-06-06 17:30:34

bump, really need help with this :/

putonajonny

2012-06-07 10:07:48

if not(GetRangePos(Tp)) then
begin
writeln('GetRangePos returned false');
NextPlayer(False);
NextAcc := True;
Exit;
end;
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);//What is this for?
DoingATM := 'Finding Range';
PrintProggy;
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);
if not(GetRangePos(Tp)) then
begin
writeln('Range wasnt found..');
NextPlayer(False);
NextAcc := True;
Exit;
end;
x := Tp.x;
y := Tp.y;
mouse(x, y, 4, 4, True);

MouseSpeed := 11 + random(2);
end
else
begin
while isMoving do wait(200+random(200));
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);
wait(800 + random(450));
kill := 0;
end;
end;

MouseBox(X1, Y1, X2, Y2, mouse_Left);//This is the line you need to add, X1 Y1 X2 and Y2 are the box that you are going to click in to cook all

QAZ

2012-06-07 10:09:08

From: putonajonny
if not(GetRangePos(Tp)) then
begin
writeln('GetRangePos returned false');
NextPlayer(False);
NextAcc := True;
Exit;
end;
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);//What is this for?
DoingATM := 'Finding Range';
PrintProggy;
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);
if not(GetRangePos(Tp)) then
begin
writeln('Range wasnt found..');
NextPlayer(False);
NextAcc := True;
Exit;
end;
x := Tp.x;
y := Tp.y;
mouse(x, y, 4, 4, True);

MouseSpeed := 11 + random(2);
end
else
begin
while isMoving do wait(200+random(200));
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);
wait(800 + random(450));
kill := 0;
end;
end;

MouseBox(X1, Y1, X2, Y2, mouse_Left);//This is the line you need to add, X1 Y1 X2 and Y2 are the box that you are going to click in to cook all




you fixed it up?

putonajonny

2012-06-07 10:10:44

From: QAZ
you fixed it up?


Have a look at my 2 comments (In Blue)

QAZ

2012-06-07 10:11:08

From: putonajonny
Have a look at my 2 comments (In Blue)


found it, thanks :D

QAZ

2012-06-07 10:18:59

hmm, unable to compile. problem is i'm fixing up an old script and i just can't read it :/

putonajonny

2012-06-07 10:19:56

From: QAZ
hmm, unable to compile. problem is i'm fixing up an old script and i just can't read it :/


Post the compiling error and the lines it is referring to.

QAZ

2012-06-07 10:26:53

ok, this is the part of the procedure where the box should show (i think)

 begin
x := x + random(10);
y := y + random(10);
mouse(x, y, 0, -3, true);
wait(800 + random(450));
kill := 0;
end;
SetArrayLength(InventSpotsX1, 28);
SetArrayLength(InventSpotsY1, 28);
SetArrayLength(InventSpotsX2, 28);
SetArrayLength(InventSpotsY2, 28);

InventSpotsX1 :=
[560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683,
560, 601, 642, 683];

InventSpotsX2 :=
[601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724,
601, 642, 683, 724];

InventSpotsY1 :=
[210, 210, 210, 210,
247, 247, 247, 247,
284, 284, 284, 284,
321, 321, 321, 321,
357, 357, 357, 357,
393, 393, 393, 393,
429, 429, 429, 429];

InventSpotsY2 :=
[247, 247, 247, 247,
284, 284, 284, 284,
321, 321, 321, 321,
357, 357, 357, 357,
393, 393, 393, 393,
429, 429, 429, 429,
465, 465, 465, 465];

[COLOR="Blue"]I PUT THE CODE HERE@@[/COLOR]



DoingATM := 'Cooking';
AddToStats := True;
AntiBan := random(2);

if AntiBan = 1 then
begin
When := random(23);
end else
When := -1;

for i := 0 to 27 do
begin
repeat
Wait(random(398));
inc(Kill2);
until (not(FindDTM(Raw_Fish, x, y, InventSpotsX1[I], InventSpotsY1[I],
InventSpotsX2[I], InventSpotsY2[I])) or (Kill2 = 30))
FindRandoms;
if Kill2 = 30 then
break;
if (not(FindDTM(Cooked_Fish, x, y, InventSpotsX1[I], InventSpotsY1[I],
InventSpotsX2[I], InventSpotsY2[I])) and ExistsItem(I + 1) and
not(FindDTM(Raw_Fish, x, y, InventSpotsX1[I], InventSpotsY1[I],
InventSpotsX2[I], InventSpotsY2[I])) ) then { and not(FindDTM(Raw_Fish,
x, y, InventSpotsX1[I + 1], InventSpotsY1[I + 1], InventSpotsX2[I + 1],
InventSpotsY2[I + 1])) }
begin
IsFishBurned := True;
inc(FishBurned);
end else
inc(FishCooked);
if not(ExistsItem(I + 1)) then
begin
ToBank;
writeln('Out of fish.');
NextPlayer(False);
NextAcc := True;
OutOfFish := True;
Exit;
end;
PrintProggy;
if i = 26 then
MMouse(565 + random(111), 96 + random(68), 3, 3);

//antiban
if i = When then
begin
DoingATM := 'AntiBan';
PrintProggy;
if GameTab(tab_Stats) then
begin
HoverSkill(Skill_Cooking, False);
wait(500 + random(300));
GameTab(tab_Inv);
wait(200 + random(250));
end else
FindRandoms;
DoingATM := 'Cooking';
end;
//end of antiban

Kill2 := 0;
end;
AddToStats := False;

FindRandoms;
if NextAcc then
Exit;
MouseSpeed := 13 + random(2);
end;




the error is when i put that in which you showed me


[Error] (653:13): Unknown identifier 'X1' at line 652
Compiling failed.

Rich

2012-06-07 10:33:06

X1, X2, Y1, Y2 are the coords of the box you're going to click

X1 - Left
X2 - Right
Y1 - Top
Y2 - Bottom

EG:


Yeh, it's crudely drawn in MS paint with a laptop trackpad, but hopefully you can figure it out.