SRL Archive - General Botting Help

Getting a runtime error: "Access violation".... more within...


thickfreakness

2014-08-29 01:45:58

I'm trying to check if a character, in the string: word, is present at a particular position
here's a snippit


word := 'reset the whole string, yes all of it';
word := (getmouseovertext());

if word[11] = 's' then
if word[12] = 's' then
Result := 1;

However, right before the if statements (I guess), I'm getting this error
"Exception in Script: Runtime error: "Access violation" at line 161, column 19
The following bitmaps were not freed: [Minimap Mask]".

I'm very confused any and all help is much appreciated.

bonsai

2014-08-29 02:55:51

getmousovertext() probably returned an empty string ''

Then you told the program to look at character 11, past the end of the string.

That generates the access violation, you wandered into memory that you weren't supposed to be touching.

There's a built in function to get your string position…

program new;
begin
writeln(pos('find','can it find me?') );
end.

Compiled successfully in 218 ms.
8
Successfully executed.

thickfreakness

2014-08-30 02:18:06

There's a built in function to get your string position…


Dang if only it said segment fault or something lol.
Whats the include for that function, if you mind me asking?

riwu

2014-08-30 02:38:29

From: thickfreakness
Dang if only it said segment fault or something lol.
Whats the include for that function, if you mind me asking?

no include, exported function Pos()


Result := Pos('ss', getmouseovertext());
if Result = 0 then
writeln('ss not found from getmouseovertext()');

Brandon

2014-08-30 03:14:10

Not sure how you actually got that to even access violate since it will never compile in the first place..


"Word" is a reserved keyword/type. It's like naming your integer: "Integer" or naming your string: "String".

You can't.

riwu

2014-08-30 03:18:12

From: Brandon
Not sure how you actually got that to even access violate since it will never compile in the first place..


"Word" is a reserved keyword/type. It's like naming your integer: "Integer" or naming your string: "String".

You can't.

well for some reason it actually works in pascalscript…apparently pascalscript doesn't check for type names…
you could even declare 'break'/'continue' as a variable…