Ive read so many tuts and i still dont get scripting.I get confused on varibles and how to use them any help please an example wold be nice thanks.


Ive read so many tuts and i still dont get scripting.I get confused on varibles and how to use them any help please an example wold be nice thanks.
Variables are values which you store into script, see this example of string, string is between '(here)' and string is usually text, see this small scar script
There's variable Text:String; and i made it "value" to text 'Lol' and writeln(Text) writes the variable Text:String;SCAR Code:program New;
var
Text:String;
begin
Text:='Lol';
Writeln(Text)
end.
--------------------------------------------------
Something about integers=Numbers
One,Two:Integer; are number variables, i declared variable One to number 1 and variable Two to number 2. writeln(inttostr(One+Two)) writes how much is variable One plus Variable Two. (inttostr means integer to string, you must have all written as string in writeln(); )SCAR Code:program New;
var
One,Two:Integer;
begin
One:=1
Two:=2
writeln(inttostr(One+Two))
end.
--------------------------------------------
About boolean variable:
SCAR Code:program New;
var
IsItTen:Boolean; //IsItTen is boolean, it returns as True or False
var
Count:Integer;//Dont mind about this.
begin
repeat
wait(250)
Count:=Random(11)//Gets the random number
if(Count=10)then //If random 11 numbers are 10, boolean IsItTen changes to True.
IsItTen:=True //
else //If random 11 numbers aren't 10, boolean IsItTehn will be False.
IsItTen:=False;
writeln('It is '+inttostr(Count))//This just writes the random number.
if(IsItTen)then //If it is then... :D
Writeln('IT IS TEN! OMG!!! OMFG! IT CANT BE TEN!!!')
until(IsItTen)
end.
Hope this helps.![]()


Thanks understanding abit more and i now know why it says duplicate x and y cause i already included srl i have tryed evrythink lol and still get stuck -.- the furthes i got into a script was using colour spira and cutting 28 logs then dropping i think i atchely need the ultimate tut anyway im off l8erz
There are currently 1 users browsing this thread. (0 members and 1 guests)