SRL Archive - SRL Old School RuneScape

MakeCompass Error


qisp

2013-11-16 18:28:59

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

2013-11-19 04:58:04

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

2013-11-21 05:42:18

From: qisp
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

2013-11-28 23:33:31

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

barty180

2013-12-03 23:02:33

looks complicated