So some time last week I updated the SRL on my computer at work and any code that used GetPixelShiftAverage() broke with an access violation error. It was working prior to an update sometime next week, now it will no longer work. Nothing changed on my end, didn't touch the code just updated SRL through simba. For this reason I haven't updated my SRL back at home, and I can confirm the code is working there.
So here's the procedure that is called when it breaks.
Simba Code:
procedure setAnimationThreshold;
var
PixelShiftResult, PixelShiftTemp, i : Integer;
begin
printStatus('SetAnimationThreshold: Starting...', 1);
PixelShiftBox := IntToBox(273, 177, 301, 204);
AnimTime := 5800;
AnimMaxIter := 10;
AnimMinTime := 200;
AnimTemp := round(AnimTime/AnimMaxIter);
AnimMaxTime := AnimTemp - AnimMinTime;
for i := 1 to AnimMaxIter do
begin
PixelShiftTemp := GetPixelShiftAverage(PixelShiftBox, AnimMinTime, AnimMaxTime);
printStatus('PixelShift: ' + IntToStr(PixelShiftTemp), 2);
PixelShiftResult := PixelShiftResult + PixelShiftTemp;
end;
AnimThreshold := round((PixelShiftResult / AnimMaxIter) * 1.25);
printStatus('Animation Threshold: ' + intToStr(AnimThreshold), 2);
printStatus('SetAnimationThreshold: Finished!', 3);
end;
When the script starts the log will show this....
Code:
......
[00:00:01]: ---- Client is ready.
[00:00:01]: ---- Setup SRL in 31ms.
[00:00:01]: -- setupSRL(): True
[00:00:01]: -- SetAnimationThreshold: Starting...
So it enters my procedure and breaks when GetPixelShiftAverage() is used. Here's the error in Simba,
Code:
Exception in Script: Runtime error: "Access violation" at line 222, column 28 in file "C:\Simba\Includes\SRL-6\lib\utilities\pixelshift.simba"
The following bitmaps were not freed: [Minimap Mask, SMART Debug Image]
File[C:\Simba\Includes\SRL-6/logs/SRL log (24-02-14 at 12.21.26 PM).txt] has not been freed in the script, freeing it now.
I can't confirm what day the update was but it was sometime last week anytime between Feb 18th-21st. Is this a bug that was committed to SRL, or something wrong on my end? Like I said that code executes fine on my other computer that didn't update to whatever the newest version of SRL is. Or is there a way I can just revert to and older version of SRL?