Right, so I've written a script in pascal to be used in Simba, now what i need - is a direction - a direction to pass on to the next level.
Surprisingly the script works well, better than expected - but that comes at a cost, over-usage of memory.
What i need to do: am i doing it right, or doing it wrong: how to Free TpointArray and TpointArrays.
First:This is how i free The bitmaps, i free them when ever they are called, i get no errors what-so-ever in my script regarding bitmaps and i've debugged them and they all freed properly, is this form correct?
Now what i am doing wrong is that am using the FindColorsTolerance(function) a lot in my script and i never defined the length, or amount of my tpoints, what i need is to free them from memory after they are used (is that even possible?)Code:Function OutOfprayer: Boolean; begin Zero := BitmapFromString(5, 9, 'meJwzdfA0dfCUn/EfiExhbFM7DwYG' + 'BqggjG1s4wokgWw4AysXohKZi1ULRASuEgBRMCjb'); SetBitmapName(Zero, 'Zero Bitmap' ); if (FindBitmapToleranceIn(Zero,X,y,MIX1, MIY1, MIX2, MIY2, 10)) then begin FreeBitmap(zero); Isoutofprayer := true; result := true; end else begin FreeBitmap(zero); Isoutofprayer := false; Result := false; end; end;
For example:
My question is in: (FindColorsTolerance(Monster, 4470582, MSX1, MSY1, MSX2, MSY2, 7))Code:Function Rangepray: Boolean; begin tmpCTS := GetColorToleranceSpeed; ColorToleranceSpeed(2); SetColorSpeed2Modifiers(0.18, 0.10); if (FindColorsTolerance(Monster, 4470582, MSX1, MSY1, MSX2, MSY2, 7)) then begin ColorToleranceSpeed(tmpCTS); SetColorSpeed2Modifiers(0.2, 0.2); range := true; result := true; end else begin ColorToleranceSpeed(tmpCTS); SetColorSpeed2Modifiers(0.2, 0.2); range := false; result := false; end; ColorToleranceSpeed(tmpCTS); SetColorSpeed2Modifiers(0.2, 0.2); end;
my TPA is monster but i never once defined what monster is, What command do i need to add - that wont change anything/hinder my script but will free my Tpa after its used? setlength?.
I did follow TPA guides and what not, but i could never get them to do what i want them to do, the way i use it call it but never define it just makes the script perform better - but at cpu and ram cost, so how do i free it?? if any one knows please reply.



Reply With Quote












