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

0 Members and 4 Guests are viewing this topic.

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 #60 on: July 31, 2010, 04:48:50 PM »
0
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
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 TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #61 on: July 31, 2010, 05:04:01 PM »
0
Can you do a little debugging to see where it is hanging?
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 #62 on: July 31, 2010, 05:26:00 PM »
0
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
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 TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #63 on: July 31, 2010, 06:43:34 PM »
0
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.
« Last Edit: July 31, 2010, 06:48:29 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: My new filesystem - first look
« Reply #64 on: July 31, 2010, 07:01:13 PM »
0
Ive registered tens of thousands, saved loaded no issues.  Look at the waypoint farmer in my private library.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #65 on: July 31, 2010, 07:04:51 PM »
0
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
« Last Edit: August 01, 2010, 09:33:15 AM by TrailMyx »
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 #66 on: August 01, 2010, 02:12:12 AM »
0
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
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 TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #67 on: August 01, 2010, 09:27:42 AM »
0
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.
« Last Edit: August 01, 2010, 09:37:18 AM by TrailMyx »
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 #68 on: August 01, 2010, 09:39:08 AM »
0
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
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 TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #69 on: August 01, 2010, 09:46:48 AM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #70 on: August 01, 2010, 12:58:33 PM »
0
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.
« Last Edit: August 01, 2010, 01:01:35 PM by TrailMyx »
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 #71 on: August 01, 2010, 05:17:34 PM »
0
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
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 #72 on: August 01, 2010, 05:30:17 PM »
0
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?

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #73 on: August 01, 2010, 05:45:49 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13312
  • Activity:
    0.4%
  • 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 #74 on: August 01, 2010, 05:48:25 PM »
0
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....
Please read the ScriptUO site RULES
Come play RIFT with me!