PDA

View Full Version : MakeCompass Error



qisp
11-16-2013, 11:28 PM
Hi all,

I have a script that uses


MakeCompass(RandomRange(0, 360));

This line after about an hour and a half of running the script everytime throws this error.


Exception in Script: Runtime error: "Access violation" at line 50, column 14

I'm not sure why or what to make of it. If anyone has and answers I'd appreciate it.

bonsai
11-19-2013, 09:58 AM
I see no one answered this. I don't know the libraries involved with the OS code but I will suggest a general debugging idea.

If it only happens once in a while it's probably due to the random number.

Functions tend to fail in edge cases so I would try making a test script that calls MakeCompass(0) and MakeCompass(360). Perhaps one of these causes the access violation.

Tickyy
11-21-2013, 10:42 AM
Hi all,

I have a script that uses


MakeCompass(RandomRange(0, 360));

This line after about an hour and a half of running the script everytime throws this error.



I'm not sure why or what to make of it. If anyone has and answers I'd appreciate it.

Hi there!

Well, i took my time and downloaded Simba to see directly inside the include of SRL, so we can understand the function. So the information about the function says this:


function MakeCompass(Direction: Variant): Boolean;

Aligns RS to specified direction
- Enter a compass angle ('n', 's', 'e', 'w') or degree (23.3, 25, 205.2)
and it will move the compass to that angle. Also accepts 'random',
and 'rand' to make the compass a random direction.

So instead of using the function RandomRange like you did, you could just use the function randomness like this:

MakeCompass('random');

or this:

MakeCompass('rand');

If this also errors, try to re-update simba and your include. If after that it still continues to error, please come back again, and show us your script, so we can help further.

mohsin378
11-29-2013, 04:33 AM
I'm not sure why or what to make of it. If anyone has and answers I'd appreciate it.

barty180
12-04-2013, 04:02 AM
looks complicated