SRL Archive - SRL Archives

DDoSAllButDTM (and SellOrDropTo)


Iron Man

2008-12-21 00:41:44

I'm not sure if anyone will use this, but I'm not releasing/finishing the script I made this for, so hopefully it will go to use for someone.

It Deposits, Drops or Sells all but a selected DTM. I made it for a mining script, where you had to deposit gems, and random items as well as the ores, but it could go to use somewhere else.


function SellOrDropTo(Which: string; Spot1, Spot2: integer): Boolean;
var
i, o, ROFLCATS: integer;
coString: string;
begin
if not LoggedIn then exit;
case lowercase(Which) of
'sell': coString := 'All';
'drop': coString := 'Drop';
end;
for i := Spot1 to Spot2 do
begin
ROFLCATS := InvCount;
if ExistsItem(i) then
begin
MouseItem(i, false);
repeat
if TimeFromMark(o) > 2000 then exit;
Wait(60 + random(20));
until((ChooseOption(coString)));
Result := ROFlCATS < InvCount;
Wait(750 + random(300));
end;
end;
end;


procedure DDoSAllButDTM(Which: string; DTM: integer);
//Deposit, Drop or Sell but a certain DTM (if DTM is not found, it will deposit/drop/sell all)
var
cx, cy, cti: integer;
begin
if not LoggedIn then exit;
if FindDTM(DTM, cx, cy, mix1, miy1, mix2, miy2) then
begin
cti := CoordsToItem(cx, cy);
case cti of
0: case lowercase(Which) of
'sell': SellorDropTo('sell', 1, 28);
'deposit': Deposit(1, 28, true);
'drop': DropAll;
end;
1: case lowercase(Which) of
'sell': SellorDropTo('sell', cti + 1, 28);
'deposit': Deposit(2, 28, true);
'drop': SellorDropTo('drop', cti + 1, 28);
end;
2..27: case lowercase(Which) of
'sell': begin
SellorDropTo('sell', 1, cti - 1);
SellorDropTo('sell', cti + 1, 28);
end;
'deposit': begin
Deposit(1, cti - 1, true);
Deposit(cti + 1, 28, true);
end;
'drop': begin
SellorDropTo('drop', 1, cti - 1);
SellorDropTo('drop', cti + 1, 28);
end;
end;
28: case lowercase(Which) of
'sell': SellorDropTo('sell', 1, 27);
'deposit': Deposit(1, 27, true);
'drop': SellorDropTo('drop', 1, 27);
end;
end;
end;
end;




If you can shorten this, or if I got the inventory spots to start from and to go to wrong, or any other things that could be made better/fixed please tell me. All feedback appreciated.

lordsaturn

2008-12-21 23:54:10

Lol, the name DDoS implies something else.

And I like the use of 'ROFLCATS' as a variable ^.^

Also, I think CoordsToItem returns 1..28, not 0..27. I can't verify that though, I don't have SRL where I am.

mormonman

2008-12-22 00:22:08

Inv is 1 to 28… this is pretty sweet, i might use something like this in my jun mem competition script…

Iron Man

2008-12-22 01:18:42

It returns 0 if the item was not found, so it's like a drop/deposit/sell if there is no DTM of it.


EDIT: ROFLCATS = all around name for a variable. :p

TViYH

2008-12-22 10:10:12

I saw DDoS and I was like…WTF!

Then I saw that it's a good script :)

Good job.