ShowerThoughts
2008-02-14 11:59:16
Hermpie's Adventures Item Buyer [Ardounge]
Hey, im not good at writing script releases :p
This is an Ardounge shop buyer, you can buy these items.

this is the place[in Ardounge] + road it walks[start at green dot somwhere in
bank].

Hey, im not good at writing script releases :p
This is an Ardounge shop buyer, you can buy these items.
///// Item Pricess\\\//
Vialofwater = 10;//
Bronzepickaxe = 1;//
IronAxe = 1; //
Cookedmeat = 4;//
Tinderbox = 1;//
Ballofwool = 5;//
Bronzearrow = 7;//
Rope = 18;//
Papyrus = 10;//
Knife = 6;//
//###################//
this is the place[in Ardounge] + road it walks[start at green dot somwhere in
bank].
- Coins in first bankslot
- Btw use scar 3.13 it works for me 3.14 does not[some bug in bank.scar]
- Start in Bank.
- Have Fun en report bugs and post progs
Known Bugs:
- Can Not Find Roadcolor
Progs:
Thanks, for the Progs !
btw, for Anti-Leach i will add a pass next time(next update) give me a proggy then i will send you the pass.
program Hermpie;
{.include srl/srl.scar}
var
{My Stuff} X, Y, Loads, BankBooth,ToBankers, ToBankersB:Integer;
Price1, Price2, Price3, Price4, Price5, Price6, Price7,
Price8, Price9, Price10, TotalGP, ShopDTM: Integer;
Location: string;
const
Pin = '0000';// Your Bankpin (if you have one!)
HowManyLoads = 100 ;// How many loads?
//--#################--//
////// Fill In \\\\//
// How Many You Want? //
//Total MAX Of 27 Items// PRICES BELOW!
Item1 = 0;// --> Vial(s) of Water = 10 GP
Item2 = 0;// --> Bronze Pickaxe('s) = 1 GP
Item3 = 0;// --> Iron Axe('s) = 1 GP
Item4 = 0;// --> Cooked Meat(s) = 4 GP
Item5 = 0;// --> Tinderbox(xes) = 1 GP
Item6 = 28;// --> Ball(s) of Wool = 5 GP
Item7 = 0;// --> Bronze Arrow(a) = 7 GP
Item8 = 0;// --> Rope('s) = 18 GP
Item9 = 0;// --> Papyrus = 10 GP
Item10 = 0;// --> Knife('s) = 6 GP
//--#################--//
//##--END OF SETUP--##\\
//################-- LET ALL THE STUFF BELOW AS BELOW IF YOU DON'T KNOW WHAT YOU ARE DOING! --################\\
//###################//
//////LET THIS!\\\\\\//
///// Item Pricess\\\//
Vialofwater = 10;//
Bronzepickaxe = 1;//
IronAxe = 1;//
Cookedmeat = 4;//
Tinderbox = 1;//
Ballofwool = 5;//
Bronzearrow = 7;//
Rope = 18;//
Papyrus = 10;//
Knife = 6;//
//###################//
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := 'dfdgddddf';
Players[0].Pass := 'dddd';
Players[0].Nick := 'dgdf';
Players[0].Active := true;
end;
procedure LoadDTMs;
begin
ToBankers := DTMFromString('78DA632C626260086500034608C5F0FFFF7F8' +
'6FF503E90FD9FB10AA8261C55CD9F3F4C0C92487CC672A09A6402' +
'6A6A806ABC09A8990154E389AAC6DD8A0B450D009C7D1309');
BankBooth := DTMFromString('78DA639464646058CD00068C108A212B259E4' +
'112CAFF0F048C5240561DAA9A8B174FC3D580C5D581AC73A86A8E' +
'1FDF8FAA460BC87A8EAAE6C48903A86A4481AC35A86AA29CB951D' + '4000043771190');
ToBankersB := DTMFromString('78DA632C666260086500034608C5F0FFFF7F8' +
'6FF503E90FD9FB10AA8C60B55CD9F3F4C0C92487CC64AA09A3022' + 'D424E2570300F97B117B');
ShopDTM := DTMFromString('78DA63B4676260886700034608C5501464CAF' +
'01FCAFF0F048CF94035D1A86AB4C2A4192491F88CA540358E04D4' +
'3402D51813503309A82680809A294035E6F8D50000AA6C0E16');
end;
Function HDTMsRotated(HDTM1, A1, A2, A3, A4, HDTM2, B1, B2, B3, B4: Integer ):Boolean;
begin
if DTMRotated(HDTM1, X, Y, MMX1, MMY1, MMX2, MMY2) then
begin
MouseFlag(X +4 , Y, 2, 2)
Result:=True;
end else if DTMRotated(HDTM2, X, Y, MMX1, MMY1, MMX2, MMY2) then
Begin
MouseFlag(X +4, Y, 2, 2)
Result:=True;
end else
Result:=False;
end;
procedure ChangeLoc(Location1: string);
begin
Location := Location1;
Writeln('Location - ' + Location);
end;
procedure Calculate;
begin
Writeln('Calculating...');
Price1 := Vialofwater * Item1;
Price2 := Bronzepickaxe * Item2;
Price3 := IronAxe * Item3;
Price4 := Cookedmeat * Item4;
Price5 := Tinderbox * Item5;
Price6 := Ballofwool * Item6;
Price7 := Bronzearrow * Item7;
Price8 := Rope * Item8;
Price9 := Papyrus * Item9;
Price10 := Knife * Item10;
TotalGP := Price1 + Price2 + Price3 + Price4 + Price5 + Price6 +
Price7 + Price8 + Price9 + Price10;
Writeln('Calculating Complete - We Need To Withdraw ' +
IntToStr(TotalGp) + ' Gp');
end;
procedure Bank;
begin
FindNormalRandoms;
LoadDTMs;
if HDTMsRotated(ToBankersB, X, Y, 1, 1,ToBankers, X, Y, 1, 1) then Changeloc('Bank') else if FindSymbol(X, Y, 'bank') then
begin
MouseFlag(X -5, Y, 2, 2);
Changeloc('Bank');
end else logout;
if DTMRotated(BankBooth, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(X, Y, 3, 3,false)
wait(10);
if Chooseoption('quickly') then
begin
repeat
Wait(100);
until (bankscreen or PinScreen)
if BankScreen then
begin
Changeloc('In BankScreen');
DepositAll;
Calculate;
fixbank;
if BankScreen then
Withdraw(1,1,TotalGP);
Writeln('Withdrawing Complete - We Have Withdrawed ' +
IntToStr(TotalGp) + ' Gp');
CloseBank;
FindNormalRandoms;
ChangeLoc('Bank');
end
else
begin
Changeloc('In PinScreen');
inpin(pin)
repeat
wait(100);
until (bankscreen)
fixbank;
Changeloc('In BankScreen');
DepositAll;
Calculate;
if BankScreen then
Withdraw(1,1,TotalGP);
Writeln('Withdrawing Complete - We Have Withdrawed ' +
IntToStr(TotalGp) + ' Gp');
CloseBank;
FindNormalRandoms;
ChangeLoc('Bank');
end;
end;
end;
end;
//Thanks N3ss3s
function OpenDoor(Rotate: Boolean): Boolean;
var
TPA, TPA2: TPointArray;
C, X, Y, I: Integer;
TP: TPoint;
begin
MakeCompass('E');
if (not (LoggedIn)) then
Exit;
for I := 0 to 3 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA,
2189191, 20, 20, MSX2 - 10, MSY2 - 10, 10);
for C := 0 to GetArrayLength(TPA) - 1 do
begin
TP := TPA[c];
FindColorsTolerance(TPA2, 2189191, TP.x - 25, TP.y -
25, TP.x + 25, TP.y + 25, 10);
if (GetArrayLength(TPA2) > 150) then
begin
MiddleTPAEx(TPA2, X, Y);
MMouse(X, Y, 5, 5);
if (Pos('lose', GetUpText) > 0) then
begin
Result := true;
Exit;
end
else
begin
if (Pos('pen', GetUpText) > 0) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 1, 1, true);
Result := true;
Exit;
end;
end;
end;
end;
if not Rotate then
begin
Exit;
end
else
begin
ActivateClient;
Wait(125 + Random(25));
SendArrowSilentWait(1, 1100 + Random(150));
end;
end;
MakeCompass('N');
end;
procedure Walking;
begin
LoadDTMs;
if (Location = 'Bank') then
begin
FindNormalRandoms;
FindRoadColor;
Wait(1000);
FindRoadColor;
if RadialRoadWalk(RoadColor, 275, 320, 70, X, Y) then Flag else Logout;
if RadialRoadWalk(RoadColor, 270, 360, 60, X, Y-3) then Flag else Logout;
if FindSymbol(X, Y, 'shop') then
begin
MouseFlag(X, Y, 4, 0);
ChangeLoc('Shop');
OpenDoor(true);
MakeCompass('N');
Exit;
end else
wait(2500+random(2500));
if DTMRotated(ShopDtm, X, Y, MMX1, MMY1, MMX2, MMY2) then
begin
MouseFlag(X , Y, 3, 3)
ChangeLoc('Shop');
OpenDoor(true);
MakeCompass('N');
Exit;
end else
wait(2500+random(2500));
if FindSymbol(X, Y, 'shop') then
begin
MouseFlag(X, Y, 4, 0);
ChangeLoc('Shop');
OpenDoor(true);
MakeCompass('N');
logout;
Exit;
end;
end else if (Location = 'Shop') then
begin
ChangeLoc('Shop');
OpenDoor(true);
FindRoadColor;
Wait(1000);
FindRoadColor;
MakeCompass('N')
if RadialRoadWalk(RoadColor, 85, 95, 68, X-2, Y) then Flag else Logout;
if RadialRoadWalk(RoadColor, 150, 90, 70, X, Y) then Flag else Logout;
if FindSymbol(X,y,'Bank') then exit;
if RadialRoadWalk(RoadColor, 120, 90, 63, X, Y) then Flag else Logout;
end;
end;
procedure ShopKeeper;
var
TMT, Times: Integer;
begin
TMT := 0;
FindNormalRandoms
if not ShopScreen then
begin
Writeln('ShopScreen Not Found, Searching ShopKeeper');
repeat
Times:=0;
TMT := TMT + 1 if FindObjCustom(X, Y, ['emad', 'ortan'],
[8300243, 2574958], 10) then begin Wait(50 + Random(20));
Mouse(X, Y, 1, 1, false);
Wait(50 + Random(20));
if ChooseOption('rade') then
begin
Writeln('Traded - Shop Keeper');
repeat
Times:= Times + 1
wait(100);
until (ShopScreen) or (Times > 50);
if shopscreen then exit;
end;
end;
until (TMT > 10)
Writeln('Could Not Find ShopKeeper');
ChangeLoc('Lost At Shop')
end
else
Exit;
end;
Procedure HMouse(CoordX, CoordY, RandomCoordx, RandomCoordY,
ItemNumber: Integer);
begin
mouse(CoordX, CoordY, RandomCoordx, RandomCoordY, false);
if ChooseOption('Buy X') then
begin
wait(1000 + Random(500));
Sendkeys(IntToStr(ItemNumber) + '');
Wait(100+random(500));
sendkeys(Chr(13) + '');
Wait(1000 + Random(500));
end
else
logout;
end;
procedure BuyItems;
begin
if ShopScreen then
begin
if (Item1 > 0) then
HMouse(78, 118,5,5,Item1);
if (Item2 > 0) then
HMouse(117, 106,5,5,Item2);
if (Item3 > 0) then
HMouse(153, 112,5,5,Item3);
if (Item4 > 0) then
HMouse(195, 114,5,5,Item4);
if (Item5 > 0) then
HMouse(235, 113,5,5,Item5);
if (Item6 > 0) then
HMouse(276, 110,5,5,Item6);
if (Item7 > 0) then
HMouse(314, 109,5,5,Item7);
if (Item8 > 0) then
HMouse(350, 111,5,5,Item8);
if (Item9 > 0) then
HMouse(390, 113,5,5,Item9);
if (Item10 > 0) then
HMouse(430, 113,5,5,Item10);
mouse(485, 41,3,3,true);
FindNormalRandoms;
end
else
end;
procedure SetupScript;
var
MaxNumberOfItems: Integer;
begin
MaxNumberOfItems := Item1 + Item2 + Item3 + Item4 + Item5 +
Item6 + Item7 + Item8 + Item9 + Item10 if MaxNumberOfItems > 28 then
begin
ClearDebug;
Writeln('NOOB ERROR - YOU FOOL YOU HAVE SET IN TOTAL MORE THAN 28 ITEMS AT THE SETUP - MAX 27 ITEMS!!');
terminatescript;
end;
DeclarePlayers;
ActivateClient;
LoginPlayer;
ClearDebug;
Location := 'Bank';
Wait(1000);
SetAngle(true);
MakeCompass('N');
SetRun(True);
end;
begin
SetUpSRL;
SetupScript;
Loads := 0;
ClearDebug
repeat
SetRun(True);
Bank;
Walking;
Shopkeeper;
BuyItems;
walking;
Loads := Loads + 1;
if (Location = 'Lost') or (Location = 'Lost At Shop') then Loads := Loads - 1;
WriteLn('//########################################################')
WriteLn('//# Ran for : ' + (timerunning) + ' ##');
WriteLn('//# Loads Done : ' +IntToStr(Loads)+' ( '+intToStr(loads*28)+' Items in Total) ##');
Writeln('//########################################################');
until (Loads > HowManyLoads - 1) or (Location = 'Lost') or (Location = 'Lost At Shop') or (Not(Loggedin))
if (Loads > HowManyLoads - 1) then Bank;
logout;
end.If you have Problems then next Time Read all what is above!