The Anihilator
2015-01-14 14:32:37
As i am reading the tutorials, I have been creating a simple script to help me understand what i am reading (by creating)…
My script plan is
Start - castle Wars
run to teak tree
cut logs
run to castle bank chest
deposit logs
repeat
I been using Mayor's tutorials and have received some help in private from him… Thank you so much for all you've done mayor.
so here are some question i have
1)
In tutorial it is stated to use randoms… and was placed in script as such..
but below i see you have changed this to …
Why?
2) In my progress report Mayor told me - "Missing the global 'LoadsDone' variable" i placed and now get error -
Error: Unknown declaration "LoadsDone" at line 50
Compiling failed.
My entire script at this point is as such
My script plan is
Start - castle Wars
run to teak tree
cut logs
run to castle bank chest
deposit logs
repeat
I been using Mayor's tutorials and have received some help in private from him… Thank you so much for all you've done mayor.
so here are some question i have
1)
In tutorial it is stated to use randoms… and was placed in script as such..
wait(randomRange(1000, 2000)); but below i see you have changed this to …
wait(gaussRangeInt(1000,2000)); Why?
2) In my progress report Mayor told me - "Missing the global 'LoadsDone' variable" i placed and now get error -
Error: Unknown declaration "LoadsDone" at line 50
Compiling failed.
procedure depositlogs();
var
bankTimer: TTimeMarker;
begin
if not isLoggedIn() then
exit;
if depositBox.isOpen() then
begin
bankTimer.start();
repeat
if (depositBox.count > 0) then
begin
depositBox.quickDeposit(QUICK_DEPOSITBOX_INVENTORY);
wait(gaussRangeInt(1000,2000));
end;
until(depositBox.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 10000);
inc(LoadsDone);
end;
depositBox.close();
end;
procedure progressReport();
var
logsCut, profit, profitPerHour: integer;
begin
logsCut:= LoadsDone * 28;
profit := (logsCut * 375);
profitPerHour := round((profit * 60) / (getTimeRunning() / 60000));
writeLn('========================================================');
writeLn('TAs_Teak_logs_to_Castle_Bank');
writeLn('Time Run: ' + timeRunning);
writeLn('Logs Cut: ' + intToStr(logsCut));
writeLn('Loads Done: ' + intToStr(loadsDone));
writeLn('Profit Made: ' + intToStr(profit));
writeLn('Per Hour: ' + intToStr(profitPerHour));
writeLn('========================================================');
end;
My entire script at this point is as such
program TAs_Teak_logs_to_bank;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'username';
password := 'password';
isActive := true;
isMember := true;
end;
currentPlayer := 0;
end;
procedure findDepositBox();
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit;
repeat
mainscreen.findObject(x, y, 724754, 1, colorSetting(2, 2.39, 2.71), mainscreen.playerPoint, 30, 50, 50, ['ank', 'chest'], MOUSE_LEFT);
wait(randomRange(1000, 2000));
inc(i);
until depositBox.isOpen() or (i >= 15);
end;
procedure depositlogs();
var
bankTimer: TTimeMarker;
begin
if not isLoggedIn() then
exit;
if depositBox.isOpen() then
begin
bankTimer.start();
repeat
if (depositBox.count > 0) then
begin
depositBox.quickDeposit(QUICK_DEPOSITBOX_INVENTORY);
wait(gaussRangeInt(1000,2000));
end;
until(depositBox.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 10000);
inc(LoadsDone);
end;
depositBox.close();
end;
procedure runToTree();
var
pathToTree: TPointArray;
begin
if not isLoggedIn() then
exit;
pathToTree :=[Point(613, 141), Point(613, 141), Point(614, 127), Point(651, 127), Point(682, 130), Point(692, 134), Point(686, 161), Point(669, 192), Point(656, 211), Point(634, 226), Point(602, 250), Point(567, 261), Point(504, 265), Point(450, 264), Point(407, 263), Point(376, 268), Point(326, 270), Point(277, 273), Point(239, 268), Point(197, 275), Point(160, 287), Point(134, 293)]
if SPS.walkPath(pathToTree) then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the Tree');
end;
procedure chopTeak();
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit;
begin
if mainscreen.findObject(x, y,999465, 7, ['eak'], MOUSE_RIGHT)then
begin
writeLn('We right clicked a tree!');
chooseOption.select(['hop down']);
tabBackPack.waitForShift(5000);
end;
end;
begin
clearDebug();
setupSRL();
repeat
repeat
chopTeak();
until tabBackpack.isFull();
findDepositBox();
depositLogs();
until false;
end;
procedure hikeToBank();
var
pathToBank: TPointArray;
begin
if not isLoggedIn() then
exit;
pathToBank :=[Point(133, 292), Point(161, 289), Point(183, 282), Point(207, 274), Point(244, 269), Point(288, 268), Point(327, 269), Point(373, 268), Point(412, 262), Point(467, 262), Point(522, 261), Point(584, 258), Point(628, 238), Point(662, 219), Point(695, 182), Point(701, 142), Point(675, 131), Point(621, 128), Point(612, 135)]
if SPS.walkPath(pathToBank) then
minimap.waitPlayerMoving()
else
writeLn('We failed to walk to the Bank');
end;
procedure progressReport();
var
logsCut, profit, profitPerHour: integer;
begin
logsCut:= LoadsDone * 28;
profit := (logsCut * 375);
profitPerHour := round((profit * 60) / (getTimeRunning() / 60000));
writeLn('========================================================');
writeLn('TAs_Teak_logs_to_Castle_Bank');
writeLn('Time Run: ' + timeRunning);
writeLn('Logs Cut: ' + intToStr(logsCut));
writeLn('Loads Done: ' + intToStr(loadsDone));
writeLn('Profit Made: ' + intToStr(profit));
writeLn('Per Hour: ' + intToStr(profitPerHour));
writeLn('========================================================');
end;
begin // main loop
clearDebug();
smartEnableDrawing := true;
disableSRLDebug := false;
setupSRL();
declarePlayers();
SPS.setup('TEAK_MAP', RUNESCAPE_OTHER);
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);
end;
if tabBackpack.isFull() then
begin
hikeToBank();
findDepositBox();
depositlogs();
end;
runToTree();
chopTeak();
hikeToBank();
findDepositBox();
depositLogs();
progressReport();
end.
:D