◢███◤      ◢██◤                            ◢██◤                            
     ◢██◤       ◢██◤                            ◢██◤                             
    ◢██◤       ◢██◤                            ◢██◤                              
   ◢██◤       ◢██◤                            ◢██◤                               
  ◢██◤       ◢██◤                            ◢██◤                                
◢███◤       ◢██◤                            ◢██◤                          ◥██◣   
◥███       ◢█████◣    ◢████████◤ ◢███████◤ ◢██◤ ◢██◤                 ◢██◤   ██◣  
 ███      ◢███████◣        ◢██◤ ◢██◤ ◢██◤ ◢███████◤                 ◢██◤    ███  
 ███     ◢██◤  ◢██◤ ◢████████◤ ◢██◤      ◢█████◣                   ◢██◤     ███  
 ███    ◢██◤  ◢██◤ ◢██◤  ███◤ ◢██◤ ◢██◤ ◢██◤◥███◣                 ◢██◤      ███  
 ◥██   ◢██◤  ◢██◤ ◢████████◤ ◢███████◤ ◢██◤  ◥███◣               ◢██◤       ███◣ 
  ◥██◣                                                          ◢██◤       ◢███◤ 
                                 ◢███◤ ◢███◤ ◢██◤  ◢██◤ ◢█████████◤       ◢██◤   
                                ◢█████████◤ ◢██◤  ◢██◤ ◢██◤  ████◤       ◢██◤    
                               ◢██◤◢█◤◢██◤ ◢██◤  ◢██◤ ◢██◤   ███◤       ◢██◤     
                              ◢██◤   ◢██◤ ◢████████◤ ◢█████████◤       ◢██◤      
                             ◢██◤   ◢██◤ ◢████████◤ ◢█████████◤      ◢███◤       

0003
[Request] scripts.get_user_data
a0dzfd
It would sometimes be nice to have a small amount of script-accessible metadata about a script in addition to the game provided stuff (access level, sec level). For example, a git commit, a hash, a last updated date, or even a small amount of documentation. My idea is as follows: add a new "argument" to `C#up` (in addition to public, private, shift, etc). If the `C#up` command contains "`Adata:`", anything after that is taken to be user data; trim leading/trailing whitespace, truncate to 100 characters, and save it alongside the script. Then, `Fscripts``A.``Lget_user_data``A{``Nname`:`V"whatever.script"``A}` would return the stored data (or the empty string if none has been saved). if a "`Adata:`" argument is not included in a `C#up`, it should be left unchanged (rather than cleared). For example: `C#up` `Afoo public shift data:test` This uploads the script as public, shifting if needed, with user data set to "test" `C#up` `Afoo data:public shift test` This uploads the script without changing it's public/private state, with user data set to "public shift test" -- that is, keywords after data: are not considered for changing script state `C#up` `Afoo asdfpublicasdfshiftasdfdata:test` To maintain compat with the current rather generous "parsing", this would behave the same as the first example, since "public" and "shift" are both included in the text before "data:". (I'm not thrilled with the CLI parser handling stuff like this, but I'm trying to suggest minimal changes and that means retaining current oddities; if the CLI parser changes this absolutely should change with it) By making this a user-set piece of data rather than automatically generated, there is no way to use it to guarantee someone hasn't (or has) edited their script. For example, if I make it a habit to post sha hashes of my source and people figure that out, they can't use a unchanging (or changing!) hash to imply anything -- even if it is my custom, i could upload new code without a change in user data, or upload new user data without a change in code. So there is still risk, but this lets us make use of a small amount of data in our own internal systems as we see fit. My specific use-case: to prevent my scripts from "decaying" to gray sectors, i re-upload all of them every 45ish days. This process takes a little over 5 hours currently and is incredibly tedious, so i have a very simple AHK-like bot that does all the typing for me. The problem is, there's no good way to tell if all the #ups work, and if a parse error or just weird network blips eat one of them, a script decays. I would use this to add a timestamp to each #up, which i can later verify in-game and re-up any that got skipped. I could see other people putting git commit hashes (to verify what state the code is in), or using it for super basic documentation or links to a github repo or what have you.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -