SRL Archive - SRL Archives

DiscardAll;


pwnaz0r

2007-03-18 03:10:40

Meh, I was bored so I put together this procedure. Don't even know if it compiles really :D. Doing it straight from keyboard so dtn flame if it doesnt compile :D.(or work :D).

THIS IS STILL IN PROGRESS :p I POSTED HERE SO I WOULDNT HAVE TO SAVE ON COMP AND I WAS BORED. POST ANY SUGGESTIONS



program New;
{.include srl/srl.scar}

var
Money : integer;
UmArray : array of integer;
None : TIntegerArray;

procedure CreateInventoryArray(var TheArray : array of integer; TheDTM : integer);
var
ii : TPoint;
i, iq : integer;
z : integer;
begin
z := 0;
i := 0;
repeat
I := I + 1;
ii := ItemCoords(I);
If(z <= 0)then Z := 1;
If (FindDTM(TheDTM, x, y, ii.x - 25, ii.y - 25, ii.x + 25, ii.y + 25))then
begin
SetArrayLength(TheArray,Z + 1);
TheArray[Z] := I;
Z := Z + 1;
end;
until(I = 28);
Z := GetArrayLength(TheArray) - 1;
If (z <= 0)then Z := 1;
Iq := 0;
repeat
Writeln(IntToStr(TheArray[IQ]));
IQ := IQ + 1;
until( IQ = Z);
end;

function DiscardAll(var ArrayToSkip : array of integer; Sell : boolean) : boolean;
var
z1,z2,z3 : integer;
begin
If ( Sell ) then
begin
z1 := 0;
repeat
If(IsFKeyDOwn(2))then TerminateScript;
z1 := z1 + 1;
If(ExistsItem(z1)) then
begin
z2 := GetArrayLength(ArrayToSkip);
if (z2 = 0) then z2 := 1;
for z3 := 0 to z2 do
begin
if not(z1 = ArrayToSkip[z3])then
begin
MouseItem(z1,false);
wait(30+random(400));
ChooseOption(x,y,'10');
end;
end;
end;
until(z1 = 28);
result := true;
end;
end;




begin
SetupSRL;
//Money DTM was set here
CreateInventoryArray(none,money);
DiscardAll(None,true);
end.


m0u53m4t

2007-03-18 04:33:13

*Can't be bothered to test*

What does it do though?

Buckleyindahouse

2007-03-18 06:43:03

From: m0u53m4t
*Can't be bothered to test*

What does it do though?


Maybe, Discard All in the inventory?

Dark_Sniper

2007-03-18 10:54:07

its uses arrays which is very intresting :p

but instead of the chooseoption of
'10'
how about
'll'
(which is all.)

pwnaz0r

2007-03-18 16:21:01

Ok :D

WhiteShadow

2007-03-18 21:33:29

uh. There's a much easier way to do this ?

This is basically bankall or what? I'm not sure what you mean by discard..

procedure DiscardAll;
var
d : TPoint;
i : Integer;
begin
for i:= 0 to 28 do
begin
if(ExistsItem(i))then
begin
d:= ItemCoords(i);
Mouse(d.x, d.y, 3, 3, false);
ChooseOption(x, y, 'all');
Wait(1000 + random(1000));
end;
end;
end;

Boreas

2007-03-18 22:30:41

I think it finds and discards all items with a given DTM, not just any old item. Sorta like FindAllSlotsBlackListSkip