Give me a second and I'll make an example function for you. I will edit this post.
Simba Code:
Function foundNPC: Boolean;
var
mPnt: TPoint;
i,CTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result := False;
if not LoggedIn then
Exit;
FindNormalRandoms;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2); //Change to whatever CTS you want
SetColorSpeed2Modifiers(1.15, 1.99); //Hue/Sat mods
FindColorsSpiralTolerance(MSCX, MSCY, TPA, NPC_COLOR, MSX1, MSY1, MSX2, MSY2, COLOR_TOLERANCE); //Color & tolerance of your NPC
SetColorSpeed2Modifiers(0.02, 0.02); //Reset back to default CTS
ColorToleranceSpeed(CTS); //Reset back to default CTS
if (Length(TPA) < 1) then //None of the color was found, so exit
Exit;
SplitTPAExWrap(TPA, 34, 34, ATPA); //Split our colors into 34x34 boxes
SortATPAFromMidPoint(ATPA, Point(MSCX,MSCY)); //Sort these TPAs starting from the center of the screen
for i:=0 to High(ATPA) do //For each and every TPA do...
begin
mPnt := MiddleTPA(ATPA[i]); //Get the middle of the current TPA
MMouse(mPnt.X, mPnt.Y, 7, 7); //Move the mouse to the middle of that TPA, with a 7 X/Y randomness
if WaitUpTextMulti(['NPC UpTextA','NPC UpTextB','NPC UpTextC'], 300) then //If the UpText is what we want then...
begin
if WaitOptionMulti(['Right-click option A','Right-click option B'], 300) then //If we chose the correct option then...
begin
Result := True; //The function was a success, result = true
Exit; //Exit the function so we don't continue to search for the NPC
end;
end;
end;
end;
This is made with SRL-OSR in mind, not the unofficial P07 include. Like always I recommend you use the official SRL-OSR include.