So I'm assuming creating scripts just is NOT for me as I've been attempting making this for months. It's supposed to be a basic potato picker which runs from draynor bank to the field, picks potatos and returns to the bank, repeat. This is how far I got with it and I just struggle even harder every time I try to re make it. I would love if someone could fix it up and post it if anything I've written is salvageable, if not I understand!

Thanks everyone for your time

-Cactus


Code:
program Potato_Picker;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}





procedure DeclarePlayers;
begin
  HowManyPlayers := 1;
  NumberOfPlayers(HowManyPlayers);
  CurrentPlayer := 0;

  Players[0].Name := '';
  Players[0].Pass := '';
  Players[0].Nick := '';
  Players[0].Active := True;
  Players[0].Pin := '';
  Players[0].WorldInfo := [383];
end;

procedure BoredHuman1;
var
  i, x, y: Integer;
  Deg: Variant;
begin
  if not LoggedIn then exit;
  Deg := rs_GetCompassAngleDegrees;
  for i := 1 to (3 + Random(11)) do
  begin
    MMouse(Random(MSX2), Random(MSY2), 0, 0);
    if IsUpText('opti') then
    begin
      GetMousePos(x, y);
      Mouse(x, y, 0, 0, mouse_right);
      //ChooseOption('Examine');        //Removed this selection from original BoredHuman Antiban Include.
    end;
    case Random(6) of
      0: SendArrowWait(((Random(2) * 2) + 1), 1000 + Random(200));
      1: SendArrowWait(((Random(2) * 2)), 1000 + Random(200));
      2: SendArrowWait(((Random(2) * 2) + 1), 200 + Random(200));
      3: SendArrowWait(((Random(2) * 2)), 200 + Random(200));
      4: SendArrowWait(((Random(2) * 2) + 1), 20 + Random(20));
      5: SendArrowWait(((Random(2) * 2)), 20 + Random(20));
    end;
  end;
  if (Deg <> 0) then
    MakeCompass(Round(Deg))
  else
    MakeCompass('N');
  SendArrowWait(0, 750 + Random(500));
end;

procedure antiban();
begin
R_FindNormalRandoms;
case Random(110) of
1: R_FindNormalRandoms;
10: BoredHuman1();
20: setangle(0);
30: setangle(0);
40: PickUpMouse;
50: RandomRClick;
60: RandomMovement;
70: SleepAndMoveMouse(200 + Random(50));
90: RandomMovement;
100: R_FindNormalRandoms;
end;
R_FindNormalRandoms;
end;

procedure ClickGate;

var
X,Y:Integer;
begin
FindColorTolerance(X, Y, 343913, 244, 201, 313, 205, 5)
mmouse(x, y, 1, 1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;


procedure ToPotato;

begin
RunEnergy(50);
R_WalkPath([Point(3092, 3245)]);
  antiban();
R_WalkPath([Point(3104, 3260)]);
  antiban();
R_WalkPath([Point(3116, 3262)]);
  antiban();
R_WalkPath([Point(3132, 3270)]);
  antiban();
R_WalkPath([Point(3133, 3286)]);
  antiban();
R_WalkPath([Point(3146, 3292)]);
  antiban();
ClickGate;
end;

procedure FindPotato;
var
   tmpCTS, x, y, i : integer;
   TPA: TPointArray;

begin
  //mouseSpeed := 50;
  tmpCTS := GetToleranceSpeed;

  SetColorToleranceSpeed(2);
  SetToleranceSpeed2Modifiers(0.025,0.44);

  FindColorsSpiralTolerance(x, y, TPA, 19116720, MSX1, MSY1, MSX2, MSY2, 20);

  SetColorToleranceSpeed(tmpCTS);
  SetToleranceSpeed2Modifiers(0.02, 0.02);


  for i := 0 to High(TPA) do
    begin
      wait(randomrange(60, 200));
      mmouse(TPA[i].x, TPA[i].y, 2, 2);
      if waituptext('otato', 300) then
        Break;
      end;
    writeln('Potato Picked');
    clickmouse2(mouse_left);
    wait(RandomRange(1350, 1500));
end;

procedure FromPotato;

begin
ClickGate;
R_WalkPath([Point(3145, 3293)]);
  antiban();
R_WalkPath([Point(3137, 3280)]);
  antiban();
R_WalkPath([Point(3129, 3265)]);
  antiban();
R_WalkPath([Point(3115, 3261)]);
  antiban();
R_WalkPath([Point(3100, 3250)]);
  antiban();
R_WalkPath([Point(3092, 3245)]);
  antiban();
end;


procedure BankPotato;
var
x, y,Integer;
begin
  if InvCount = 0 then
  exit;
  else
  repeat
  repeat
  antiban;
  FindColorSpiralTolerance(x, y, 5064779, MSX1, MSY1, MSX2, MSY2, 5)
  until(FindObj(x, y, 'booth', 5064779, 25) or BankScreen or PinScreen)
  writeln('Found Bank Booth');
  MMouse(x, y, 6, 8);
  ClickMouse2(mouse_left);
  writeln('Opening Bank!');
  wait(1000);
  until(BankScreen or PinScreen);
  writeln('Bank Is Open');
  wait(RandomRange(1500, 1700));
  if PinScreen then
  begin
  ClearDebug;
  writeln('PLEASE UNLOCK BANK Then Rerun Script');
  TerminateScript;
  end;
  if InvCount >= 1 then
  DepositAll;
end;

begin

ToPotato;
end.