SRL Archive - RS3 Outdated / Broken Scripts

Grand Exchange Cooker.


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.


{.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.)

Look Me

2010-04-26 21:37:46

Look good, i have added some time when it cook lobster because the script was cooking like 3 before returning to bank.

For now it work good.

Timer

2010-04-26 22:15:49

From: Look Me
Look good, i have added some time when it cook lobster because the script was cooking like 3 before returning to bank.

For now it work good.


Hm.. That's weird. Try increasing the wait here
          repeat
if (GetAnimation <> 0) then
MarkTime(m);
until (TimeFromMark(m) > 3000) or (not ExistsItem(28));
from like 3000 to 5000.. If that is not what you did.

Look Me

2010-04-26 23:55:31

begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if (WaitOptionMultiEx(['ll'], 'action', ClickLeft, 2000)) then
begin
MarkTime(m);
Wait(1000 *** here at 50000 **** + Random(2000));
repeat
if (GetAnimation <> 0) then
MarkTime(m);
until (TimeFromMark(m) > 3000) or (not ExistsItem(28));

Changed the time here.

Timer

2010-04-27 10:08:34

From: Look Me
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if (WaitOptionMultiEx(['ll'], 'action', ClickLeft, 2000)) then
begin
MarkTime(m);
Wait(1000 *** here at 50000 **** + Random(2000));
repeat
if (GetAnimation <> 0) then
MarkTime(m);
until (TimeFromMark(m) > 3000) or (not ExistsItem(28));

Changed the time here.

o.O uh ok.

Frement

2010-04-27 10:19:55

Add bank pin to it, your code is really hard to follow.

Cazabacca

2010-04-27 10:54:34

Ahhh thank you god, will be running this as soon as I get 94 cooking for sharks. Only few levels more.

MylesMadness

2010-04-27 11:01:25

From: Frement
…your code is really hard to follow.
Agreed. I was completely lost

Timer

2010-04-27 15:03:19

Good. It isn't made for people to use really. I made it for people to modify for themselves, it was a simple script I made in 10 minutes, it got me 99, that's all I wanted.

enig.ma

2010-04-28 03:41:09

that code ~200 lines took you 10 mins? dam son good job

I actually went to see how many lines 600 lines!

Raskolnikov

2010-04-30 20:41:19

From: enig.ma
that code ~200 lines took you 10 mins? dam son good job

I actually went to see how many lines 600 lines!


He is exaggerating…

The code is hard to follow, I'll try this when I am done writing the script I am writing right now, reserved.

Timer

2010-04-30 21:37:17

Why are you trying to follow it? For what??

Raskolnikov

2010-04-30 21:52:10

From: Timer
Why are you trying to follow it? For what??


I would like to edit the code for my own purposes to add more types of foods. But it doesn't really matter, I was just saying.

Timer

2010-04-30 21:52:43

Ah. Just add more DTMs in the food sections, that is all you needa do.

Raskolnikov

2010-04-30 21:56:26

I can do that, thanks.
I am still trying to get my wcing to 80 though. I am sorry that your script hasn't gotten more reviews and progress reports. I hate when that happens.

Timer

2010-04-30 21:57:56

From: Cut em2 it
I can do that, thanks.
I am still trying to get my wcing to 80 though. I am sorry that your script hasn't gotten more reviews and progress reports. I hate when that happens.


I didn't really make it for use. Working on a Yew Cutter atm.

Raskolnikov

2010-04-30 22:33:37

From: Timer
I didn't really make it for use. Working on a Yew Cutter atm.


Nice, I am currently working on an ivy cutting script. Looking forward to a yew cutter, that should be awesome.

3Garrett3

2010-05-01 13:23:20

Approx how much money do you lose per lobster? I remember thinking about making one of these, but for cooking anything worth while, you barely got 50% of your money back. Mind you, this was almost a year ago now, but the prices probably haven't done a complete reversal.

i luffs yeww

2010-05-01 13:50:03

^ Swords are actually faster and cheaper last time I checked.

Raw lobster - 402

Lobster - 350

(Actually, raw swords are 573 and swords are 499, so lobs are cheaper. :p)

Becks

2010-07-25 23:06:36

Hey, timer do you mind updating? :)

GTFO

2010-07-28 00:07:08

was gunna try an make one of these, but i guess u beat me to it.

Heavenguard

2010-07-28 00:12:50

From: GTFO
was gunna try an make one of these, but i guess u beat me to it.


That doesn't mean you shouldn't make it :P nothing like a good ol' competition, and nice job Timer :D. For 10 minutes you sure did do good, I mean, it woulda take me like 20 just to get all the Hmods and Smods with ACAv2.

jizzoe

2010-07-28 22:44:26

hey can you please update?

gijs735

2010-10-08 05:38:36

From: jizzoe
hey can you please update?


I hope he update it, I really need something like this

MylesMadness

2010-10-08 06:32:59

Uh, how can some whos banned update a script

BraK

2010-10-08 06:51:16

It has already been pointed out to him on another thread.

Mods please close this Thread.

~BraK