Author Topic: TrailMyx's Next Generation File System (TM_NGFS)  (Read 75282 times)

0 Members and 2 Guests are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
TrailMyx's Next Generation File System (TM_NGFS)
« on: March 22, 2010, 05:22:48 PM »
+1
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
;--------------------------------------------------------------------

There are 3 attachment(s) in this post. You must register and post an acceptable introduction to download
tm_ngfs3.txt
tm_ngfs_viewer4.txt
tm_tabhandler2.txt
« Last Edit: December 26, 2010, 10:15:02 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +786
  • Referrals: 1
    • View Profile
Re: My new filesystem - first look
« Reply #1 on: March 22, 2010, 06:09:58 PM »
+1
Interesting .. ill have to keep my eye on this thread.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: My new filesystem - first look
« Reply #2 on: March 22, 2010, 06:13:54 PM »
+1
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.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: My new filesystem - first look
« Reply #3 on: March 22, 2010, 06:30:53 PM »
+1
oooooooooooo

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: My new filesystem - first look
« Reply #4 on: March 22, 2010, 06:43:58 PM »
+1
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 read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: My new filesystem - first look
« Reply #5 on: March 22, 2010, 07:32:15 PM »
+1
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

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: My new filesystem - first look
« Reply #6 on: March 22, 2010, 07:33:14 PM »
+1
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +600
  • Referrals: 2
    • View Profile
Re: My new filesystem - first look
« Reply #7 on: March 23, 2010, 02:34:02 AM »
+1
Sweet, FINALLY!!!! ;) hehe.

Perfect timing too!

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

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Scrripty

  • Guest
Re: My new filesystem - first look
« Reply #8 on: March 23, 2010, 08:05:32 AM »
+1
And the heavens did open up and shine on TM filesystem 2, and god saw that it was good. :)

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +600
  • Referrals: 2
    • View Profile
Re: My new filesystem - first look
« Reply #9 on: March 23, 2010, 08:29:17 AM »
+1
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.
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Scrripty

  • Guest
Re: My new filesystem - first look
« Reply #10 on: March 23, 2010, 08:33:09 AM »
+1
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. ;)

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: My new filesystem - first look
« Reply #11 on: March 23, 2010, 08:36:20 AM »
+1

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!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +600
  • Referrals: 2
    • View Profile
Re: My new filesystem - first look
« Reply #12 on: March 23, 2010, 08:40:34 AM »
+1
...no, deeper, down into the sub-cockles.

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


XII "Hairy Palms" xOveR
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +307
  • Referrals: 8
    • View Profile
    • Insane UO
Re: My new filesystem - first look
« Reply #13 on: March 24, 2010, 01:38:38 AM »
+1
Would it be possible to implement some of this filesystem (viewing and editing namespace for example) stuff in SUO?? Just a thought!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: My new filesystem - first look
« Reply #14 on: March 24, 2010, 05:11:19 AM »
+1
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.
Please read the ScriptUO site RULES
Come play RIFT with me!