PDA

View Full Version : Runtime Error



weaselforce
03-24-2006, 06:51 AM
[Runtime Error] : Exception: Access violation at address 006549BC in module 'scar.exe'. Read of address 00000000 in line 43 in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Bank.scar

function BankScreen : Boolean;
begin
Result := IsTextAtEx(185, 34, 'The Bank of', 30, UpChars, True, False, 0, 0, -1);
end;

"result := IsTextAtEx" is line 43.

possibly my fault, i have no idea

my script -

procedure Withdrawfrombank;
begin
OpenBank2(pin);
if Bankscreen then
if TotalDone < emptyvials-28 then
begin
withdraw(1,1,0);
end
(not the whole procedure, just the relevant part)

kk its probably my double "if" statements lol, if it is just tell me and let me fix them. i'm doing this for practice anyway

The Un-Named
03-24-2006, 07:54 AM
You have have 1 if statment leading to another

if(BankScreen)and
(TotalDone < emptyvials-28)then

masquerader
03-24-2006, 09:32 AM
did you load the font or do setupsrl?

weaselforce
03-24-2006, 03:11 PM
um...neither. its not necessariliy a SRL script. this is what i was trying to make with that procedure. If it goes to bankscreen, continue. else logout

then if the bankscreen is true, i want it to continue and check the emptyvials and if theres more than 28 "withdraw all" and if theres less than 28 withdraw "vialstodo" -1

and why would that give me such a horendous error. access violation and stuff

Sdcit
03-24-2006, 03:42 PM
you must put setupsrl, if its being included, and it looks like it is.. :/

weaselforce
03-24-2006, 03:44 PM
some functions are....i thought that would only be if you wanted your army of noobs, (sigh) thank you for the info

WT-Fakawi
03-24-2006, 05:14 PM
it you look at the code, you see what it does:

What SetupSRL basically does is:

- Reset some frequenly used Colors to zero to avoid the "hint variable not used"
- Disguise Scar
- Loads Fonts into memory.
- Marks some timers
- Load some Global Bitmaps (Bitmaps of common Randoms: see also Globals.scar)
- Some misc stuff.

Thats all.

It doesnt do any MultiPlayer stuff :)
The Array is declared Dynamical through NumberOfPlayers(Number: integer);


procedure SetupSRL;
begin
RoadColor := 0;
WaterColor := 0;
BankColor := 0;
Banks := 0;
Frogs := 0;
kLastChoice := -1;


DisguiseScar(MaskName);

UpChars := LoadChars2(AppPath + 'CharsRS22\');
SmallChars := LoadChars2(AppPath + 'CharsChat2\');
StatChars := LoadChars2(AppPath + 'CharsChat2\fontsmall\');
NpcChars := LoadChars2(AppPath + 'includes\SRL\CharsNPC\');
MarkTime(LogOutMark);
MarkTime(RandomChatMark);
MarkTime(RotateMark);
MarkTime(KillScriptMark);
MarkTime(LeaveScreenMark);
MarkTime(HoverMark);
ST:=GetSystemTime;
SetMouseMode(false);
BenMouse:=True;
LoadCoSineArrays;
LoadSRLBitMaps;


ReinCarnate:=False;
SymbolAccuracy:= 0.8;
SetupSRLAutoResponder;
LoadNPCArray;
end;

weaselforce
03-24-2006, 10:58 PM
o lol that would have helped, i did the bank and road by hand, meh.

Thank you for helping me =)