Need help with my first script
I decided to start learning Simba by attempting to make a power chopper and fletcher.
The woodcutting part works decently enough, but I can't get the fletching part to run, whenever it gets to that part in the debug it says '---- TRSGameTab.__initTabs(): Setup gametab properties' and will just sit there til I exit the script. Any help is appreciated.
Here's the fletching portion:
Code:
procedure fletchLogs();
var
logsDTM, x, y: integer;
begin
if not isLoggedIn() then
exit;
logsDTM := DTMFromString('mrAAAAHic42BgYGBhYmD4w8jAwA+k2YGYF4gZgFgAiP8DxScB8WQo7gHiWUA8E4h7gbgPiL0sFBmqk80Y4t21GGLcNIGaGRlasqwYfK2UwDQhwEgAwwAAvWUNNw==');
if findDTM(logsDTM, x, y, tabBackPack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['raft', 'ogs']) then
fastClick(MOUSE_LEFT);
if toolScreen.isOpen(3000) then
toolScreen.select('Knife');
if productionScreen.isOpen(5000) then
productionScreen.selectBox(1);
productionScreen.clickStart();
if progressScreen.isOpen(5000) then
begin
repeat
antiPattern();
wait(1000);
until (not progressScreen.isOpen());
end;
end;
end;
and here's the entire script:
Code:
Program ayoPowerFletcher;
{$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 := ''; //change this
password := ''; //and this
isActive := true;
isMember := false;
end
currentPlayer := 0;
end;
procedure antiPattern();
begin
if (not isLoggedIn()) then
exit;
case random(300) of
1: hoverSkill(SKILL_WOODCUTTING);
2: sleepAndMoveMouse(5000 + random(1000));
3: smallRandomMouse();
4: randomRClickItem();
5: pickUpMouse();
6: boredHuman();
7: mouseOffClient(OFF_CLIENT_RANDOM);
8: hoverRandomSkill();
9:
end;
end;
procedure clickTree();
var
x, y: integer;
begin
if (not isLoggedIn()) then
exit;
if (tabBackPack.isFull()) then
exit;
if mainscreen.findObject(x, y, 925721, 11, ['vergreen'], MOUSE_RIGHT) then
begin
chooseOption.select(['verg', 'gree']);
tabBackPack.waitForShift(5000);
end;
end;
procedure fletchLogs();
var
logsDTM, x, y: integer;
begin
if not isLoggedIn() then
exit;
logsDTM := DTMFromString('mrAAAAHic42BgYGBhYmD4w8jAwA+k2YGYF4gZgFgAiP8DxScB8WQo7gHiWUA8E4h7gbgPiL0sFBmqk80Y4t21GGLcNIGaGRlasqwYfK2UwDQhwEgAwwAAvWUNNw==');
if findDTM(logsDTM, x, y, tabBackPack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['craft', 'ogs']) then
fastClick(MOUSE_LEFT);
if toolScreen.isOpen(3000) then
toolScreen.select('Knife');
if productionScreen.isOpen(5000) then
productionScreen.selectBox(1);
productionScreen.clickStart();
if progressScreen.isOpen(5000) then
begin
repeat
antiPattern();
wait(1000);
until (not progressSCreen.isOpen());
end;
end;
end;
// main loop
begin
clearDebug(); // Clear the debug box
smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
declarePlayers(); // Set up your username/pass
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
wait(randomRange(2000, 6000));
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
exitTreasure(); // Exit treasure hunter
end;
repeat
repeat
clickTree();
until tabBackPack.isFull();
fletchLogs();
until false;
end.