Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function NTMain()
- {
- Delay(1000);
- var filehandle = FileOpen("drumpProps.txt", 1);
- if(filehandle)
- {
- filehandle.WriteLine(dumpProps(this));
- filehandle.Close();
- }
- Print("ΓΏc2file created");
- Delay(200000);
- Say('Next Game!');
- Delay(200);
- ExitGame();
- }
- // credits to Thomas McDonald
- // modded by D2oD to indent objects and return the whole dump in a string.
- function dumpProps(obj, parent) {
- // Go through all the properties of the passed-in object
- var result = "";
- for (var i in obj) {
- // if a parent (2nd parameter) was passed in, then use that to
- // build the message. Message includes i (the object's property name)
- if(parent) { var msg = parent +"."+i+" => "+(typeof obj[i])+"\n"; } else { var msg = "\n"+i + " => " + (typeof obj[i])+"\n"; }
- result += msg;
- // then the object's property value
- if (typeof obj[i] == "object") {
- if(parent) { result += dumpProps(obj[i], parent +"."+i); } else { result += dumpProps(obj[i], " "); }
- }
- }
- return result;
- }
Add Comment
Please, Sign In to add comment