SCAR will not call this procedure even though I am using the include statements at the top of the script.
Note: This is to be my first script.![]()
SCAR will not call this procedure even though I am using the include statements at the top of the script.
Note: This is to be my first script.![]()
Last edited by Diddy Kong; 02-20-2010 at 05:49 PM.
It would really help if you posted the script.
Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
Originally Posted by #srl
"A programmer is just a tool which converts caffeine into code"
Unknown Identifier is an error quite frequently given when you forget to declare a Variable, or don't include a function your attempting to use.
However, like Sex said, post the script and we can tell you normally exactly what's wrong with it.
Sorry for deleting the attachment you guys (Sorry I wasted your time!)
Well, here is the attachment. I may not be working on this project for much longer.
I don't know if this script will be any good.
Last edited by Diddy Kong; 02-20-2010 at 05:51 PM.
Have you programmed in Java before?
It is because you have $ in the include names. It is an invalid character so just rename all the includes and it will work fine.
Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
Originally Posted by #srl
"A programmer is just a tool which converts caffeine into code"
I'm still getting unknown identifiers. I guess it's not possible to make a huge script into multiples for simplicity/readability?
I thought of the include statement as exactly what it says; I thought it would put that chunk of code from one scar file into another, and ultimately in the end compile that 'one huge script'.
Last edited by Diddy Kong; 02-20-2010 at 06:11 PM.
Why not just combine them all into one? Who cares how long the script it, maybe that will fix the problem too. I'm stumped on why its happening:/.
I've never worked with making my own includes, but what Sex said seems to work. After removing all of the $ (from both the script names and when you include them in another script), you get
You do not have a ComboBox1 (or any other of the variables used in the Start function) in that particular include nor does that include make use of other includes, meaning it cannot compile without knowing what ComboBox1 is.Line 23: [Error] (31:5): Unknown identifier 'ComboBox1' in script C:\Program Files\SCAR\includes\RiverWranglerFormsCallbacks.sc ar
Same goes for your other include with forms: RiverWranglerFormsSplash. You cannot set the variable to a bitmap because SCAR does not know where that variable came from.
And then, you're trying to set variables (such as the boolean Bank which is declared in your actual script) in the include. As far as I know, you cannot do that. To me, it seems that the easiest and best solution would be to merge these into one script. OR you can change your include's functions to return values instead of set values, though, if this is your first script, you might want to start off simpler (using one big script)
EDIT: If you really want to continue with this, what I mean by return is using a function that returns the value you're looking for.
Instead of this:
SCAR Code:procedure InitSplashBitmap;
begin
bmpSplash := [superlongbitmap];
end;
Do
SCAR Code:function InitSplashBitmap: integer;
begin
result := [superlongbitmap];
end;
So if you want to set a variable to the bitmap you have there
SCAR Code:bmpsplash := InitSplashBitmap;
If you need to set several things, do this
SCAR Code:procedure ChangeValues(var Bank: boolean; var AmtFish: integer);
begin
Bank := true;
AmtFish := 5;
end;
That will also change the values of the variables that you put in when calling the function. So if you do
SCAR Code:DoBank := false;
HowManyFish := 0;
ChangeValues(DoBank, AmtFish);
writeln(booltostr(DoBank)+' '+inttostr(AmtFish));
The output will be
true 5
Correct me if I'm wrong on any of this, haven't scripted Scar in a while
Last edited by Runescapian321; 02-20-2010 at 08:25 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)