File object help [More Questions]

Author Topic: File object help [More Questions]  (Read 2745 times)

Thank you elm,

So another quick question,

How would I check to see if the scriptobject was ever saved in the first place?
Like for the first time a client connects I need it to load a default set of vars
You can use isFile("filepath"), setting filepath to where the client's save would be, and it will tell you if there's something to load.


You're still bad at naming local variables, elm, lol.

Thank you elm,

So another quick question,

How would I check to see if the scriptobject was ever saved in the first place?
Like for the first time a client connects I need it to load a default set of vars
If it was ever saved? if(isFile("config/server/MyAddon/MyDataHolder.cs")) or wherever you saved it to.

oops didnt see jetz above me

You're still bad at naming local variables, elm, lol.

Because

  • %this (namespace reference)
  • %path (path)
  • %f (file object)
  • %l (line)
  • %so (script object)
  • %nso (new script object)

is an example of bad variable name usage. In your statement you only brought up local variables? So I must have mastered the art of naming global variables, right? Lol.

is an example of bad variable name usage. In your statement you only brought up local variables? So I must have mastered the art of naming global variables, right? Lol.
They're pretty undescriptive to someone who doesn't script, but they're not terrible. Also, you didn't declare any global variables, and usually people use SINGIFICANTLY more descriptive global variable names than local variable names.

you didn't declare any global variables

You don't get it.

In your statement you only brought up local variables? So I must have mastered the art of naming global variables, right? Lol.
I never said you didn't suck with those, too.

Compressing your variables like that only makes your code harder to read.