Staredit Newtork
Community
StarCraft
Games
Site
Favourites
 
Javascript
Using Javascript

What is Javascript?

JavaScript is a scripting language most often used for client-side web development. It is a dynamic, weakly typed, prototype-based language with first-class functions. JavaScript was influenced by many languages and was designed to look like Java, but be easier for non-programmers to work with.

What does that mean?

Javascript is an easy to use coding language that is un-compiled and all that is required is notepad. Simply name any file with the extension .js and you are now able to run the file. With this and its ability to output a file with information in it, we can produce lines of code with only a few lines.

So, how easy is it?

Well, its so simple that you use it for everything -- from triggers to scripting.

First, open up Notepad and add this:

Code

var fso = new ActiveXObject("Scripting.FileSystemObject");
var outputFileName = fso.GetParentFolderName(WScript.ScriptFullName) + "\\" + fso.GetBaseName(WScript.ScriptFullName) + ".txt";
var outputStream = fso.CreateTextFile(outputFileName, true);



Now, we can output lines to a file. Let’s just make it output “HI!” 50 times:

Code

for(var I = 0; I<50; I++){
outputStream.WriteLine("HI!");
}


And we close the document like a good little boy:

Code

outputStream.Close();


And its just that simple! Now, for even better results, you can move onto this wiki:

http://www.staredit.net/wiki/Tips_for_Tedious_Coding


[06:31 pm]
MePHiStO_IS_GoD -- nicce wanna game on east?
[06:24 pm]
[DeVouReR]:] -- now
[06:15 pm]
MePHiStO_IS_GoD -- still there Dev?
[06:05 pm]
MePHiStO_IS_GoD -- er Afternoon
[06:04 pm]
MePHiStO_IS_GoD -- Good morning SEN
[05:56 pm]
madroc -- there are some things even i cannot fix, i am moving on now
[05:48 pm]
madroc -- I feel bad
You must log in to shout.

©2003-2008 Staredit Network.
Starcraft & Starcraft II are trademarks of Blizzard Entertainment.
Site Index   |   Terms of Service   |   Privacy Policy   |   Contributions