SRL Archive - Bugs

Unable to register function


NCDS

2011-11-02 00:19:13

I'm not sure if this belongs here or not so feel free to move if necessary, but I'm not sure what's causing this.

I've been working with iroki plugin on the mime solver. Everything has been going fine, I've just been trying to narrow down the access violation (which I think I might have), but now every time I try to compile the script I was testing with I get this:

[Error] (2:1): Unable to register function at line 1
Compiling failed.

This is what I'm running:

program new;
//{$DEFINE SMART}
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '*****';
Pass := '*****';
Nick := ''; // 3-4 LOWERCASE letters from your username.
Active := True; // True = use this player.
Loc := 'Bank'; // Bank, SouthTree, NorthTree
end;
end;
var
x, y: Integer;

begin
SetupSRL;
ActivateClient;
DeclarePlayers;
//Writeln(IntToStr(PixelShift(IntToBox(MSCx - 40, MSCy - 40, MSCx + 40, MSCy + 40), 500)));
{if InAbyss then
SolveAbyss;
if InQuizRandom then
begin
Writeln('in quiz');
SolveQuiz;
end;
if InCerterRandom then
begin
Writeln('in certer');
SolveCerter;
end;
writeln(IntToStr(CountColorTolerance(13882589, MSx1, MSy1, MSx2, MSy2, 13)));}
//if arnav_InRandom then
//SetAllChats('all', 'Hide', '', 'Off', '', 'Friends', '');

{writeln(IntToStr(GetAmount(ItemCoords(1).x, ItemCoords(1).y)));
ClickNorth(true); }
//FindNormalRandoms;
writeln('wut');
end.
I've restarted Simba multiple times, no success. However, I can compile MSI perfectly fine…

Any thoughts?

Hopefully it's not something stupid, but I can't make any promises, I'm pretty tired.

bolshak25

2011-11-02 00:25:51

number of players should be 1? and when i run it i get

[Hint] (22:3): Variable 'X' never used at line 21
[Hint] (22:3): Variable 'Y' never used at line 21
Compiled successfully in 811 ms.
SRL Compiled in 0 msec
wut
Successfully executed.

thats just copy pasting to simba nad running right away though

NCDS

2011-11-02 00:29:05

Changing the number of players makes no difference. It's been set to '2' for a long time now and not mattered. I never noticed that though, lol.

Coh3n

2011-11-02 02:55:41

What did you change in the plugin?

Markus

2011-11-02 06:43:52

You probably use a type that isn't exported to simba (or something like array of integer, you must use TIntegerArray for stuff like that). Pascalscript doesn't like that and will error.

NCDS

2011-11-02 08:37:29

From: Coh3n
What did you change in the plugin?


From: Markus
You probably use a type that isn't exported to simba (or something like array of integer, you must use TIntegerArray for stuff like that). Pascalscript doesn't like that and will error.


All I changed was a couple color range checks and altered the 'line' to be searched in different situations.

However, I was commenting code trying to slim down the access violation when this started. Perhaps I commented out the initialization of a type when doing that, but the plugin compiled and built successful. I'll have a look at that after work today.

Wizzup?

2011-11-02 08:46:47

From: NCDS
All I changed was a couple color range checks and altered the 'line' to be searched in different situations.

However, I was commenting code trying to slim down the access violation when this started. Perhaps I commented out the initialization of a type when doing that, but the plugin compiled and built successful. I'll have a look at that after work today.


Posting the differences would probably help. :)

NCDS

2011-11-02 08:57:38

After uncommenting everything I had commented it works alright again. This is odd though because I never commented any of the proc's themself, but rather where they were called, though they shouldn't have been called anyways as I was running the mime solver and had commented out the others…

Nava2

2011-11-02 11:02:12

From: NCDS
After uncommenting everything I had commented it works alright again. This is odd though because I never commented any of the proc's themself, but rather where they were called, though they shouldn't have been called anyways as I was running the mime solver and had commented out the others…


did you comment out both the exporting of those functions and the functions? :-)

NCDS

2011-11-02 16:53:39

I commented where the pointers to those functions were initialized. I'm not overly experienced working in lazarus. :redface: