Originally Posted by
Brotein
I'm having the same issues as you, sometimes I will get access violations when just trying to compile but they will go away after hitting F9 a bunch or if I quickly target the simba window after enabling and disabling smart. But I am also having problems where closest function is not clicking on the closest object in the array.
If you look back at this check the date, I'm gonna edit it as soon as I can (at work)
Ultimately though the access violation is out of our control. Simba will crash sometimes in which case relaunching the script will solve it, sometimes though you will HAVE to close out of SMART then run the script again, login and then go from there. Annoying, but you'll get used to it and get in the habit of correcting it quickly.
As for finding the closest object ensure you have the latest ogLib.
Simba Code:
var
funcModelArray:glModelArray;
funcPointArray:tPointArray;
funcPointArrayIndex:uInt32=0;
begin
if length(funcModelArray:=ogl.getModels(NPC)) then
begin
funcPointArray:=ogl.getClientMidPoint().closest(funcModelArray);
for funcPointArrayIndex to high(funcPointArray) do
begin
if not funcPointArray[funcPointArrayIndex].isVisible() then
begin
//(0,-40)the offset of clicking opposed to clicking at the base of the model Pickpocket is your right-click option mouse.rightClickOption(funcPointArray[funcPointArrayIndex].adjustPosition(0,-40).randomizePointEllipse(20),'Pickpocket');
break;
end
else if funcPointArrayIndex=high(funcPointArray) then
mainScreen.setDegrees(normalRandom(0,360),normalRandom(0,50));
end;
end;
end;