ScriptUO

Official ScriptUO EasyUO Scripts => Script Library => Script development tools => Topic started by: TrailMyx on March 22, 2010, 05:22:48 PM

Title: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 22, 2010, 05:22:48 PM
So sometimes I like to have a quick way to save things, but I don't want to completely blowup my registry.  So I'm coming up with some subs that compress all variables into a single registry entry.  CEO does something similar to this, but I'm going to have a bunch of support routines that'll allow you to copy between scripts, characters and dump to a file to move between computers.  It's going to be kinda interesting.

I'm also coming up with a manager so you can modify EVERYTHING that the filesystem manages.  That's why I needed the tab subs so I can automate this interface and make it look pretty.

Code: [Select]
gosub TM_InitializeAdvFS test_script

;gosub TM_LoadVariables
;stop
set !test 25
set !this 35
set !variable 45
set %newvar another_value
gosub TM_RegisterVariable local std test ; local:std namespace  
gosub TM_RegisterVariable local std this ; local:std namespace
gosub TM_RegisterVariable local std variable  ; local:std namespace
gosub TM_RegisterVariable std std newvar  ; denotes a %var
gosub TM_SaveVariables
stop

;--------------------------------------------------------------------
;--------------------------------------------------------------------
;--------------------------------------------------------------------
set !TM_FunctionCalled #FALSE
if %0 = 1 && !TM_FunctionCalled = #FALSE
  gosub %1
if %0 = 2 && !TM_FunctionCalled = #FALSE
  gosub %1 %2
if %0 = 3 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3
if %0 = 4 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4
if %0 = 5 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5
if %0 = 6 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5 %6
if %0 = 7 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5 %6 %7
if %0 = 8 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5 %6 %7 %8
if %0 = 9 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9
if %0 = 10 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10
if %0 = 11 && !TM_FunctionCalled = #FALSE
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11
if %0 > 11
{
  display ok Too many arguments for "call", edit the call header.
  stop
}

; exit  ; include this line if you don't want to run the error checking.  NOT RECOMMENDED!  Add "set !TM_FunctionCalled #TRUE" to the end of your subs for full error-checking!
 
if !TM_FunctionCalled = #TRUE ; successfully called function.
  exit
if %0 = N/A
  display ok You may not run this script directly.
else
  display ok Function " , %1 , " not found.
stop

;--------------------------------------------------------------------
;--------------------------------------------------------------------
;--------------------------------------------------------------------
sub TM_InitializeAdvFS
  namespace push
  namespace local TM_AdvFS
  set !lpc #LPC
  set #LPC 10000
  namespace clear
  if %0 = 0
  {
    display ok You must name your script, spaces will be converted to underscores.
    stop
  }
  set !script_name %1
  gosub AddUnderscore !script_name
  set !script_name #RESULT
  gosub AddUnderscore #SHARD
  set !slot #CHARID , _ , #RESULT , _ , !script_name , _vars
  set ! . !slot
  set !varcnt 0
  set !index 0
  set !script_index N/A
  while *TM_FS . !index <> N/A
  {
    if *TM_FS . !index = !slot
    {
      set !script_index !index
      break
    }
    set !index !index + 1
  }
  if !script_index = N/A
  {
    set !script_index !index
    set *TM_FS . !script_index !slot
  }
  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub TM_RegisterVariable
  namespace push
  namespace local TM_AdvFS
  if !slot = N/A
  {
    display ok You must name your script and also run TM_InitializeAdvFS first.
    stop
  }
  set !nstype %1
  set !nsname %2
  set !var %3
  if !nstype ,  , !nsname ,  , !var notin ! . !slot
  {
    set !newval ! . !slot
    set ! . !slot !newval , !nstype ,  , !nsname ,  , !var , 
    set !varcnt !varcnt + 1
  }
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub TM_SaveVariables
  namespace push
  namespace local TM_AdvFS
  set !lpc #LPC
  set #LPC 10000
  set !outstring
  set !start 1
  set !sepcnt 1
  for !i 1 !varcnt
  {
    gosub ReadItem ! . !slot
    set !nstype #RESULT
    gosub ReadItem ! . !slot
    set !nsname #RESULT
    gosub ReadItem ! . !slot
    set !var #RESULT
    if std in !nstype
    {
      set !val % . !var
    }
    else
    {
      namespace copy !var from !nstype !nsname
      set !val ! . !var
    }
    set !outstring !outstring , !nstype ,  , !nsname ,  , !var ,  , !val , 
  }
  set * . !slot !outstring
  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub TM_LoadVariables
  namespace push
  namespace local TM_AdvFS
  set !lpc #LPC
  set #LPC 10000
  set !start 1
  set !sepcnt 1
  set !string * . !slot
  set !continue #TRUE
  while !continue = #TRUE
  {
    gosub ReadItem !string
    if #RESULT <> #TRUE
    {
      set !nstype #RESULT
      gosub ReadItem !string
      set !nsname #RESULT
      gosub ReadItem !string
      set !var #RESULT
      gosub ReadItem !string
      set !val #RESULT
      if std in !nstype
      {
        set % . !var !val
      }
      else
      {
        set ! . !var !val
        namespace copy !var to !nstype !nsname
      }
    }
  }
  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub ReadItem
  str pos %1  !sepcnt
  if #STRRES <> 0
  {
    set !len #STRRES - !start
    str mid %1 !start !len
    set !start !start + !len + 1
    set !sepcnt !sepcnt + 1
    return #STRRES
  }
return #TRUE
;--------------------------------------------------------------------
; %1 - string to mung
sub AddUnderscore
  namespace push
  namespace local AU
  set !tempstring %1
  AddUnderscore_loop1:
    str pos !tempstring #SPC
    if #STRRES <> 0
    {
      set !val #STRRES - 1
      str left !tempstring !val
      set !left #STRRES
      set !val !val + 1
      str del !tempstring 1 !val
      set !tempstring !left , _ , #STRRES
      goto AddUnderscore_loop1
    }
  set #RESULT !tempstring
  namespace pop
return #RESULT
;--------------------------------------------------------------------
Title: Re: My new filesystem - first look
Post by: Endless Night on March 22, 2010, 06:09:58 PM
Interesting .. ill have to keep my eye on this thread.
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 22, 2010, 06:13:54 PM
This will be nice because you can manage ALL your namespace variables.  Also will be nice to visually surf through all the variables that are tracked by the filesystem, including all characters and all shards.  You can even transfer variables specific to scripts from one char to another.  Should be interesting.  Once you register a variable/namespace, then the filesystem will track it for you while keeping your registry from completely blowing up.  ;)
Title: Re: My new filesystem - first look
Post by: Scrripty on March 22, 2010, 06:30:53 PM
oooooooooooo
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 22, 2010, 06:43:58 PM
heh.  Right now it's pretty usable I think. I haven't actually written a script that uses it yet, but I plan on working on the file system browser this weekend.
Title: Re: My new filesystem - first look
Post by: Scrripty on March 22, 2010, 07:32:15 PM
heh.  Right now it's pretty usable I think. I haven't actually written a script that uses it yet, but I plan on working on the file system browser this weekend.

Please tell me it's drag and drop with the other one... heh
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 22, 2010, 07:33:14 PM
heh.  Right now it's pretty usable I think. I haven't actually written a script that uses it yet, but I plan on working on the file system browser this weekend.

Please tell me it's drag and drop with the other one... heh


Actually, it'll be 1:1 compatible.  ;)  You'll have to wrap it, but it's gonna be easy.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on March 23, 2010, 02:34:02 AM
Sweet, FINALLY!!!! ;) hehe.

Perfect timing too!

Looking forward to this one (if you couldn't tell already lol).

X
Title: Re: My new filesystem - first look
Post by: Scrripty on March 23, 2010, 08:05:32 AM
And the heavens did open up and shine on TM filesystem 2, and god saw that it was good. :)
Title: Re: My new filesystem - first look
Post by: 12TimesOver on March 23, 2010, 08:29:17 AM
And the heavens did open up and shine on TM filesystem 2, and god saw that it was good. :)

Hehehe....that got me down in the cockles - no, deeper, down into the sub-cockles.
Title: Re: My new filesystem - first look
Post by: Scrripty on March 23, 2010, 08:33:09 AM
And the heavens did open up and shine on TM filesystem 2, and god saw that it was good. :)

Hehehe....that got me down in the cockles - no, deeper, down into the sub-cockles.

I've been waiting for this too because I think it will fix 99 percent of the problems I've been having. ;)
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 23, 2010, 08:36:20 AM

I've been waiting for this too because I think it will fix 99 percent of the problems I've been having. ;)

Ya, I think it would too.  By having to rely on sending information to the DOS command line, you really do run the risk of corrupting your full save data unless you embed special characters.

...no, deeper, down into the sub-cockles.

Don't play with your sub-cockles, you'll go blind!
Title: Re: My new filesystem - first look
Post by: 12TimesOver on March 23, 2010, 08:40:34 AM
...no, deeper, down into the sub-cockles.

Don't play with your sub-cockles, you'll go blind!
Hehe...hehehe...


XII "Hairy Palms" xOveR
Title: Re: My new filesystem - first look
Post by: UOMaddog on March 24, 2010, 01:38:38 AM
Would it be possible to implement some of this filesystem (viewing and editing namespace for example) stuff in SUO?? Just a thought!
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 24, 2010, 05:11:19 AM
You can kinda do that already.  A little known feature is after you do a syntax check, you can go to the VAR tab and surf through all the namespaces and variables encountered.  It's not perfect because the memory manager isn't quite done yet, but you do get a good view of used variables.
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 25, 2010, 09:00:44 AM
Oh, and another answer to your question is that since this information can be pulled from the registry, it would be very easy to implement a windows program to view and modify this information.  It's just more straight-forward to write a script for those used to just running scripts and not relying on another program.
Title: Re: My new filesystem - first look
Post by: Scrripty on March 25, 2010, 09:02:24 AM
!!! Do we need to ask for a release date? heh  You're not ID software, "when it's done" is not an acceptable answer. :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 25, 2010, 09:11:16 AM
Probably this weekend.  I have the subs working pretty well now.  They're a bit different now.  i.e. you can add more than one variable to the monitored list:

Code: [Select]
gosub TM_RegisterVariables local std test this variable ; local:std namespace

-or-

Code: [Select]
gosub TM_RegisterVariables local std test
gosub TM_RegisterVariables local std this
gosub TM_RegisterVariables local std variable

Careful or else I'll give you a "Duke Nukem" release date.  ;)
Title: Re: My new filesystem - first look
Post by: 12TimesOver on March 25, 2010, 09:47:46 AM
Careful or else I'll give you a "Duke Nukem" release date.  ;)
You mean "Duke Forever"?!?!?!? NOOOOOOOO!!!!!

You know what's funny TM, I was just taking stock of the subs in XIIxOveR's Miner and between your travel subs, gump and click subs, casting subs, and now soon to add these "filesystem" subs it's basically mostly your work LOL! Although, to my credit, I did replace your Click and Gumpwait subs with my own but still...

I love plug-n-play hehe.

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 25, 2010, 10:03:07 AM
I've always been a big fan of utilities and generic code.  I'm glad people have found some use for it all.  ;)
Title: Re: My new filesystem - first look
Post by: Scrripty on March 25, 2010, 10:09:25 AM
I've always been a big fan of utilities and generic code.  I'm glad people have found some use for it all.  ;)

I love everything you write, but I still hate the journal scanner.  When I try to use it I always mess it up. :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 25, 2010, 10:15:53 AM
The journal stuff can be annoying for sure because you have to be consciously aware of EVERY possible logical interaction.  So debugging your purposed code can be a pain.  However, once you master it, it's bulletproof.  I'm just glad I haven't had to touch journal code in a long time.  I remember my first few scripts where I handled every journal query by hand.  THAT SUCKED!!  I totally loathed journal scanning, but now it's easy peasy.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on March 25, 2010, 10:52:31 AM
The journal stuff can be annoying for sure because you have to be consciously aware of EVERY possible logical interaction.  So debugging your purposed code can be a pain.  However, once you master it, it's bulletproof.  I'm just glad I haven't had to touch journal code in a long time.  I remember my first few scripts where I handled every journal query by hand.  THAT SUCKED!!  I totally loathed journal scanning, but now it's easy peasy.
Ah right, forgot to add the Journal Scan subs to that list above I'm using in the miner. ROFL!

Dang...

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 25, 2010, 07:07:12 PM
These keep morphing!  I had a bunch of really cool ideas today when I was completely bored in a meeting today.  ;)
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 27, 2010, 04:45:35 PM
It's coming along nicely.  I have written a file system browser that lets you see everything that's being tracked in the file system.  I've dubbed this "Next Generation File System" or NGFS.

Attached is a picture of the browser.

Right now the memory is organized into two different possible ways to save.  One is organized by #CHARID, shard and script tag.  Another one is just organized by script tag.  This way you get a way to transfer "generic information" from script to script, and also allow for data to be saved for a specific character on a specific shard.

Also, I'm partitioning the file system helper functions into user levels.  So:

tm_NGFS_base = minimal base functions to allow a script to load/save from the file system
tm_NGFS_advanced = functions to allow for file system maintenance and advanced scripting

Perhaps another level for things like formatting the file system.

Here's a snapshot of the current functions (there's some test code at the end of the snippet)
Code: [Select]
sub TM_NGFS_InitializeScript
  namespace push
  namespace local TM_NGFS
  namespace clear
  set !lpc #LPC
  set #LPC 10000
  if %0 = 0
  {
    display ok You must name your script, spaces will be converted to underscores.
    stop
  }
  set !TM_FSSIZE 1000 ; do not change this!!
  set !script_name %1
  set !args %0
  gosub AddUnderscore !script_name
  set !script_name #RESULT
  if !args = 1
  {
    gosub AddUnderscore #SHARD
    set !slot #CHARID , _ , #RESULT , _ , !script_name , _vars
  }
  else
  {
    set !slot generic , _ , !script_name , _vars
  }
  set ! . !slot
  set !varcnt 0
  set !index 0
  set !script_index N/A
  while *TM_FS . !index <> N/A
  {
    if *TM_FS . !index = !slot
    {
      set !script_index !index
      break
    }
    set !index !index + 1
  }
  if !script_index = N/A
  {
    set !script_index !index
    set *TM_FS . !script_index !slot
  }
  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub TM_NGFS_RegisterVariables
  if %0 <= 2
  {
    display ok Not enough arguments
    stop
  }
  namespace push
  namespace local TM_NGFS
  if !slot = N/A
  {
    display ok You must name your script and also run TM_NGFS_InitializeScript first.
    stop
  }
  set !nstype %1
  set !nsname %2
  for !i 3 %0
  {
    set !var % . !i
    if !nstype ,  , !nsname ,  , !var notin ! . !slot
    {
      set !newval ! . !slot
      set ! . !slot !newval , !nstype ,  , !nsname ,  , !var , 
      set !varcnt !varcnt + 1
    }
  }
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub TM_NGFS_SaveVariables
  namespace push
  namespace local TM_NGFS
  set !lpc #LPC
  set #LPC 10000
  set !outstring
  set !start 1
  set !sepcnt 1
  set !line_count 0
  set !temp_str ! . !slot

  for !i 1 !varcnt
  {
    gosub ReadItem ! . !slot
    set !nstype #RESULT
    gosub ReadItem ! . !slot
    set !nsname #RESULT
    gosub ReadItem ! . !slot
    set !var #RESULT
    if std in !nstype
    {
      set !val % . !var
    }
    else
    {
      namespace copy !var from !nstype !nsname
      set !val ! . !var
    }
    set !outstring !outstring , !nstype ,  , !nsname ,  , !var ,  , !val , 
    str len !outstring
    if #STRRES >= !TM_FSSIZE
    {
      set * . !slot , !line_count !outstring
      set !outstring
      set !line_count !line_count + 1
      set !start !start - 1
      str del ! . !slot 1 !start
      set ! . !slot #STRRES
      set !start 1
      set !sepcnt 1
    }
  }
  str len !outstring
  if #STRRES > 0
  {
    set * . !slot , !line_count !outstring
    set !line_count !line_count + 1
  }
  set * . !slot , !line_count N/A ; make sure there's nothing left at end of the list
  set #LPC !lpc
  set ! . !slot !temp_str
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub TM_NGFS_LoadVariables
  namespace push
  namespace local TM_NGFS
  set !lpc #LPC
  set #LPC 10000
  set !start 1
  set !sepcnt 1
  set !line_count 0
  set !temp !slot , !line_count
  set !string * . !temp
  set ! . !slot
  set !varcnt 0
  set !continue #TRUE
  while !continue = #TRUE
  {
    gosub ReadItem !string
    if !continue = #TRUE
    {
      set !nstype #RESULT
      gosub ReadItem !string
      set !nsname #RESULT
      gosub ReadItem !string
      set !var #RESULT
      gosub ReadItem !string
      set !val #RESULT
      if std in !nstype
      {
        set % . !var !val
      }
      else
      {
        set ! . !var !val
        namespace copy !var to !nstype !nsname
      }
      set !newval ! . !slot
      set ! . !slot !newval , !nstype ,  , !nsname ,  , !var , 
      set !varcnt !varcnt + 1
    }
    if !continue = #FALSE
    {
      set !line_count !line_count + 1
      set !temp !slot , !line_count
      set !string * . !temp
      set !start 1
      set !sepcnt 1
      if !string <> N/A
        set !continue #TRUE ; still more to process
    }
  }
  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return
;--------------------------------------------------------------------
sub ReadItem
  str pos %1  !sepcnt
  if #STRRES <> 0
  {
    set !len #STRRES - !start
    str mid %1 !start !len
    set !start !start + !len + 1
    set !sepcnt !sepcnt + 1
    return #STRRES
  }
  set !continue #FALSE
return #TRUE
;--------------------------------------------------------------------
; %1 - string to mung
sub AddUnderscore
  namespace push
  namespace local AU
  set !tempstring %1
  AddUnderscore_loop1:
    str pos !tempstring #SPC
    if #STRRES <> 0
    {
      set !val #STRRES - 1
      str left !tempstring !val
      set !left #STRRES
      set !val !val + 1
      str del !tempstring 1 !val
      set !tempstring !left , _ , #STRRES
      goto AddUnderscore_loop1
    }
  set #RESULT !tempstring
  namespace pop
return #RESULT

; Test code-------------------------------------------------------------------------

gosub TM_NGFS_InitializeScript test_script

gosub TM_NGFS_LoadVariables
stop

for !i 0 100
{
  set !test . !i !i
  gosub TM_NGFS_RegisterVariables local std test . !i
}
gosub TM_NGFS_SaveVariables
stop
;--------------------------------------------------------------------
set !test 25
set !this 35
set !variable 45
set %newvar another_value
;gosub TM_NGFS_RegisterVariables local std test this variable ; local:std namespace
gosub TM_NGFS_RegisterVariables local std test ; from local:std !test
gosub TM_NGFS_RegisterVariables local std this ; from local:std !this
gosub TM_NGFS_RegisterVariables local std variable ; from local:std !variable
gosub TM_NGFS_RegisterVariables std std newvar  ; denotes a %var
gosub TM_NGFS_SaveVariables
stop

gosub TM_NGFS_InitializeScript new_script2 generic ; make a generic copy

for !i 0 100
{
  set !test . !i !i
  gosub TM_NGFS_RegisterVariables local std test . !i
}
gosub TM_NGFS_SaveVariables

gosub TM_NGFS_InitializeScript new_script22
for !i 0 100
{
  set !test . !i !i
  gosub TM_NGFS_RegisterVariables local std test . !i
}
gosub TM_NGFS_SaveVariables
stop
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 29, 2010, 11:28:07 AM
Need to know if a data set exists?

Code: [Select]
gosub TM_NGFS_DoesSaveExist new_script2
if #RESULT = #TRUE
  display ok new_script2 save exists
gosub TM_NGFS_DoesSaveExist new_script2 generic
if #RESULT = #TRUE
  display ok new_script2 generic save exists

General example of using this file system for saving variables.  Note duplicates will NOT be registered again.

Code: [Select]
gosub TM_NGFS_InitializeScript new_script ; since "generic" is not included, this save data set will be specific to the character/shard
set !test 25
set !this 35
set !variable 45
set %newvar another_value
; Note you can include multiple variables on a single line assuming they are the same namespace
gosub TM_NGFS_RegisterVariables local std test this variable ; local:std namespace
; Or you can just save them individually
gosub TM_NGFS_RegisterVariables local std test ; from local:std !test
gosub TM_NGFS_RegisterVariables local std this ; from local:std !this
gosub TM_NGFS_RegisterVariables local std variable ; from local:std !variable
gosub TM_NGFS_RegisterVariables std std newvar  ; denotes a %var
gosub TM_NGFS_SaveVariables

Storing an array of information generically.  Any script calling for "new_script2" will attempt to load this information

Code: [Select]
gosub TM_NGFS_InitializeScript new_script2 generic ; make a generic copy
for !i 0 100
{
  set !test . !i !i
  gosub TM_NGFS_RegisterVariables local std test . !i
}
gosub TM_NGFS_SaveVariables

Notice all you have to do in order to load a variable set, you just have to initialize/load.  Since in order to "register" a variable, you need to include the namespace type and namespace name, all data in all namespaces will be restored.  With this filesystem, you can actually "freeze" your data used in memory when you save.

Code: [Select]
gosub TM_NGFS_InitializeScript test_script
gosub TM_NGFS_LoadVariables ; loads all variables registered and associated with "test_script"
Title: Re: My new filesystem - first look
Post by: Scrripty on March 29, 2010, 12:05:48 PM
*giggle* I'm all giddy. 
Title: Re: My new filesystem - first look
Post by: TrailMyx on March 30, 2010, 09:35:37 AM
So I'm going to make one more little tweak to the base functions.  Right now you are kinda hardwired to having one file system set open per script at a time.  One quick tweak to the call/gosub can allow for you to open multiple sets, like one for script specific and one for a generic set.  Also would allow for copying from one set to another because they'll all be in memory instead of having to ping-pong back and forth between loaded sets.  Also, this will clean up the implementation a bit.

I've tested the speed of this and it's remarkably fast for something implemented in EasyUO.  Where it really shines is when you save.  Instead of having to go out to the DOS prompt for a few saves, it's nearly automatic.

So my next posting of the base functions should be good enough for anyone to play with because I won't be changing them after that point.  I'll be adding to the advanced functions so you can get information like the size of a saved set, formatting of a filesystem, copying, deleting or saving to a file for export.
Title: Re: My new filesystem - first look
Post by: Scrripty on April 19, 2010, 07:40:01 PM
WE WANT FILESYTEM 2 WE WANT FILESYSTEM 2. :)  Just sayin....
Title: Re: My new filesystem - first look
Post by: TrailMyx on April 19, 2010, 07:44:20 PM
Sorry dood.  Gonna be a little bit.  Powering down R/L stuff to start up with the new R/L stuff.  So busy tizzy at the moment.
Title: Re: My new filesystem - first look
Post by: Scrripty on April 20, 2010, 06:50:53 PM
I hate those real life priorities.  Want them pkd? :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on April 20, 2010, 07:52:33 PM
I hate those real life priorities.  Want them pkd? :)

Lol, well these are pretty good really.  New job that I'm kinda looking forward to.  Plus I have a bit of scripting apathy at the moment due to the EUO upheaval.  I may have to dust off the Lua mods I made to ScriptUO.  sheesh.
Title: Re: My new filesystem - first look
Post by: TrailMyx on April 21, 2010, 10:59:02 AM
If you want to begin playing with this, I'm gonna attach the subs (tm_ngfs1.txt) and the viewer (tm_ngfs_viewer3.txt).  There are 5 examples  located in the "TestScript" sub.  To test each example, just change the argument sent to %1.

Title: Re: My new filesystem - first look
Post by: Scrripty on May 17, 2010, 01:22:10 PM
So I'm going to dig into this.  I just browsed it and my brain went "huh?".  Any help using these subs would be great TM. :)  I'm going to use it to add Cerv's saving of waypoint vars.  Or try anyways.
Title: Re: My new filesystem - first look
Post by: TrailMyx on May 17, 2010, 01:33:40 PM
There's already quite a bit of test code in there for you to look at.  5 separate examples; look at the last sub in the file.

I'm probably not going to finish this project.  I'm gearing up to transition to OEUO, and I need those brain cells I've reserved for EUO.  ;)

Anyhow, Examples:

#1: Check to see if a save information exists for "new_script2"

#2: Saves !test0 .. !test100 in set named "new_script"

#3: Saves variable !test, !this, and !variable into set named "new_script"

#4: Saves Saves !test0 .. !test100 in set named "new_script2" and "new_script22"

#5: Loads information saved in "new_script"
Title: Re: My new filesystem - first look
Post by: Scrripty on May 18, 2010, 03:51:40 PM
Gettin excited for a new toy now aren't ya? :)  CONVERT!
Title: Re: My new filesystem - first look
Post by: TrailMyx on May 18, 2010, 07:03:13 PM
Gettin excited for a new toy now aren't ya? :)  CONVERT!

Umm, not really.  I guess I'm just a bit tired of using a tool that hasn't been actively supported for so long.  I appreciate all the work that Cheffe has put into his project, so I'll grudgingly convert in time.  I fear it's going to be a glacial conversion, however.   I just have no time to learn language number 21. 
Title: Re: My new filesystem - first look
Post by: Scrripty on May 18, 2010, 07:10:46 PM
Gettin excited for a new toy now aren't ya? :)  CONVERT!

Umm, not really.  I guess I'm just a bit tired of using a tool that hasn't been actively supported for so long.  I appreciate all the work that Cheffe has put into his project, so I'll grudgingly convert in time.  I fear it's going to be a glacial conversion, however.   I just have no time to learn language number 21. 

Well, if EA doesn't screw it all up by being idiots, you will still be able to use the old language as well. :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on May 18, 2010, 07:18:44 PM

Well, if EA doesn't screw it all up by being idiots, you will still be able to use the old language as well. :)


Well, EA is gonna get into a deadly dance with people like Cheffe.  I can just about guarantee you that Cheffe has more talent that ANYONE over there at EA/OSI.  So if they REALLY want to screw with Cheffes new baby, then they should prepare for a battle they can't win.
Title: Re: My new filesystem - first look
Post by: Scrripty on May 18, 2010, 07:32:49 PM
Yea.  I get that feeling that he would actually ENJOY a little playtime. :) hehe  I'm actually kind of excited to see what happens.  Should be a little fun!  More excitement than we've had in a while in the ol UO community!
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 29, 2010, 05:29:04 AM
Okie, before I go all haywire on trying to sloth through learning to implement these subs, are they ready for use? Having just read through the thread, TM, it sounds like you've abandoned them for the time being. Are they fully functional?

I simply want to be able to store a bunch of vars in a single reg entry per #CharID rather than having 30-50 generic persistent's. Does that sound doable? I'll start reading more closely and playing around with them tonight if so. I would much rather use the TM subs than the CEO filesystem (personal vendetta)!

Thanks mucho!

X
Title: Re: My new filesystem - first look
Post by: Scrripty on July 29, 2010, 05:56:22 AM
12, seriously, just look at how I did it in the Waypoint Farmer.  I use them in there to store variables.  Thousands of them at a time.  You use a for loop if they are consecutively numbered.  And you can load them that way also.  But you have to initialize the filesystem, then register variables to it, and once they are registered, you basically save them ALL with one call... and load them all with one call to the filesystem.  Simple as that really.  I can send you the exact subs I used easily so you can check out how I did it.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 29, 2010, 06:02:28 AM
Awesome, I'm not doing anything anywhere near that intensive. I just haven't had time yet to dig into the subs and their use, I figure that it would be nice to get something in place by EOD today for testing tonight.

X
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 29, 2010, 09:45:49 AM
Ok, just want to make sure I have this.

So first I must create the Variable "set", so for example if I want to save a set of variables per character and shard I might say:

Quote
gosub TM_NGFS_InitializeScript XIIxMining
gosub TM_NGFS_RegisterVariables XIIxMining local std SecureID
gosub TM_NGFS_RegisterVariables XIIxMining local std OreBagID
gosub TM_NGFS_RegisterVariables XIIxMining local std GemBagID
gosub TM_NGFS_RegisterVariables XIIxMining std std ToBank
etc

gosub TM_NGFS_SaveVariables XIIxMining
Then do I need to "gosub TM_NGFS_LoadVariables XIIxMining" in order to access and modify those variables during runtime? During this time I would treat "local std SecureID" as "!SecureID" and "std std ToBank" as "%ToBank"?

I suppose I should be going through the examples in the thread.

X
Title: Re: My new filesystem - first look
Post by: Scrripty on July 29, 2010, 09:50:14 AM
That looks correct without checking myself. :)  That's the idea tho.  You initialize the name to save the variables to.  Then just register the variables with the filesystem, then you save/load them by that name.  Easy as can be. :)
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 29, 2010, 09:54:49 AM
And once loading the set they are resident in memory and can be accessed.....effing brilliant!

TM...bah, you already know what I'm going to say...

:D

Ok, gonna keep asking questions, eventually TM will login and say "WTF?!?!"

So when would I use the "ReadItem" sub?

Is the "DoesSaveExist" sub essentially give me the simple way of seeing if I already saved a var set for this #CHARID, so for example:

Quote
gosub TM_NGFS_DoesSaveExist XIIxMiner
If ! #RESULT
   gosub TM_NGFS_InitializeScript XIIxMiner
Else
   gosub TM_NGFS_LoadVariables

...or something like that?

What is the description for the SummarizeFS and SumarizeMemory subs, do these simply display either the saved variable set or the current runtime values?

Sorry if these are dumb questions, just trying to wrap my head around these so I can implement in the miner 3.0.

X
Title: Re: My new filesystem - first look
Post by: Scrripty on July 29, 2010, 10:16:46 AM
Finally someone else to pester TM.  And you have a blue name, he might not blow you off like he does me. :)  I don't know, I just figured out how to use the filesystem.  The does save exist is exactly like you said, I've used it for checking to see if a character has previously saved variables in the slots I've assigned the script, and if not, run the initial setup. :)  Or if saveexit #false, load setup menu... :)  Or check to see if save exits and display an option, Display yesno This script has previously saved data, use it?
Title: Re: My new filesystem - first look
Post by: Scrripty on July 29, 2010, 10:22:18 AM
Now you see why I pimp this out.  I save THOUSANDS of variables with it quicker than I could with anything else... saving and loading a HUGE rail with 3 variables PER SPOT takes no time at all.  And my personal version saves like 8 variables per spot, cause I'm adding in rail spot info.  Like at rail20 check loop count, if > 3, load offshoot rail and follow it for 1 loop, then continue and reset loop counter. :)  Thanks to Cerveza giving me horrible ideas that annoy me, and make me work on this too hard. heh
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 29, 2010, 11:34:26 AM
Another question.. If the "script name" already exists and I "gosub TM_NGFS_InitializeScript" with the same name as the existing will this overwrite the existing with a blank of the same name?

In other words,

Quote
gosub TM_NGFSDoesSaveExist XIIxMining
If #RESULT
   {
   display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
   if #dispres = yes
      {
      gosub TM_NGFS_LoadVariables
      return
      }
      if #dispres = no
         gosub TM_NGFS_InitializeScript XIIxMining
   }
Title: Re: My new filesystem - first look
Post by: Scrripty on July 29, 2010, 12:07:28 PM
I asked TM the exact same question and it's yes.  If you overwrite variables, they are overwritten.
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 29, 2010, 01:19:04 PM
Sorry I forgot my tethering phone today, so I'm using other methods to internet connect....

I'm not going to change the basics of what's implemented now.  I will only add utilities and functionality as it comes up.   So these should be good to go in their basic form.

Okie, before I go all haywire on trying to sloth through learning to implement these subs, are they ready for use? Having just read through the thread, TM, it sounds like you've abandoned them for the time being. Are they fully functional?

I simply want to be able to store a bunch of vars in a single reg entry per #CharID rather than having 30-50 generic persistent's. Does that sound doable? I'll start reading more closely and playing around with them tonight if so. I would much rather use the TM subs than the CEO filesystem (personal vendetta)!

Thanks mucho!

X
Exactly how it works now. 

Sorry, I'm kinda in the middle of work right now and between meetings.  So I'll have to answer your questions in more detail later this evening after I fix my stuck sprinkler valve....  Not water at the house at the moment...

Title: Re: My new filesystem - first look
Post by: TrailMyx on July 29, 2010, 01:35:48 PM
Actually, there might be one little change coming, but it won't impact you too much.  I still want you to be able to support more than one save/load set per script.  Right now it's kinda hardwired to whatever you have initialized.  If I decided to make the change, I'll try and make it painless or nearly so.

I might not even worry about it.  One load/save make sense.  And you can have more than one if you know what you are doing with the existing code.  So I'll think about it more.
Title: Re: My new filesystem - first look
Post by: Scrripty on July 29, 2010, 01:57:43 PM
Seriously if you just change over all the existing stuff to FS2, it's all good TM.  No need to go the extra mile and add multi save whatever... :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 30, 2010, 02:33:12 PM
Seriously if you just change over all the existing stuff to FS2, it's all good TM.  No need to go the extra mile and add multi save whatever... :)


I started working on the bridging routines between the original FS and the NGFS.  Also going to write some supporting routines for file system management (i.e. delete NGFS entry, etc.)

So this will also have export/import capability for those who want to move data from computer to computer.
Title: Re: My new filesystem - first look
Post by: Scrripty on July 30, 2010, 03:32:16 PM
Thats how its done.  I knew if I got a blue or red name on bord we'd sé some work outta you on this.  Nice work 12x.  ;D
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 30, 2010, 03:34:28 PM
Thats how its done.  I knew if I got a blue or red name on bord we'd sé some work outta you on this.  Nice work 12x.  ;D

Ah well, I started working on it last weekend but I didn't want to get you too excited.  We know how you are.  ;)
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 30, 2010, 03:41:54 PM
Another question.. If the "script name" already exists and I "gosub TM_NGFS_InitializeScript" with the same name as the existing will this overwrite the existing with a blank of the same name?


Since NGFS entries are indexed with the script name *AND* character ID, you can actually have the same script name on different characters.  The only time you'll overwrite a data set is if you are saving to the same script name on the same character.
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 30, 2010, 03:45:29 PM
And once loading the set they are resident in memory and can be accessed.....effing brilliant!


Not only loaded, but loaded into their respective namespace/variable locations.  All with one load!

Don't worry about the SummarizeFS and SumarizeMemory functions.  Those were there as I was developing them NGFS viewer and will disappear from the NGFS base function list.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 30, 2010, 03:47:48 PM
Since NGFS entries are indexed with the script name *AND* character ID, you can actually have the same script name on different characters.  The only time you'll overwrite a data set is if you are saving to the same script name on the same character.
That's perfect. I am doing that to overwrite settings if a user doesn't want to use saved settings.

I think I've got the basics on these subs, really not that difficult. And I see by the way you setup the for loop that there really is no limit to the number of variables that you can pass with a single call.

X
Title: Re: My new filesystem - first look
Post by: Scrripty on July 30, 2010, 10:46:47 PM
I told u guys they were easy. ;D
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 31, 2010, 04:48:50 PM
Having trouble loading the vars. I try to load and it just hangs there, never seeming to get to the point where it completes the load.

Basically this is all I'm doing:

Code: [Select]
sub Setup
   gosub TM_NGFS_DoesSaveExist XIIxMining
   If #RESULT
      {
    display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
    if #dispres = yes
       {
     gosub TM_NGFS_LoadVariables XIIxMining
     gosub LoadSavedSettings ;displays Tracking menu and loads initial variable values, never gets here
       return
       }
    }

   gosub TM_NGFS_InitializeScript XIIxMining
   gosub TM_NGFS_RegisterVariables XIIxMining std std RunebookID SecureID OreBagID StoneBagID BlkRkBadID ToTinker TravelMethod ToBank YesMine NoMine
etc
return

Everything looks correct?

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 31, 2010, 05:04:01 PM
Can you do a little debugging to see where it is hanging?
Title: Re: My new filesystem - first look
Post by: 12TimesOver on July 31, 2010, 05:26:00 PM
Can you do a little debugging to see where it is hanging?
Of course, sorry just wanted to make sure it wasn't me before I got into F7.

Here's what's happening, this section is from the load sub:
Code: [Select]
  while !continue = #TRUE
  {
    gosub ReadItem !string ; <----it heads to the ReadItem sub which returns !continue as #FALSE every time
    if !continue = #TRUE
    {
      set !nstype #RESULT
      gosub ReadItem !string
      set !nsname #RESULT
      gosub ReadItem !string
      set !var #RESULT
      gosub ReadItem !string
      set !val #RESULT
      if std in !nstype
      {
        set % . !var !val
      }
      else
      {
        set ! . !var !val
        namespace copy !var to !nstype !nsname
      }
      set !newval ! . !slot
      set ! . !slot !newval , !nstype ,  , !nsname ,  , !var , 
      set !varcnt !varcnt + 1
    }
    if !continue = #FALSE
    {
      set !line_count !line_count + 1
      set !temp !slot , !line_count
      set !string * . !temp
      set !start 1
      set !sepcnt 1
      if !string <> N/A
        set !continue #TRUE ; still more to process
    }
  }
  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return
So basically it looks like it never actually thinks it has reached the end of the var list.

Here is the value of the registry key:

Code: [Select]
stdstdRunebookIDCGINAODstdstdSecureIDWSPHPNDstdstdOreBagIDZKGORMDstdstdStoneBagIDZTIMVNDstdstdBlkRkBadIDN/AstdstdToTinkeryesstdstdTravelMethodREstdstdToBankyesstdstdYesMineN/A_2239_1265_31_2240_1264_27_2177_1251_0_1654_2926_48_1654_2928_51stdstdNoMineN/A_2239_1264_33_2239_1266_21_2239_1267_15_2240_1265_19_2240_1266_13_2240_1267_-1_2241_1264_20_2241_1265_14_2241_1266_-2_2241_1267_0_2242_1264_22_2242_1265_16_2242_1266_0_2242_1267_0_2243_1264_30_2243_1265_12_2243_1267_0_2243_1268_0_2177_1252_-6_2177_1254_-15_2177_1255_-15_2178_1251_10_2178_1252_1_2178_1253_-3_2178_1254_0_2178_1255_0_2179_1251_19_2179_1252_8_2179_1253_0_2179_1255_0_2180_1251_23_2180_1252_15_2180_1253_1_2180_1254_0_2180_1255_0_2181_1251_27_2181_1252_20_2181_1253_10_2181_1254_11_2181_1255_10_1654_2927_49_1654_2927_0

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 31, 2010, 06:43:34 PM
I've never seen this before; can you dive a bit deeper into the Read sub?  I have a whole bunch of test code and have literally saved 1000s of items in one set without issue. 

The one thing you might look at is how you are loading things.  After you load, you are registering the same variables again.  That might mess up the next load.  Once you load an existing set, you don't have to initialize and re-register.

I would delete that registry entry and reformat your code just a bit to avoid re-initializing and re-registering.  Dunno, I'm just grasping.

You might post a bit more code so I can look at it more closely.
Title: Re: My new filesystem - first look
Post by: Scrripty on July 31, 2010, 07:01:13 PM
Ive registered tens of thousands, saved loaded no issues.  Look at the waypoint farmer in my private library.
Title: Re: My new filesystem - first look
Post by: TrailMyx on July 31, 2010, 07:04:51 PM
Ah, nevermind.  You just need to Initialize before you load:

Code: [Select]
sub Setup
  gosub TM_NGFS_DoesSaveExist XIIxMining
  If #RESULT
  {
    display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
    if #dispres = yes
    {
      gosub TM_NGFS_InitializeScript XIIxMining ; <-- lookie here
      gosub TM_NGFS_LoadVariables XIIxMining
      gosub LoadSavedSettings ;displays Tracking menu and loads initial variable values, never gets here
      return
    }
  }
  gosub TM_NGFS_InitializeScript XIIxMining
  gosub TM_NGFS_RegisterVariables XIIxMining std std RunebookID SecureID OreBagID StoneBagID BlkRkBadID ToTinker TravelMethod ToBank YesMine NoMine
return

The TM_NGFS_DoesSaveExist doesn't actually do anything with the save sets, it just checks to see what's available.  That's why you have to Initialize before your load transaction to setup the registration namespace.

Probably one of the bullet-proofing items I can add is to initialize automatically if it doesn't sense it's been initialized.  That's to 12X-proof it.  ;)

Also enjoy the re-formatting to a much more pleasing spacing.  :p
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 01, 2010, 02:12:12 AM
I'm pretty sure what I'm doing is correct. I'm trying to see if it exists and if it does I give the user the option to go ahead and use the existing set. If they hit "yes" it should load the variable set. Otherwise it reinitializes and starts the setup routine to get all the values. If I do it like your example won't the initialization clear all the values?

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 01, 2010, 09:27:42 AM
Umm, well, I tried your code and got it to lock up.  Adding the "gosub TM_NGFS_InitializeScript XIIxMining" fixed it.  I actually ran it.....

Remember that "TM_NGFS_DoesSaveExist" doesn't actually do anything with the data set.  It's just a query.  In order to actually "use" the data when found, the initialization MUST be run prior to loading.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 01, 2010, 09:39:08 AM
Umm, well, I tried your code and got it to lock up.  Adding the "gosub TM_NGFS_InitializeScript XIIxMining" fixed it.  I actually ran it.....

Remember that "TM_NGFS_DoesSaveExist" doesn't actually do anything with the data set.  It's just a query.  In order to actually "use" the data when found, the initialization MUST be run prior to loading.
So if I initialize an existing data set it doesn't clear it? I must have misunderstood earlier. If that's the case then obviously I'm doing it wrong but then how does one clear the set?

Thanks for all of this TM!

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 01, 2010, 09:46:48 AM
Nope, I suppose "initialize" is a poor wording for the action.  It's not "formatting" your file system, just initializing the functions to run.

I have a new version I'll post where I've added a few new functions that allow deleting contents of a data set.

 Loading is where the existing registration list is generated.
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 01, 2010, 12:58:33 PM
Ok, I updated the first post with an updated TM_NGFS to version 0.3.  This adds a bit of error handling and the ability to delete entries.

Also updated is the viewer.  Ver 4 allows you to delete full FS entries.  Note this works ONLY from the ALL tab.  Don't try it from the other tabs yet.  you might scramble your file system.  The viewer depends on the tm_tabhandler2.txt, so be sure you download this too.

The update button doesn't work yet, so if you want to make changes to the FS on the fly (running another script) then you'll need to stop/restart the viewer to see the file system changes.  

Once I get a few more maintenance functions written, I'll change the Viewer program to Manager.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 01, 2010, 05:17:34 PM
Ah excellent. I totally misunderstood an earlier question/answer where. I am all over it now! Thanks much for straightening me out, I feel like such a newb.

X
Title: Re: My new filesystem - first look
Post by: Scrripty on August 01, 2010, 05:30:17 PM
When you say "delete full file system entries" does this mean there's a function to do this?  Or it can ONLY be done from the viewer tab?
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 01, 2010, 05:45:49 PM
When you say "delete full file system entries" does this mean there's a function to do this?  Or it can ONLY be done from the viewer tab?

take a look at the subs.  It's in there.  You can see how it's done with the viewer.  There's a couple ways of deleting things depending on what you know about the save set.
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 01, 2010, 05:48:25 PM
Ah excellent. I totally misunderstood an earlier question/answer where. I am all over it now! Thanks much for straightening me out, I feel like such a newb.

X

Heh, no worries.  It's  not like it's commented very well.  Thanks for taking the time to try and figure it out....
Title: Re: My new filesystem - first look
Post by: Scrripty on August 01, 2010, 05:50:26 PM
Yea, and don't give up trying to figure it out, cause it's the first time TM has worked on it since I started using it! :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 01, 2010, 08:54:40 PM
Yea, and don't give up trying to figure it out, cause it's the first time TM has worked on it since I started using it! :)


Heh, it's been a while since I've had any inspiration.  So it's coming glacially.  It is helpful to see people playing with it.  I might release it soon after I get a bit more functionality put into the browser/manager.
Title: Re: My new filesystem - first look
Post by: Scrripty on August 02, 2010, 05:05:08 AM
So does that mean I have to get more people using the list and tab subs to get ngfs support for those too? :)  It actually doesn't look that hard to write a "wrapper" and I even started on one, I'll post it here and have you look at it. :)  I want to use the list subs so bad with ngfs. :)
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 02, 2010, 06:05:49 AM
Yea, and don't give up trying to figure it out, cause it's the first time TM has worked on it since I started using it! :)
LOL. I don't intend to. I'm WAY overdue for getting this upgrade out and I'll be damned if I'm going to use CEO's when I have TM's right here in front of me!!

Hopefully I'll have time at lunch to get this all updated and I'll test again tonight. Man I need an Internet connection at work that isn't through our corproate firewall!

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 02, 2010, 07:27:09 AM
I need to retrofit this into a few of my scripts.  Seems kinda odd that I'm not one of the consumers yet.  ;)
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 02, 2010, 08:11:20 AM
I need to retrofit this into a few of my scripts.  Seems kinda odd that I'm not one of the consumers yet.  ;)
LOL - "don't get high on your own supply"?

;)

Title: Re: My new filesystem - first look
Post by: TrailMyx on August 02, 2010, 08:36:37 AM
It's kinda funny really.  This is one of those utilities I've had rattling around in my head for a long time now.  After the first file system, I knew it was technically feasible, but I knew it was going to be a pain in the butt to implement.  Thankfully, it was more of a basic revision of the original FS.  I'm a big fan of flat-files for storage of data so I've never been a big fan of the registry method.  Once I create an import/export set of functions from/to the two file systems, I think it'll be ready to ship.  I'll just add those features to the browser/manager.

I'm not sure how this compares with CEOs since I've never used his before.  I never even used his railing either; I just looked at his rail format when I made the converter that converts from CEO to TM_RAIL.  I'm still pretty xenophobic when it comes to scripts.

Anyhow, hope you get it working.
Title: Re: My new filesystem - first look
Post by: Scrripty on August 02, 2010, 08:47:13 AM
Seriously, the only thing holding me back from doing something completely outrageous with the list subs is the saving to file portion.  Saving to registry will give the list subs a speed edge and allow on the fly loading and saving of list variables that is second to none... at least none I've seen.  It would allow saving of huge amounts of list data fairly quickly, making them usefull for a WHOLE lot of things I have rattling around in my head... :)  Not to mention temporary saving of list data while working on things, then saving to file... also, would be nice to have some sort of unencrypted saving to file.  Or how about, import file to registry?  Then we could save data for export to other chars, or upload here for others to use?  I could do FULL dungeon monster lists, then save them to file, upload here, and import directly into scripts.  Things of that nature. :)  I could even use them to save data on the fly as I'm doing rails, so you don't have to do a 20k variable save at the end of recording a rail.  I could implement them in things like the new plant tending script, and have it list ALL plant data... and imagine having the plant script save data on each plant, and load it up on tending so you can track day to day plant issues, and keep detailed stats on EACH PLANT. :)  Where when you load up a plant for tending, it displays THAT PLANTS exact day to day info in another list... heh
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 02, 2010, 09:15:15 AM
Well I'm working on the set of routines that will be 100% compatible with the existing FS, but just stubs.  So you just yank out the old FS, and add in the hooks for the NGFS.  Should be pretty transparent; you might have to change the file name to a "script name" but that's about it.

And yes, the import/export is something that's coming.
Title: Re: My new filesystem - first look
Post by: Scrripty on August 02, 2010, 09:23:34 AM
Thank you sir.  Then I'll go back to waiting patiently. :)  And see about finding more uses for the list subs.  Cause they are the *bleep*.  I'm so going to track some serious data with them when they are ngfs compatible. 
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 03, 2010, 06:41:21 AM
Ok, got everything updated with the new version (thanks for the usage notes in each sub BTW). So let's make sure I'm using correctly, I can't test until later unfortunately but here goes:

Code: [Select]
sub Setup
   ;First, see if the script has been used with this char before
   gosub TM_NGFS_DoesSaveExist XIIxMining
   If #RESULT ;If it has been used before we give the user a chance to keep the settings
      {
    display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
    if #dispres = yes
       {
         gosub TM_NGFS_InitializeScript XIIxMining   ;If yes then initialize and load the existing variables, exit Setup
     gosub TM_NGFS_LoadVariables XIIxMining
     gosub LoadSavedSettings
       return
       }
      if #dispres = no
         gosub TM_NGFS_DeleteName XIIxMining ;If not then clear the XIIxMining "script" and move on through the remaining setup routine
    }

   gosub TM_NGFS_InitializeScript XIIxMining
   gosub TM_NGFS_RegisterVariables XIIxMining std std RunebookID SecureID OreBagID StoneBagID BlkRkBadID ToTinker TravelMethod ToBank YesMine NoMine
   
   gosub Display_M_Setup

   -----<do a bunch of configuration stuff modifying the variables added abov>-----

   gosub TM_NGFS_SaveVariables XIIxMining
   gosub Display_M_Tracking
Return

Does that look right?

Thanks.

X
Title: Re: My new filesystem - first look
Post by: Scrripty on August 03, 2010, 07:13:01 AM
DeleteName?  Sweet. :)
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 03, 2010, 07:40:57 AM
DeleteName?  Sweet. :)


12X, you will be the tester of the DeleteName sub.  I don't think I've tested that one yet.  I just tested the forced delete.

However, since your save set won't be very dynamic, you don't even need to delete it. 

Looks good otherwise.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 03, 2010, 08:01:42 AM
12X, you will be the tester of the DeleteName sub.
Woot! Look at me at the bleeding edge!

Quote
However, since your save set won't be very dynamic, you don't even need to delete it. 
I actually did think about this. Technically you are correct since the logic of the sub is to go reset all of the values anyhow. I just thought it would be cleaner if I cleared it first then repopulated it with the same vars/new values afterward.

Thanks again, I'm looking forward to testing this tonight! Hopefully I can finally get this feature checked off my list.

X
Title: Re: My new filesystem - first look
Post by: Scrripty on August 03, 2010, 08:06:26 AM
You're welcome. :) heh
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 03, 2010, 08:42:02 AM
You're welcome. :) heh
Heh, well you were the guinea pig for the rest, so thanks!  Here's some lettuce.
Title: Re: My new filesystem - first look
Post by: Cerveza on August 03, 2010, 08:43:19 AM
Insure all your items.... you'll be nekid soon.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 06, 2010, 06:58:15 AM
12X, you will be the tester of the DeleteName sub.
[/quote]
No dice but I'm not done making sure that I'm using everything correctly. I'm having some other save variable issues as well.

I'll post more as I figure out something valid LOL.

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 06, 2010, 08:49:50 AM
That's ok, i'll be playing with it a bit more this weekend.  Playing with the fisherman again has given me a bit of encouragement.  I've got the urge to work a bit more on my SOS farmer.

But post up some code; the last bit was pretty obvious to me what was up.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 06, 2010, 09:35:26 AM
But post up some code; the last bit was pretty obvious to me what was up.
Sure thing!

Pretty straightforward and not really any different than what I posted last time so maybe it will indeed be quickly obvious!

Here is the Setup sub. I snipped the section where all of the variables get set as that is not the problem and makes for a long copy+paste!

Code: [Select]
sub Setup
   gosub TM_NGFS_DoesSaveExist XIIxMining
   If #RESULT
      {
    display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
    if #dispres = yes
       {
         gosub TM_NGFS_InitializeScript XIIxMining
     gosub TM_NGFS_LoadVariables XIIxMining
     gosub LoadSavedSettings
       return
       }
      if #dispres = no
         gosub TM_NGFS_DeleteName XIIxMining
    }

   gosub TM_NGFS_InitializeScript XIIxMining
   gosub TM_NGFS_RegisterVariables XIIxMining std std RunebookID SecureID OreBagID StoneBagID BlkRkBadID JewelBagID ToTinker ToBank TravelMethod SecureGmpName SecureGmpSize
   
   gosub Display_M_Setup

   ;-----snipped a bunch of variable setting code here-----

   gosub TM_NGFS_SaveVariables XIIxMining
   gosub Display_M_Tracking
Return
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 06, 2010, 09:40:02 AM
And what is it not doing?  

And one thing right off the bat....  In your instance of using the Delete, you really don't even need to do that.  Since you are reinitializing right after that, you are pretty much deleting anyhow.   The delete is meant more for overall filesystem management, and not for the user.  I was actually going to divide up the subs to "user" routines and "admin" routines.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 06, 2010, 10:11:02 AM
And what is it not doing?  

And one thing right off the bat....  In your instance of using the Delete, you really don't even need to do that.  Since you are reinitializing right after that, you are pretty much deleting anyhow.   The delete is meant more for overall filesystem management, and not for the user.  I was actually going to divide up the subs to "user" routines and "admin" routines.
I want to delete because I don't want any residual values left in the "script".

This morning before I left for work the Delete line seemed to do nothing (the Script reg key remained fully in tact). Also, there are values that I'm setting on the fly withint the setup routine that didn't seem to get saved (were still set to N/A) but this is the one I still need to mess with further to make sure it's not a logic issue on my part.

Unfortunately I'm at work so I have no access to test.

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 06, 2010, 10:24:25 AM
Ok, I'll look at it this evening.  I think the snippet you posted should be enough.

The thing about residual values is if your save set isn't dynamic (i.e. varies in size), then every time you save, you will wipe out the previous set which is kinda like deleting.  The Delete routine is useful for a dynamic set of data that might change size and must range accordingly.  But it seems you are implying that you are operating in a more dynamic regime.
Title: Re: My new filesystem - first look
Post by: Scrripty on August 06, 2010, 10:56:12 AM
I'll get around to testing the delete functions on the waypoint farmer.  I'll use it when deleting a rail from the list.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 06, 2010, 11:13:56 AM
Ok, I'll look at it this evening.  I think the snippet you posted should be enough.

The thing about residual values is if your save set isn't dynamic (i.e. varies in size), then every time you save, you will wipe out the previous set which is kinda like deleting.  The Delete routine is useful for a dynamic set of data that might change size and must range accordingly.  But it seems you are implying that you are operating in a more dynamic regime.
Hmmm good point, I suppose a "Reset Settings" sub would be appropriate instead. Was just hoping for a nice, easy reset with the NGFS subs.

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 06, 2010, 11:15:43 AM
I suppose you could just initialize again.  That clears the list of things tracked.  I haven't used this enough to find all the pitfalls that might be lurking out there.  Twinkle McNugget has much more experience with it.
Title: Re: My new filesystem - first look
Post by: Scrripty on August 06, 2010, 12:07:08 PM
Honestly I had no problems at all with the stuff I have used this for and if you saw all the rails Ive saved and loaded with it... Ive put it through its paces with no problems at all.
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 06, 2010, 12:09:12 PM
Honestly I had no problems at all with the stuff I have used this for and if you saw all the rails Ive saved and loaded with it... Ive put it through its paces with no problems at all.

Are you using the latest subs, Twinkle McNugget?  I don't think I changed anything having to do with the core routines however.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 06, 2010, 12:11:47 PM
Honestly I had no problems at all with the stuff I have used this for and if you saw all the rails Ive saved and loaded with it... Ive put it through its paces with no problems at all.
:-X
Title: Re: My new filesystem - first look
Post by: Scrripty on August 06, 2010, 12:49:37 PM
I'm not using the new subs.  But load up the waypoint farmer, run around while recording a 1000 point rail.  That's 3000 variables.  Save it, then restart the script and load it.  Should work perfectly.  Plus it's tied in with the list subs too.
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 06, 2010, 12:50:31 PM
Ok, so here is the latest. Of course I can't test anything LOL for a few more hours LOL.

Code: [Select]
sub Setup
   gosub TM_NGFS_DoesSaveExist XIIxMining
   If #RESULT
      {
      display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
      if #dispres = yes
         {
         gosub TM_NGFS_InitializeScript XIIxMining
         gosub TM_NGFS_LoadVariables XIIxMining
         gosub LoadTracking ;starts the tracking menu and loads with counter vars
         return
         }
      }

   gosub TM_NGFS_InitializeScript XIIxMining
   gosub TM_NGFS_RegisterVariables XIIxMining std std RunebookID SecureID OreBagID StoneBagID BlkRkBadID JewelBagID ToTinker ToBank
   gosub TM_NGFS_RegisterVariables XIIxMining std std TravelMethod SecureGmpName SecureGmpSize
   gosub TM_NGFS_RegisterVariables XIIxMining std std IronCnt DullCnt ShadCnt CoppCnt BronCnt GoldCnt AgapCnt VeriCnt ValoCnt EcruCnt
   gosub TM_NGFS_RegisterVariables XIIxMining std std FireCnt BlueCnt PerfCnt DarkCnt BlacCnt CrysCnt SandCnt DiamCnt RubyCnt StarCnt
   gosub TM_NGFS_RegisterVariables XIIxMining std std SappCnt CitrCnt EmerCnt AmbeCnt TourCnt AmetCnt IronStnCnt DullStnCnt ShadStnCnt
   gosub TM_NGFS_RegisterVariables XIIxMining std std CoppStnCnt BronStnCnt GoldStnCnt AgapStnCnt VeriStnCnt ValoStnCnt

   gosub Display_M_Setup ;starts the Setup menu
   gosub LoadDefaults
   
   <DO A BUNCH OF STUFF TO THE VARS WITH SETUP MENU, ETC>

   gosub TM_NGFS_SaveVariables XIIxMining
   gosub LoadTracking ;starts the tracking menu and loads with counter vars
Return
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 07, 2010, 04:48:20 AM
Okie, good news is that I seem to be fine now. I manually deleted all associated registry values and started over using a rebuilt wrapper that manages the variable value resets, etc. I also pulled the coordinate tracking variables out and left those as persistent's but just for now while I work on the problem. I don't know if they were causing me issues or not but I doubt it so re-adding them later should be easy.

Incidentally, as a result, I am no longer testing the "Delete" function ;)

Anyhoo, so far so good. I pulled the reg value and pasted it in Notepad++ so I could take a look at the save and it looks great!

X
Title: Re: My new filesystem - first look
Post by: 12TimesOver on August 09, 2010, 02:17:30 AM
Just an observation, not an issue with the subs...

I noticed that simply Initializing a new variable set will make the return value of "DoesSaveExist" #TRUE even if it contains no values. My use of the "DoesSaveExist" sub above is great as long as the initial script setup was completed successfully during the last session. If something happened where it was cancelled even without setting up a single thing the "DoesSaveExist" sub returns #TRUE.

With this in mind I simply changed the wrapper a little bit to accomodate an "%Initialized" variable value that is set to #FALSE unless the script was successfully configured:

Code: [Select]
sub Setup
   gosub TM_NGFS_DoesSaveExist XIIxMining
   If #RESULT
      {
      gosub TM_NGFS_InitializeScript XIIxMining
      gosub TM_NGFS_LoadVariables XIIxMining
      if %Initialized = #TRUE
         {
         display yesno It looks like you've used this script before. Would you like to use the settings saved from your last session?
         if #dispres = yes
         return
         }
      }

   gosub TM_NGFS_RegisterVariables XIIxMining std std RunebookID SecureID OreBagID StoneBagID BlkRkBagID JewelBagID ToTinker ToBank
   gosub TM_NGFS_RegisterVariables XIIxMining std std TravelMethod SecureGmpName SecureGmpSize Initialized
   gosub TM_NGFS_RegisterVariables XIIxMining std std IronCnt DullCnt ShadCnt CoppCnt BronCnt GoldCnt AgapCnt VeriCnt ValoCnt EcruCnt
   gosub TM_NGFS_RegisterVariables XIIxMining std std FireCnt BlueCnt PerfCnt DarkCnt BlacCnt CrysCnt SandCnt DiamCnt RubyCnt StarCnt
   gosub TM_NGFS_RegisterVariables XIIxMining std std SappCnt CitrCnt EmerCnt AmbeCnt TourCnt AmetCnt IronStnCnt DullStnCnt ShadStnCnt
   gosub TM_NGFS_RegisterVariables XIIxMining std std CoppStnCnt BronStnCnt GoldStnCnt AgapStnCnt VeriStnCnt ValoStnCnt

   set %initialized #FALSE
   gosub Display_M_Setup
   gosub LoadDefaults
   gosub TM_NGFS_SaveVariables XIIxMining

   <SET A BUNCH OF STUFF>

   set %Initialized #TRUE
   gosub TM_NGFS_SaveVariables XIIxMining
return

Just thought I'd throw that out there in case someone finds it useful.

X
Title: Re: My new filesystem - first look
Post by: TrailMyx on August 09, 2010, 10:01:42 AM
Yup, when you "Initialize" you are actually creating a spot in the filesystem to store stuff.  At that point, the FS doesn't care what you've put in there.  That's to prevent the possible overwrite of WHATEVER might be in there.

Anyhow, I'm glad you finally got it working.  It should have been easier, but for some reason it was difficult.  dunno what happened.  You wouldn't happen to have your dumps of the errant registry information?  If something got corrupted, it might be helpful to see what was up so I might be able to prevent it next time.

But I like what you did with the initialization flag.  That's a great idea and probably something I'll adopt as well. 
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on December 26, 2010, 10:18:13 PM
I've had this lurking in the Elite section for a while and kinda forgot to release it.  A couple of the Elites have done some scripts based on these tools, and enclosed in this thread are some of their discoveries and sample work.  I've moved it to a public section for all to enjoy.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 21, 2011, 06:53:35 PM
getting ready to incorporate this in my new script.  from what i've tested it should do everything i need!

thanks a bunch :)

i suppose i should still also use your other file system to save variables to file for transfering rails/settings between computers/players.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 21, 2011, 07:09:53 PM
I do plan on adding a way to save sets to a file through the NGFS manager script.  I just haven't played much with this in a while.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 23, 2011, 01:03:25 PM
I'm kinda confused I guess.

I ran a test to save a local namespace "goodgame" with variables a/b/c set to aa/bb/cc.  Saved them on one character, checked your ngfs_viewer and see them.  I noticed that they are automatically saved by charid _ shard.

Does that mean I can't save a bunch of variables on one character, and then load them up on another?
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 23, 2011, 01:12:27 PM
You can save them as a generic set I believe.  It's been a while since I've played with these, but the generic set was meant to let scripts share data.  I'll have to look this evening to see if I have any sample code for that.  Sorry, at work right now.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 23, 2011, 01:21:01 PM
Ok, look at adding a second argument to the initialization:

Code: [Select]
;--------------------------------------------------------------------
;---------------------  Base User Functions -------------------------
;--------------------------------------------------------------------
; TM_NGFS_InitializeScript
; %1 - ScriptName
; %2 = (opt) generic : add this tag to create a generic (non-character relative data set)

And then look at this little bit of test code:

Code: [Select]
    gosub TM_NGFS_InitializeScript new_script2 generic
    gosub TM_NGFS_DoesSaveExist new_script2 generic
    if #RESULT = #TRUE
      display ok new_script2 generic save exists
    stop

So if you initialize it as "generic", then it will address the data as generic.  Therefore instead of using #CHARID, _ , name, it will use "generic" , _ , name.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 23, 2011, 01:27:47 PM
oh wow.  i see.

i saw in a screenshot the generic after i posted this, but couldnt figure it out.

thanks.  lol
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 23, 2011, 01:29:58 PM
There isn't a real override right now to explicitly request data saved from one char and transfer it to another.  I was planning on adding that feature to the file system viewer program.  Just never got around to it since hardly anyone uses these subs.

Actually, I kinda figured that wasn't a good idea from script level because I didn't want scripters overwriting people's existing saved sets..
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 23, 2011, 02:23:59 PM
well this should work perfect for me.
i've got a bunch of character specific variables based on their desktop setup because of some pixel scanning, but ill also have some variables that all characters should be able to access, like monster database, rails, rules, etc.
i think these subs will help very nicely.  the only thing now that's keeping me from using them, is converting the junk i wrote earlier, to use the namespaces like Twinkle McNugget showed me...  since namespaces are new, i'm having quite the time figuring out when to push/pop and all.  a lot of trial and error but i finally got it to start from the main namespace, then to another, then another, and restore back to the main as it finishes each one.  i think i shall re-read your post.  i just reread the easyuo ones, but they arn't all that great. lol.  sorry for the OT babble ;p
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 23, 2011, 02:33:21 PM
Well don't forget you can use these subs to store/retrieve the %vars also.  I think it's documented in there somewhere.  I'll hunt for some sample code tonight.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 23, 2011, 02:39:54 PM
There it is:

Code: [Select]
gosub TM_RegisterVariable std std newvar  ; denotes a %var

Right when you register.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 23, 2011, 02:54:59 PM
There it is:

Code: [Select]
gosub TM_RegisterVariable std std newvar  ; denotes a %var

Right when you register.

yes i saw that too.  i figure i can store some variables that are global to all characters in standard variables, rather than the namespaces i suppose, such as menu positions, global time counts etc.  this is some really crazy useful subs.  i'm going to have to rewrite what i've done on my plant script to support these, when i ever feel like finishing it, if ever lol.

hopefully i wont have many more questions :)  i tried to read through the 8 or so pages on this topic, but i skimmed it pretty fast looking for things that caught my eye.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 23, 2011, 03:35:25 PM
I wish I had more time to retrofit some of my older scripts with these also.  Just no time to fiddle with the  old things...
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 24, 2011, 04:46:49 PM
any idea why this wont work?  i think i'm doing it wrong.

i set %fastlpc & %normallpc when the script starts, and change it on the menu.

this is what i'm calling for save:
Code: [Select]
  gosub TM_NGFS_InitializeScript OMGPVM generic
   gosub TM_RegisterVariable OMGPVM std std fastlpc
   gosub TM_RegisterVariable OMGPVM std std normallpc
   gosub TM_NGFS_SaveVariables OMGPVM

this is what i'm calling for load:
Code: [Select]
  gosub TM_NGFS_InitializeScript OMGPVM generic
   gosub TM_NGFS_LoadVariables OMGPVM

it wouldn't save/load properly, so i opened the viewer and it shows this:
left list, show:
generic_OMGPCM_vars
right list, variable view|all:
-1--1--1 = !-1
-1--1--1 = !-1

I've tried to delete the FS entry, and redo it but can't get it to work lol.  I can get the save/load per character, per namespace working everytime though.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 24, 2011, 04:50:33 PM
edited post;

this is where i started, and just tried again
   gosub TM_RegisterVariable OMGPVM std std fastlpc
   gosub TM_RegisterVariable OMGPVM std std normallpc
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 24, 2011, 06:16:35 PM
Perhaps you should be scripting in ScriptUO and use the syntax checker... ;) 

You have a typo(s)

Code: [Select]
gosub TM_NGFS_InitializeScript OMGPVM generic
gosub TM_NGFS_RegisterVariables OMGPVM std std fastlpc
gosub TM_NGFS_RegisterVariables OMGPVM std std normallpc
gosub TM_NGFS_SaveVariables OMGPVM
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: OMGBurgers on March 24, 2011, 06:23:53 PM
lol... wow.

i gave up like 20 minutes ago and seeing it be something that stupid makes me want to take a break for a few days lol...

sorry for all the stupid questions/problems lately...
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on March 24, 2011, 06:26:14 PM
Hey no worries. Just don't forget the tools that are out there.

Typically when something isn't working the way I think it should, I'll run the syntax checker on it.  90% of the time, I've done a typo or some other non-sense.

But don't worry posting questions, I don't mind answering whatever you've got to ask.

My documentation isn't the greatest with these, so these are kinda hard to get used to.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: The Reaper on June 05, 2011, 06:10:34 AM
Really quick question, would this work for registering variables, I'm wayyyy to lazy to type out all 25 x 64 x 4 possibilites :S

Code: [Select]
for %TR_rune 1 64
    {
    for %TR_no 1 25
        {
        if %TR_x_ , %TR_rune , _ , %TR_no <> n/a
           {
           gosub TM_NGFS_RegisterVariables TheReapers_Log_Harvester std std TR_x_ , %TR_rune , _ , %TR_no TR_y_ , %TR_rune , _ , %TR_no TR_z_ , %TR_rune , _ , %TR_no TR_tt_ , %TR_rune , _ , %TR_no
           }
        }
    }
gosub TM_NGFS_SaveVariables TheReapers_Log_Harvester

Now I understand that the "%" wouldn't normally appear in this gosub command, however, I'm using it to construct the variable name. So set of variables that would be called would be: "TR_x_1_1" "TR_y_1_1" "TR_z_1_1" and "TR_tt_1_1"
Next set would then be: "TR_x_1_2" "TR_y_1_2" "TR_z_1_2" and "TR_tt_1_2"
Until we reach: "TR_x_64_25" "TR_y_64_25" "TR_z_64_25" and "TR_tt_64_25"
I know it's a hell of a lot of variables, but when I've finished there will only be about 300, as not every tile will need to be recorded, instead of 6400 :P
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on June 05, 2011, 07:03:39 AM
That should work fine.  I'd split up that one registervariables into individual lines just to help read and if you need to add more, then it's easier:

Code: [Select]
             gosub TM_NGFS_RegisterVariables TheReapers_Log_Harvester std std TR_x_ , %TR_rune , _ , %TR_no
              gosub TM_NGFS_RegisterVariables TheReapers_Log_Harvester std std TR_y_ , %TR_rune , _ , %TR_no
              gosub TM_NGFS_RegisterVariables TheReapers_Log_Harvester std std TR_z_ , %TR_rune , _ , %TR_no
              gosub TM_NGFS_RegisterVariables TheReapers_Log_Harvester std std TR_tt_ , %TR_rune , _ , %TR_no

Anyhow, you're way works fine too, but it just gave me a headache to make sure there were spaces in the line and that it was syntactically correct.  ;)
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: The Reaper on June 05, 2011, 07:20:20 AM
Sweet, my logger will be ready for Ter Mur soon then :P

God am I glad I don't have to add 6400 variables :P
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on July 25, 2011, 10:41:17 PM
Did you get it to work?
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: Neo on August 16, 2011, 03:57:06 PM
This is SO useful, thank you for sharing this... I'm using this in everything I write...

I just need to learn how to delete a saved configuration.... :D

Cheers...

neo
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on August 16, 2011, 03:59:10 PM
I believe you can delete a configuration from the UI application I put together (the viewer).  Anyhow, glad you are getting some use out of them.  I still plan to do a bit more with these as far as features are concerned.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on April 01, 2012, 04:44:21 PM
I have a major revamping of this toolset coming soon.  A few addition to the NGFS, but a major revision to the viewer.  It's now become a full-blown manager allowing you to edit file system entries, copy file systems, delete file system and port NGFS file systems to/from datafiles compatible with the old file-based filesystem.  It's very powerful.  With the ability to filter your view based upon shard/char/FSname, it's easy to view and copy data.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: Neo on April 02, 2012, 03:20:47 PM
I have a major revamping of this toolset coming soon.  A few addition to the NGFS, but a major revision to the viewer.  It's now become a full-blown manager allowing you to edit file system entries, copy file systems, delete file system and port NGFS file systems to/from datafiles compatible with the old file-based filesystem.  It's very powerful.  With the ability to filter your view based upon shard/char/FSname, it's easy to view and copy data.
Is this true? Or April's fool? hehe...

This revamp would be amazing... Or a very cruel joke haha... :D

Would love to get my hands on something like that !
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on April 02, 2012, 04:17:15 PM
I didn't think about that.  Lol.  No cruel joke, but the truth.  I'm almost done with a version for you to play with.  Not many people use this, but it's a great tool.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on September 30, 2013, 12:28:07 PM
Oh man, I totally forgot to post this.  Actually looking at the code I remember now why I didn't.  It's *almost* done.  Not quite, but almost.  Perhaps I can get it finished; I hate leaving this useful bit of code unreleased.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: Nylar on February 03, 2015, 02:10:05 AM
Heh let me Necro this and ask the obvious question...

Did you ever 'Finish' it?
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on February 03, 2015, 09:51:39 PM
Well the NGFS is finished.  The manager/viewer isn't quite yet.  I have the viewer a bit more functional,  but didn't quite get all the functions complete that I had envisioned.   I might post what I have so far as soon as I can go back and verify what works.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: Crisis on March 15, 2015, 07:32:29 PM
That would be cool!
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: Trigs on August 31, 2018, 05:28:12 AM
Hey TM,

I've been playing with a handful of your file system based scripts lately, and think I noticed an issue across a few of them.

With the stuff you added for allowing "call" or "gosub" I think there is a mismatch in same variable names:

Code: [Select]
if !TM_FunctionCalled = #TRUE ; successfully called function.
  exit
if %0 = N/A
  display ok You may not run this script directly.
else
  display ok Function " , %1 , " not found.
stop

However, at the end of all the subs:
Code: [Select]
sub TM_NGFS_GetFSIndexVal
  namespace push
  namespace local TM_NGFS , _ , %1
  set #RESULT *TM_FS . %1
  namespace pop
  set !TM_Function_found #TRUE
return #RESULT

TM_Function_found  =/= TM_FunctionCalled

It's a simple enough fix I think, unless I'm missing some reason for them being different.


EDIT: As a second note - though I'm not sure if will accomplish anything, it seems that subsequent calls to this and the AFS both cause client crashes. It could be the way I'm using them but them seem to work fine 90% of the time. Often times when "loading" in either case it will just crash the UO client to desktop... it seems weird

I love the concept, the viewer is really nice and I have some ideas I'd love to implement using these features but having a hard time debugging the crashes :(
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on August 31, 2018, 07:38:56 AM
I think you're right.  Gotta love when cut/paste goes wacky!  Looks like I just bolted on the call handler, so the easiest fix for that is to just change this:

Code: easyuo
  1. if !TM_FunctionCalled = #TRUE ; successfully called function.
  2.   exit
  3. if %0 = N/A
  4.   display ok You may not run this script directly.
  5. else
  6.   display ok Function " , %1 , " not found.
  7. stop
  8.  


to this:

Code: easyuo
  1. if !TM_Function_found = #TRUE ; successfully called function.
  2.   exit
  3. if %0 = N/A
  4.   display ok You may not run this script directly.
  5. else
  6.   display ok Function " , %1 , " not found.
  7. stop
  8.  
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: Trigs on August 31, 2018, 07:55:26 AM
I think you're right.  Gotta love when cut/paste goes wacky!  Looks like I just bolted on the call handler, so the easiest fix for that is to just change this:

Yea, that's what I ended up changing as well. I believe the same issue was present in TM_AdvancedFileSystem ( http://www.scriptuo.com/index.php?topic=22.0 )  I didn't check any others.

Any thoughts on the client crash?

Here's my use case:

Code: [Select]
call tm_ngfs.txt TM_NGFS_InitializeScript TrigBot

// some code to init
call tm_ngfs.txt TM_NGFS_RegisterVariables TrigBot std std scriptEndTime
call tm_ngfs.txt TM_NGFS_SaveVariables TrigBot

// bunch more code running script
call tm_ngfs.txt TM_NGFS_LoadVariables TrigBot // Crashes client here

I'm going to do a little more testing in isolation - I'll report back if I have a fully repeatable crash.
Title: Re: TrailMyx's Next Generation File System (TM_NGFS)
Post by: TrailMyx on August 31, 2018, 10:02:00 AM
Unsure about that.  Any script that heavily uses namespaces seems to be a little more susceptible to crashing.  It's kinda always been that way.

I normally get around many of the crashing by not using "call" at all and just importing the subs I need into my code.  Makes debugging easier also.