maxzzz
2006-03-18 12:19:58
Hi, I made a string script and I tested it and it most the time it works for atleast 3-4 hours with no problem. Sometimes it misses (not often) the Strings in the bank.
I would like if some people can give me some tips to make it better, and I also tried to make a Writeln(''); with the average of bows per hour but I couldn't finish that.
And I don't know how to make a progressreport that reports every 10 minutes and not every loop, :p .
Every tip is welcome.
Here is the script:
I would like if some people can give me some tips to make it better, and I also tried to make a Writeln(''); with the average of bows per hour but I couldn't finish that.
And I don't know how to make a progressreport that reports every 10 minutes and not every loop, :p .
Every tip is welcome.
Here is the script:
program Stringing;
{.include SRL/SRL.scar}
var
Stringed, StringedReport, Banked, Loops, AverageMultiplier, BowsMade, AverageBows : Integer;
InvString, InvBow : Tpoint;
//+-**********|***********-************|**********-+\\
//| |+ Setup Instructions +| |\\
//+***********|***********-************|**********-+\\
//+ Set Amount to make sure you don't want to make +\\
//+ more bows then you can make. Also set your +\\
//+ bankpin if you have one. +\\
//+ Be sure you start with 14 bs and 14 +\\
//+ unstrung bows in Inventory. +\\
//+-**********|***********-************|**********-+\\
const
Amount = 5000;
BankPin = ;
procedure DragBs;
begin
CMMouse(628, 337, 4, 5);
wait(50+random(50));
GetMousePos(x, y);
HoldMouse(x, y, true);
Wait(20+random(10));
CMMouse(671, 453, 4, 5);
Wait(20+random(10));
GetMousePos(x, y);
ReleaseMouse(x, y, true);
wait(30+random(20));
end;
procedure StringsInBows;
begin
Stringed:=0;
DragBs;
if(InvFull)then
begin
repeat
InvString := ItemCoords(27); // returns coords of string
CMouse(InvString.X, InvString.Y, 4, 6, true); // Moves mouse to string and clicks left
wait(10+random(5)); // wait 10-15 ms
InvBow := ItemCoords(28); // returns coords of bow
CMouse(InvBow.X, InvBow.Y, 4, 6, true); // Moves mouse to pos and clicks left
wait(10+random(5)); // wait 10-15 ms
StringedReport:=StringedReport+1; // obvious
Stringed:=Stringed+1; // obvious
until(Stringed=14+random(1));
end;
end;
procedure FindRandoms;
begin
CloseWindow;
wait(10);
FindLamp('Runecrafting');
wait(10);
TalkToRand;
wait(10);
FindDead;
wait(10);
FindTalk;
wait(10);
FindMod;
wait(10);
FindMime;
wait(10);
FindMaze;
wait(10);
FindPlant;
wait(10);
FindQuiz;
wait(10);
FindFrog;
wait(10);
FindDoctor;
wait(10);
FindDemon;
wait(10);
if(FindFight)then RunAwayDirection('N');
wait(10);
if Findname Then FindTalk;
wait(10);
if FindNewBox then Logout;
wait(10);
end;
procedure WaitWhileString;
begin
repeat
FindRandoms;
until(not(ExistsItem(27)));
end;
procedure CloseWindowBank;
begin
CMouse(454, 41, 10, 3, true);
end;
procedure BankAndWithdraw;
begin
CMMouse(281, 178, 4, 4);
OpenBank2((BankPin));
wait(100+random(50));
if(BankScreen)then
begin
CMMouse(586, 229, 4, 4);
DepositArea(572, 214, 722, 457);
FixBank;
wait(50+random(50));
CMMouse(375, 74, 6, 6);
repeat
PopUp2(375, 74, 4, 4, 'Withdraw X');
repeat
wait(1+random(1));
until(FindText(x, y, 'Enter amount:', 0, 206, 381, 306, 401));
until(FindText(x, y, 'Enter amount:', 0, 206, 381, 306, 401));
wait(20+random(20));
TypeSend('14');
wait(50+random(20));
CMMouse(425, 72, 6, 6);
PopUp2(424, 73, 4, 4, 'Withdraw All');
wait(10+random(5));
CloseWindowBank;
wait(10+random(5));
Banked:=Banked+1;
end;
end;
procedure WaitWhileClosingBank;
begin
repeat
wait(500+random(100));
until(not(BankScreen));
end;
procedure Average;
begin
AverageMultiplier := 3600000/TimeRunning;
BowsMade := Banked*14;
AverageBows := BowsMade*AverageMUltiplier;
end;
procedure ProgresReport;
begin
Writeln('****************************************************');
Writeln('* The script has ran for ' +(TimeRunning));
Writeln('* You have stringed ' +Inttostr(StringedReport) + ' bows and banked ' +Inttostr(Banked) + ' times');
Writeln('* You are making ' +Inttostr(AverageBows) +'bows per hour');
Writeln('****************************************************');
end;
begin
SetupSRL;
DisguiseScar('MSN Messenger');
FixChat;
repeat
Loops:=0;
StringsInBows;
WaitWhileString;
BankAndWithdraw;
WaitWhileClosingBank;
Loops:=Loops+1;
if(Loops=1)then
begin
ProgresReport;
end;
until(Banked*14=Amount);
end.