SCAR Code:
{
/'\_/`\ ( ) ( _`\
| | _ _ | |__ | ( (_) ___
| (_) | /'_` )| _ `\| |___ /',__)
| | | |( (_| || | | || (_, )\__, \
(_) (_)`\__,_)(_) (_)(____/'(____/
_ _ _
( ) ( ) ( )_
| `\| | _ | ,_) __
| , ` | /'_`\ | | /'__`\
| |`\ |( (_) )| |_ ( ___/
(_) (_)`\___/'`\__)`\____)
___ _ _
( _`\ (_ ) (_ )
| (_(_) __ | | | | __ _ __
`\__ \ /'__`\ | | | | /'__`\( '__)
( )_) |( ___/ | | | | ( ___/| |
`\____)`\____)(___)(___)`\____)(_)
V 1.00
////DIRECTIONS\\\\
Run this script with the shop window open (preferably gen store),
and all the thing you want to sell in note form in your inventory
\\\\\\\\\//////// }
program MahGs_Seller;
{.include SRL/SRL.scar}
var
times, dtmNote, xx, yy, bmpClose : Integer;
rem : string;
const
///////Setup\\\\\\\
ToSell = 10; //How many to sell
////////End\\\\\\\\
procedure LoadDTMs;
begin
dtmNote := DTMFromString('78DA63B465626078CB8002362CAC609806A41' +
'981F83F1030DA00D53C6240038C482490B602AA794F408D3B50CD' +
'47026A42816A3E1050130654730FBF1A000AE10D9B');
end;
procedure DeclareBMPs;
begin
bmpClose := BitmapFromString(8, 9, 'z78DA8D8CB10DC0200C045732B14D4' +
'40B88FD472222CD4B2F0C2EAEF1FD897C97643157EFA64C018719' +
'9BD9FCB51417D044DE9BBB157F7DF8A3EDE7AE8F4E6CF22AAE1D0' +
'AC5BA16263A13E2EE5647');
end;
procedure SetupScript;
begin
Status('Setting Up');
times := 0;
ClearDebug;
SetupSRL;
LoadDTMs;
DeclareBMPs;
end;
function Remaining (Total, Done, Time, Selling : Integer) : string;
var
itemsleft, minsremaining, secsremaining, hremaining : integer;
begin
itemsleft := (Total - Done);
itemsleft := itemsleft * Time;
if Selling = 1 then
itemsleft := itemsleft div 10;
if Selling = 2 then
itemsleft := itemsleft div 5;
if Selling = 3 then
itemsleft := itemsleft div 1;
minsremaining := itemsleft div 60;
if minsremaining >= 60 then
begin
hremaining := itemsleft div 60;
hremaining := hremaining div 60;
end else
if minsremaining <= 59 then
hremaining := 0;
minsremaining := (minsremaining - (hremaining * 60));
secsremaining := (itemsleft - ((hremaining * 60) * 60));
secsremaining := secsremaining - (minsremaining * 60);
if hremaining > 1 then
begin
if minsremaining > 1 then
Result := IntToStr(hremaining) + ' Hours and ' + IntToStr(minsremaining) + ' Minutes and ' + IntToStr(secsremaining) + ' Seconds';
if minsremaining = 1 then
Result := IntToStr(hremaining) + ' Hours and ' + IntToStr(minsremaining) + ' Minute and ' + IntToStr(secsremaining) + ' Seconds';
if minsremaining < 1 then
Result := IntToStr(hremaining) + ' Hours and ' + IntToStr(secsremaining) + ' Seconds';
end else
if hremaining = 1 then
begin
if minsremaining > 1 then
Result := IntToStr(hremaining) + ' Hour and ' + IntToStr(minsremaining) + ' Minutes and ' + IntToStr(secsremaining) + ' Seconds';
if minsremaining = 1 then
Result := IntToStr(hremaining) + ' Hour and ' + IntToStr(minsremaining) + ' Minute and ' + IntToStr(secsremaining) + ' Seconds';
if minsremaining < 1 then
Result := IntToStr(hremaining) + ' Hour and ' + IntToStr(secsremaining) + ' Seconds';
end else
if hremaining < 1 then
begin
if minsremaining > 1 then
Result := IntToStr(minsremaining) + ' Minutes and ' + IntToStr(secsremaining) + ' Seconds';
if minsremaining = 1 then
Result := IntToStr(minsremaining) + ' Minute and ' + IntToStr(secsremaining) + ' Seconds';
if minsremaining < 1 then
Result := IntToStr(secsremaining) + ' Seconds';
end;
end;
procedure ProgressReport;
begin
Status('Progress Report');
Writeln('*********************************');
Writeln('Items Sold: ' + IntToStr(times));
Writeln('Items Still to be sold: ' + IntToStr(ToSell - times));
Writeln('Length run for: ' + (TimeRunning));
Writeln('Time remaining: ' + ({rem}Remaining(ToSell, times, 2, 1)));
Writeln('*********************************');
end;
procedure Sell;
var
amt : integer;
begin
if(FindDTM(dtmNote, xx, yy, MIX1, MIY1, MIX2, MIY2)) then
begin
repeat
Status('Selling Now');
Mouse(xx, yy -random(10), 10 +random(10), 0, False);
wait(350+random(100));
amt:= random(25);
if amt <= 20 then
begin
Status('Selling 10');
ChooseOption(x, y, '10');
times := times +10;
rem := Remaining(ToSell, times, 2, 1);
end else
if (amt <= 22)and(amt >= 21) then
begin
Status('Selling 5');
ChooseOption(x, y, '5');
times := times +5;
rem := Remaining(ToSell, times, 2, 2);
end else
if (amt <= 24)and(amt >= 23) then
begin
Status('Examining');
ChooseOption(x, y, 'Examine');
rem := Remaining(ToSell, times, 2, 0);
end;
if (InChat('Sorry')) then
TerminateScript;
ClearDebug;
ProgressReport;
wait(350+random(100));
if(not(FindDTM(dtmNote, xx, yy, MIX1, MIY1, MIX2, MIY2))) then
break;
until times >= ToSell;
end else
Writeln('Cant find a note in your Inventory');
end;
procedure CloseShop;
begin
if (FindBitmap(bmpClose, x, y)) then
begin
Mouse(x, y, 1, 1, True);
Wait(500+random(500));
end;
end;
begin
SetupScript;
Sell;
CloseShop;
Logout;
FreeBitmap(bmpClose);
FreeDTM(dtmNote);
end.