Hey there Kodex, congratulations on getting your first script up
.
Firstly, to make it far easier for people to read, chuck your script in [ simba ][ /simba ] tags, then it'll look like so:
Simba Code:
program TeleTabber;
{$DEFINE SMART}
{$i srl-6/srl.simba}
procedure changeAngleBoss();
begin
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
procedure clickTree();
var
x, y: integer;
begin
if mainscreen.findObject(x, y, 10266538, 19, ['ecter'], MOUSE_RIGHT) then
begin
chooseOption.select(['Study']);
if productionScreen.isOpen(5000) then
productionScreen.clickStart()
end;
end;
function TRSProgressScreen.__find(): boolean; //Credit to Mayor for the poh progress screen fix
override;
const
BORDER_COLOR = 5327681;
BORDER_COLOR_BOTTOM = 5919042;
BORDER_LENGTH = 232;
var
tpa: TPointArray;
atpa: T2DPointArray;
i, hh: integer;
b: TBox;
p: TPoint;
begin
if findColors(tpa, BORDER_COLOR, getClientBounds()) then
atpa := tpa.cluster(1);
if length(atpa) < 1 then
exit(false);
for i := 0 to high(atpa) do
//writeLn('[' + toStr(i) + '] length: ' + toStr(length(atpa[i])));
for i := 0 to high(atpa) do
if (length(atpa[i]) = BORDER_LENGTH) then
begin
b := atpa[i].getBounds();
//writeLn(toStr(getColor(b.x1 - 39, b.y1 + 101)) + ' | ' + toStr(getColor(b.x1 - 39, b.y1 + 102)));
if (getColor(b.x1 - 39, b.y1 + 101) = BORDER_COLOR_BOTTOM) or (getColor(b.x1 - 39, b.y1 + 102) = BORDER_COLOR_BOTTOM) then
begin
self.setBounds([b.x1 - 54, b.y1 - 27, b.x2 + 56, b.y2 + 122]);
exit(true);
end;
end;
end;
procedure getclay();
begin
repeat
wait(5000);
until (not progressScreen.isOpen());
end
procedure getmore();
var
x, y: integer;
begin
if mainscreen.findObject(x, y, 2039572, 10, ['utler'], MOUSE_RIGHT) then
begin
writeLn('We right clicked a tree!');
chooseOption.select(['Fetch']);
wait(2000);
conversationBox.selectOption(1);
end;
end;
begin
clearDebug();
setupSRL();
changeAngleBoss();
clickTree();
getclay();
getmore();
wait(20000);
repeat
clickTree();
getclay();
getmore();
wait(20000);
until false;
end.
I've gone ahead and ran this through the built-in code parser in Simba (View -> Extensions -> Enable formatter.sex) and then Parser -> Format Script. Standards help you troubleshoot your own script when there are errors and to make it much easier to read and add on to. I recommend viewing this tutorial on standards.
As said above, ensure your wait times are randomised within a certain range using wait(RandomRange());.
I look forward to seeing your ability improve and I certainly look forward to seeing your contributions to this amazing community
.