cbrems
2015-03-04 16:17:51
Hello,
I'm currently working on a script to make planks in Taverley that access the Tzhaar bank using the Tokkul-Zo. The goal of the script is firstly for my ironman :P but I also want to provide a script to the community that wont be used for gold farm because of high level requirements, but it can still be used as a money maker.
My current goal is simply to get this thing to work, from there I can add case values/player form to let us pick between mahogany or oak or whatever logs.
However, I am currently stuck pretty badly.
Right now, the script is capable of detecting if there are logs or planks in the inventory (thanks @The Mayor as I stole a ton of your script :)) and then it either goes to the Tzhaar bank using the third option on the TokkulZo or it loadstone teleports to Taverly.
The banking part works, I used a dtm to find the banker, it clicks the first preset box and then teleports to Taverley with the oak logs.
Then it will walk to the plank maker but here is the issue. When I have it find then right click the planker it opens the interface and I get a cosntant "—- Current mouse-over text: """ and the procedure to click the right mousebox on that screen that pops up wont initiate.
Can anybody help me??
I'm currently working on a script to make planks in Taverley that access the Tzhaar bank using the Tokkul-Zo. The goal of the script is firstly for my ironman :P but I also want to provide a script to the community that wont be used for gold farm because of high level requirements, but it can still be used as a money maker.
My current goal is simply to get this thing to work, from there I can add case values/player form to let us pick between mahogany or oak or whatever logs.
However, I am currently stuck pretty badly.
Right now, the script is capable of detecting if there are logs or planks in the inventory (thanks @The Mayor as I stole a ton of your script :)) and then it either goes to the Tzhaar bank using the third option on the TokkulZo or it loadstone teleports to Taverly.
The banking part works, I used a dtm to find the banker, it clicks the first preset box and then teleports to Taverley with the oak logs.
Then it will walk to the plank maker but here is the issue. When I have it find then right click the planker it opens the interface and I get a cosntant "—- Current mouse-over text: """ and the procedure to click the right mousebox on that screen that pops up wont initiate.
Can anybody help me??
program TzHaarPlanker;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
{------------------------------------------------------------------------------)
Instructions:
1. Press play and fill out Player form
2. Profit.
(------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
DON'T TOUCH ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING!
(------------------------------------------------------------------------------}
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /|' }
{ | Global Variable Declaration |' }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/|' }
var
{ DTMs }
PlankDTM, LogDTM, TzhaarBankDTM, LoadsDone: integer;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'CBremsTzHaarPlanker';
scriptHelpThread := 'To Be Added Upon Release';
editBoxLabels := ['Loads To Do'];
editBoxDefaults := ['1000'];
editBoxHints := ['Number of Logs / 28'];
checkBoxLabels := [''];
checkBoxDefaults := [''];
checkBoxHints := [''];
comboBoxLabels := ['Type of Plank'];
comboBoxDefaults := ['Oak'];
setLength(comboBoxItems, length(comboBoxLabels));
comboBoxItems[0] := ['Normal', 'Oak', 'Teak', 'Mahogany'];
end;
end;
procedure declarePlayers();
var
i: integer;
begin
players.setup(playerForm.players);
currentPlayer := 0;
for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]); // Loads To Do
//booleans[0] := strToBool(playerForm.players[i].settings[0]);
strings[0] := playerForm.players[i].settings[1]; // Plank Type
end;
end;
procedure debugSPFSettings();
var
i: integer;
begin
writeln('');
for i := 0 to high(players) do
begin
writeLn('Loads To Do: ', players[i].integers[0]);
writeLn('Plank Type: ', players[i].strings[0]);
end;
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: loadDTMs | }
{ | Description: Loads DTMs into script | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure loadDTMs();
begin
PlankDTM := DTMFromString('mbQAAAHicY2VgYOBmYmAQB2JmIOYEYn4glgZiASBWB2JNIJYDYjdTdaBqRhT8nwETMGLBYAAApJ8Cmg==');
LogDTM := DTMFromString('mggAAAHicY2NgYHjCyMDwCYifA/EdIL4KxG+B+BcQ/wFiBiYGBhYgZgTiz0D+yr54oCAjBv7PgB1gqoRgCAAAPOEK/w==');
TzhaarBankDTM := DTMFromString('mbQAAAHicY2VgYNjNyMAwFYi3APFhID4OxE1A3APENUBcD8SdQFyYkc1wY48uQ0RgEENuSjpDXmoGAxdQPzpmxILBAACXmQza');
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Function: isPlankBackPack | }
{ | Description: Checks if there is a plank in backpack | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
function isPlankBackpack(): boolean;
var
x, y: integer;
begin
if not gameTabs.openTab(TAB_BACKPACK) then
exit;
result := findDTM(plankDTM, x, y, tabBackpack.getBounds());
if result then print('Planks found in backpack');
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Function: isLogBackPack | }
{ | Description: Checks if there is are logs in backpack | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
function isLogBackpack(): Boolean;
var
x, y: integer;
begin
if not gameTabs.openTab(TAB_BACKPACK) then
exit;
result := findDTM(logDTM, x, y, tabBackpack.getBounds());
if result then print('Logs found in backpack');
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Function: isPlankInterfaceOpen | }
{ | Description: Checks if the Plank Interface is open | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
function isPlankInterfaceOpen(): boolean;
var
x, y: integer;
TPA: TPointArray;
begin
result := findColorsSpiralTolerance(x, y, TPA, 1514057, mainscreen.getBounds(), 3, colorSetting(2, 0.22, 1.39));
if result then print('The plank interface is open');
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: antiBan | }
{ | Description: Self-explanatory :P | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure antiBan();
var
i: integer;
begin
if not isLoggedIn() then
exit;
writeLn('Engaging in antiban');
i := random(500);
case i of
1..12: pickUpMouse();
13..18: randomRClickItem();
19..32: sleepAndMoveMouse(random(2000) + 750);
33..85: mouseOffClient(OFF_CLIENT_RANDOM);
86..120: mainScreen.setAngle(MS_ANGLE_HIGH);
121..400: smallRandomMouse();
end;
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: Teleport to Fight Caves | }
{ | Description: Teleport to Fight Caves if there are planks in invo | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure teleBank();
begin
if not isLoggedin() then
exit;
if isPlankBackpack then
typeSend('1', false);
wait(randomRange(920, 1375));
if ConversationBox.isOpen() then
conversationBox.selectOption(5);
wait(randomRange(2425, 2700));
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: Use Tzhaar Bank | }
{ | Description: Find and left click banker, use bank preset button | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure bankTzhaar();
var
x, y: integer
begin
if not isLoggedin() then
exit;
repeat
if findDTM(TzhaarBankDTM, x, y, mainscreen.getBounds()) then
begin
mouse(x, y, 2, 2, MOUSE_MOVE);
if isMouseOverText(['Bank']) then
begin
fastClick(MOUSE_LEFT);
wait(randomRange(2400, 2650));
end;
end;
until bankScreen.isOpen(500);
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
wait(randomRange(500, 1200));
exit;
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: Teleport to Plank Maker | }
{ | Description: Teleports to Taverley, walks to Plank Maker | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure teleToPlanker();
var
pathToPlanker: TPointArray;
p: TPoint;
begin
pathToPlanker := [Point(69, 121), Point(111, 91)];
if not isLoggedin() then
exit;
if isLogBackpack() then
lodestoneScreen.teleportTo(LOCATION_TAVERLEY);
wait(randomRange(16000, 17500));
if SPS.walkPath(pathToPlanker) then
begin
minimap.waitPlayerMoving();
wait(randomRange(500,650));
end;
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: Open the Planking Interface | }
{ | Description: Find and right click Plank Maker | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure openPlankInterface();
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit;
repeat
mainscreen.findObject(x, y, 15389154, 8, colorSetting(2, 0.53, 091), mainscreen.PlayerPoint, 3, 3, 2, ['Talk-to'], MOUSE_RIGHT);
wait(randomRange(1000, 2000));
chooseOption.select(['Buy']);
inc(i);
wait(randomRange(1000, 2000));
until isPlankInterfaceOpen() or (i >= 3);
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: plankLogs | }
{ | Description: Turn Logs into Planks | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure plankLogs();
var
normalBox, oakBox, teakBox, mahoganyBox: TBox
begin
normalBox := intToBox(215, 310, 295, 325);
oakBox := intToBox(530, 355, 600, 372);
teakBox := intToBox(215, 455, 295, 470);
mahoganyBox := intToBox(455, 455, 535, 470);
if not isLoggedIn() then
exit;
wait(randomRange(500, 1000));
players[currentPlayer].strings[0] := 'Oak';
writeLn('Made it to the plank logs procedure');
begin
case (players[currentPlayer].strings[0]) of
'Normal':
begin
mouseBox(normalBox, MOUSE_LEFT);
writeLn('Clicked on the Normal Plank "Buy All" option!');
end;
'Oak':
begin
mouseBox(oakBox, MOUSE_LEFT);
writeLn('Clicked on the Oak Plank "Buy All" option!');
end;
'Teak':
begin
mouseBox(teakBox, MOUSE_LEFT);
writeLn('Clicked on the Teak Plank "Buy All" option!');
end;
'Mahogany':
begin
mouseBox(mahoganyBox, MOUSE_LEFT);
writeLn('Clicked on the Mahogany Plank "Buy All" option!');
end;
end;
end;
end;
{ |\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /| }
{ | Procedure: mainLoop | }
{ | Description: All that the script is or ever could be o.0 | }
{ |__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/__\/| }
procedure mainLoop();
begin
if not isLoggedIn() then
exit;
repeat
if isPlankBackpack() then
begin
teleBank();
bankTzhaar();
end else
teleToPlanker();
openPlankInterface();
plankLogs();
inc(LoadsDone);
until loadsDone = players[currentPlayer].integers[0];
if loadsDone >= players[currentPlayer].integers[0] then
writeLn('Completed amount of requested loads!');
terminateScript();
end;
begin
clearDebug();
initPlayerForm();
runPlayerForm();
SPS.setup('SouthTaverleyMap', RUNESCAPE_OTHER);
loadDTMs();
smartEnableDrawing := true;
if (not playerForm.isScriptReady) then
exit;
declarePlayers();
debugSPFSettings(); //this can be removed if I'm happy with script
setupSRL();
repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(gaussRangeInt(1500, 3500));
exitSquealOfFortune();
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
mainLoop();
until (false);
end