I was following Coh3n's guide on simba scripting, and when I typed it in for practice just as he did, id get this error;
Unknown identifier 'WriteIn'
And when I copied/pasted it, it compiled fine.
I proofread for any errors and could not find anything.
Simba Code:
program PuttingTogetherBasics;
var
Logs: Integer;
Exp: Extended;
const
NUMBER_OF_LOGS = 500;
TREE_TO_CUT = 'Magic';
procedure HowManyLogs;
begin
Logs := 250;
Exp := 195.5;
WriteIn('We have chopped' + IntTostr(logs) +'logs this seesion!';
Wait(500);
WriteIn('We want to chop' + IntToStr(NUMBER_OF_LOGS) +'logs';
Wait(500);
WriteIn('We are chopping' + TREE_TO_CUT +'trees!');
Wait(500);
WriteIn('We have gained' + FloatToStr(Logs * Exp)+'xp this seesion!;);
end;
function WeAreBored: string;
var
s:String;
begin
Result:='What are we going to do now?'
s:='We are very bored chopping all these logs!;
Wait(500);
WriteIn(s);
end;
begin
ClearDebug;
HowManyLogs;
WriteIn(WeAreBored);
end.
And here was the normal one from Coh3n:
Simba Code:
program PuttingTogetherBasics;
// Declareing variables globally
var
Logs: Integer;
Exp: Extended;
// Declareing constants
const
NUMBER_OF_LOGS = 500; // Notice the integer
TREE_TO_CUT = 'Magic'; // Notice the string
// Using a procedure
procedure HowManyLogs;
begin
// This is how we ASSIGN a type to a variable; Remember this ;)
Logs := 250; // Notice we can use the variable "Logs" because it's declared globally
Exp := 195.5;
Writeln('We have chopped ' + IntToStr(Logs) + ' logs this session!'); // Notice the '+', this is required if you are going to Writeln a constant or variable
Wait(500); // This is new, but don't worry; this is a simple procedure that waits the given time in milliseconds (1000ms = 1s)
Writeln('We want to chop ' + IntToStr(NUMBER_OF_LOGS) + ' logs.');
Wait(500);
Writeln('We are chopping ' + TREE_TO_CUT + ' trees!');
Wait(500);
Writeln('We have gained ' + FloatToStr(Logs * Exp) + ' xp this session!');
//FloatToStr is used to convert extended values to strings; it works the same as IntToStr
end;
// Using a function
function WeAreBored: string;
var // Declareing variables locally
s: String;
begin
Result := 'What are we going to do now?'; // Notice that "Result" is a string because the function returns a string
s := 'We are very bored chopping all these logs!';
Wait(500);
Writeln(s); // Notice no "IntToStr" because the variable "s" is already a string
end;
begin // Don't forget to put your procedures/functions in the main loop!
ClearDebug; // This procedure just clears the debug box when you click run
HowManyLogs;
Writeln(WeAreBored); // Since WeAreBored returns a string and Writeln() takes a string as its parameters, the function itself can be called
end. //Notice the '.', signalling the end of the script
Any help is appreciated.
-Kobalt