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