Hello,

I'm having troubles figuring out why my script won't find the mouseOverText I set.

I checked the debug box and saw this:
Debug




I suspect that this was caused by my simple findobj function because I didn't have this problem when I was still using the mainScreen.findObject function. This only happened when I tried to learn and make my own simple findObj function.

Here's the function:
simple findobj func

Simba Code:
function renzanityFindObj(hue, sat: extended; W, H, colour, tolerance, clickType: integer; mouseOverText, chooseOptions: array of string): boolean;
var
  i, x, y: integer;
  TPA: TPointArray;
  ATPA: T2DPointArray;
begin
  if not isLoggedIn() then
    exit(false);

  findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat));

  if (length(TPA) < 1) then
    exit();

  ATPA := TPA.cluster(W, H);
  ATPA.filterBetween(0, 5);
  ATPA.sortFromSize(25, true);
  ATPA.sortFromMidPoint(mainscreen.playerPoint);

  for i := 0 to high(ATPA) do
  begin
    case random(5) of
      0..3:  missMouse(middleTPA(ATPA[i]), true)
    else
      mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
    end;

    if isMouseOverText(mouseOverText, 500) then
    begin
      fastClick(clickType);
      if clickType = MOUSE_LEFT then
        exit(true);

      if chooseOption.select(chooseOptions) then
        exit(true)
      else
      begin
        mouse(mainscreen.getBounds().getGaussPoint(), MOUSE_MOVE);
      end;
    end;
  end;
end;


This problem only occurs after it deploys the well that I'm trying to detect, but when the well is already placed before running the script, it runs smoothly.

EDIT:
I just discovered that I'm not having problems running the script in Lumbridge but not on the 2 other places I've tried 'Burthorpe' and 'Shantay Pass'.

EDIT 2:
Tested it further, but it also bugs out in Lumbridge at some point.

EDIT 3:
Resolved. Added a couple of waitTimes on my script. Sorry for disturbing you guys with my noobie mistake.