Newbie Guide For SCAR CREATED BY Bebemycat2 Attention SCAR newbies: Before you start scripting, you should read this What is this going to cover? This tutorial will take you step by step through the process of learning how to create your very first script. I will explain every step to you and also throw in some useful scripting tips along the way. Tutorial: Ok to begin I will ask you to open up SCAR. Now all you should see is this: Code (Text): program New; begin end. Well I want you to space all of those out a bit like this: Code (Text): program New; begin end. This will give us some space to code in. This is just the basic elements. program New; This is your programs name, Change "New" to whatever name you want your program to be. Always add a semicolon ( ; ) after the name to tell the script that that is the end of your scripts name. begin Tells the compiler that the script has just began, the coding of your script goes between "begin" and "end." end. Tells the compiler that you have ended the script, Make sure to always put a full stop. If you are making a procedure/function then you end it with a semicolon ( ; ), that will be explained later in the tutorial. Next thing we are going to do is this: Code (Text): program script; procedure; begin end. You will notice that I have added something called a Procedure. Well a "procedure" is basically this: This procedure is where we will create the "body" or the majority of our script, from there is can be called upon later in the "main line" this I will explain more about later. You also have to have a name for your procedure, so lets name it "Hello" and add a semi-colon after it so it looks like this: Code (Text): program script; procedure; begin end. You name the procedure so that you can "call" upon it later in the script. You can name it anything but I am going to use "Hello" for this script. Now what we are going to do now is add somthing called a "const" or a constant. This means that this "setting" will stay the same throughout the entire script. To make a const you simply need to do this with your script: Code (Text): program script; const procedure hello; begin end. Now we have to make something a const, so let make it this: Code (Text): program script; const Message1='Hello world!'; procedure hello; begin end. Now you will notice that I have "Message1=" this is because with SCAR you have to always tell it what the "Message1" equals, that's the reason for the "=". Now for the ' ' marks. These are what SCAR uses to identify when a String begins and when it ends. A string is a word / phrase. You will notice that it has a pinkish color to it, that is the "Syntax highlighting" that SCAR creates so that scripting can be much simpler. Now that we have a "const" we need it to do something. You can find a basic list of procedures and functions in your SCAR folder called "procedureparams". It should look somthing like this: Code (Text): procedure Writeln(s: string);export; procedure Status(s: string); function GetStatus: string; function Readln(question: string): string; function GetChatMsg: string; function GetLastChatMsg: string; ...... ...... and so on. Now scroll down the list until you come to a procedure called: Code (Text): Writeln(s: string); Now as I explained before a procedure is: This procedure: Code (Text): procedure Writeln(s: string); just means that the "S" is a string, so therefore that is where we would enter what we wanted to type. So I want you to make your Script look like this now: Code (Text): program script; const Message1='Hello world!'; procedure hello; begin Writeln(); End. You will notice that I have "Writeln();" after the begin, that is because you have to begin the script before you can do anything. Also "Writeln" is a typing "command", it tells SCAR to type the keys that you specify. The Text will show up in shomthing called the "Debug" box that is this area of SCAR: Now we will do this: Code (Text): program script; const Message1='Hello world!'; procedure hello; begin Writeln(Message1); End. Now normally we would have to use the ' ' identifiers around "Message1" but in this case, since it is already in the "const" there is no need to and this will tell SCAR to type what you have filled out in the "const" "Message1". Now we have to tell SCAR that we want to end the current procedure for this we will add "end;" like so: Code (Text): program script; const Message1='Hello world!'; procedure hello; begin Writeln(Message1); end; end. This is simply to tell SCAR to end the procedure, you will do the same with a function. "End;" is different from "end." because "end." tells SCAR to end the whole script while "end;" tells it that you are done with a procedure/function. Now we have to make SCAR actually type our "message" and use our procedure that we have just created. to do this we have to create the "main line" I mentioned before. This is done much like a procedure but has a few differences that I will explain. So to start off your "main line" you will need to have a "begin" like so: Code (Text): program script; const Message1='Hello world!'; procedure hello; begin Writeln(Message1); end; begin end. You will notice the begin is there, this is just telling SCAR this is where your main line shall begin. Simple, no? So now we are going to make SCAR repeat something. The command to make SCAR repeat is "repeat". This will go after the being in the "main line". So you should now have code that looks like this: Code (Text): program script; const Message1='Hello world!'; procedure Hello; begin Writeln(Message1); end; begin repeat end. This basically telling SCAR to begin the "main line" and repeat something. Now we have to tell it what it needs to repeat. For this we will take our procedures name (Hello) and add it under our repeat command. So it should look like this: Code (Text): program script; const Message1='Hello world!'; procedure Hello; begin Writeln(Message1); end; begin repeat hello; end. This will tell SCAR to repeat our "Hello procedure". But we have to tell it how long it has to repeat it for, so we will need the command "until". like so: Code (Text): program script; const Message1='Hello world!'; procedure Hello; begin Writeln(Message1); end; begin repeat hello; until(false) end. Now you will notice that I have "until(false)" when I only told you to add "until". Well until needs some sort of "time marker" to tell it when to repeat until, and "(false)" tells it to repeat forever, this will make it an infinite "loop". With "until(false)" this script will repeat our procedure "Hello" forever, never stopping until the user stop SCAR manually. Now hit: "script" -----> "Compile" and you should get this message in the "debug" box that says "Successfully compiled" this means that you coded the script right. Now to test it. With your "crosshair"() select your debug box and hit "run script". You will notice that it keeps typing it over and over really fast. So now we need to slow it down a bit. for this we will use a procedure called "wait". Wait tells the script to wait a designated amount of miliseconds before it's next action. To add wait what we do is this: Code (Text): program script; const Message1='Hello world!'; procedure Hello; begin wait(1000) Writeln(Message1); end; begin repeat hello; until(false) end. You will notice the "1000)" this is the amount of milliseconds you want to wait, now if you paid attention in math(s) (Depending on if your American or not you call it math or maths) you will know that 1000 milliseconds is 1 second. So we are basically saying that when SCAR reads the "main line" and does our procedure "Hello" that it should wait 1 second before it repeats. Simple, no? Now run it. You will see that it types at a much more controlled rate now. CONGRATULATIONS! You have just made your very first script! CREDIT'S FOR THIS GUIDE GO TO: Deathader Bebemycat (different forum, he tought me SCAR) Kaitnieks (creating SCAR) The people that keep SCAR running +rep would be AWESOME Note: I stole some of the code form a different site
Design tips: When you want to leave notes to the user of your script like this: Code (Text): program script; const Message1='Hello world!'; procedure Hello; begin wait(1000) Writeln(Message1); // this says hello end; begin repeat hello; until(false) end. Now you will notice that I used "//". This tells SCAR not to include what comes after the "//" in the script. Now if you don't feel like using "//" every time you want to comment on something, then you can use " { " and " } ". examples of both. with //: Code (Text): program script; const Message1='Hello world!'; procedure Hello; begin wait(1000) Writeln(Message1); // this says hello wolrd! end; begin repeat hello; until(false) end. with { and }: Code (Text): { This a script in scar that will say Hello world! } program script; const Message1='Hello world!'; procedure Hello; begin wait(1000) Writeln(Message1); { this says hello} end; begin repeat hello; until(false) end. You will notice that with { and } that you can do multiple lines where as with // you can not with out constantly typing "//" over and over. Thanks for reading this guide!
this looks a really good guide +rep EDIT: iwould but i cannot as i have already given you +rep for something else btw this is a really annoying feature and i think it should be removed
Thanks. that should help people notice it, so our SCAR store can grow i know.. I wish they would remove that.
thanks i have done your tutorial and know the very basics but don't know how you relate this to neopets games it would be great if you could give us an example of how to make a script for a neopets game (preferably the simplist one) as that would help us understand how to do other games as well well thanks again and hope you do what i have suggested above EDIT: just gave you +rep as i was able too
You even sure that he can take that idea? I mean... He did not even create this guide... Notice how your suggest has not been answered while he goes online everyday and stays online like all day. Dont take this the wrong way, I am not saying he cannot script ( I know he can probably script...) I am saying that it is not yours because you did not create it. Atleast give credits to work that is not yours. This can be considered plagiarism. Instead, I see no credits, no name of original creator. This guide is created by Bebemycat2 at (Website not saying as it is against the rules). Please edit this so called your guide and place the credits that deserve to be there. My 2 cents.
I personally think u are out against him just because he have done something wrong. Cant u give it a rest? Neofriend is a friendly community, I am sure everyone wants and try to forgive and forget. If u bear a grudge about him u would onli cause many unhappiness and i am sure this is not wanted in this community am i right? So move on don't stop here Fogive and Forget.
this was posted on the day deathader got banned and it was THAT post that got him banned so really that post couldn't have been given a rest
i think this is a good duide and i seem to understand it however i was hoping that in a NEWBIE guide for this program they would explain how i would get this program. I am extremely new when it comes to dealing with programs and am trying to get a good understanding of it however i beleive that i first need this SCAR thing everyone speaks of and have no idea where to find it. Could someone help me out.?
sorry for the double post, someone just sent me alink to the program, thanks anyway. To smellyman: thanx i hadnt noticed the edit button
Thats where the handy "edit" button at the top right hand corner of the post comes into play. Use it.
I'm getting this error message when I'm compiling (obviously) Failed when compiling Line 8: [Error] (8:1): Unknown identifier 'WriteIn' in script I have it typed exactly as in the example.
it will probably be something else wrong with your script if you post it here or pm me it i could debug it for you