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
;--------------------------------------------------------------------
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.
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
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.
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. ;)
...no, deeper, down into the sub-cockles.
Hehe...hehehe......no, deeper, down into the sub-cockles.
Don't play with your sub-cockles, you'll go blind!
gosub TM_RegisterVariables local std test this variable ; local:std namespace
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. ;)You mean "Duke Forever"?!?!?!? NOOOOOOOO!!!!!
I've always been a big fan of utilities and generic code. I'm glad people have found some use for it all. ;)
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!
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
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
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
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 test_script
gosub TM_NGFS_LoadVariables ; loads all variables registered and associated with "test_script"
I hate those real life priorities. Want them pkd? :)
Gettin excited for a new toy now aren't ya? :) CONVERT!
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. :)
gosub TM_NGFS_InitializeScript XIIxMiningThen 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"?
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
gosub TM_NGFS_DoesSaveExist XIIxMiner
If ! #RESULT
gosub TM_NGFS_InitializeScript XIIxMiner
Else
gosub TM_NGFS_LoadVariables
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
}
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?Exactly how it works now.
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
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... :)
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
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?
And once loading the set they are resident in memory and can be accessed.....effing brilliant!
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.
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
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.
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.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
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
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.....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?
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.
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?
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
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! :)
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!!
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"?
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
DeleteName? Sweet. :)
12X, you will be the tester of the DeleteName sub.Woot! Look at me at the bleeding edge!
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.
You're welcome. :) hehHeh, well you were the guinea pig for the rest, so thanks! Here's some lettuce.
12X, you will be the tester of the DeleteName sub.[/quote]
But post up some code; the last bit was pretty obvious to me what was up.Sure thing!
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
And what is it not doing?I want to delete because I don't want any residual values left in the "script".
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.
Ok, I'll look at it this evening. I think the snippet you posted should be enough.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.
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.
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.
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
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
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
;--------------------------------------------------------------------
;--------------------- Base User Functions -------------------------
;--------------------------------------------------------------------
; TM_NGFS_InitializeScript
; %1 - ScriptName
; %2 = (opt) generic : add this tag to create a generic (non-character relative data set)
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
gosub TM_RegisterVariable std std newvar ; denotes a %var
There it is:Code: [Select]gosub TM_RegisterVariable std std newvar ; denotes a %var
Right when you register.
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
gosub TM_NGFS_InitializeScript OMGPVM generic
gosub TM_NGFS_LoadVariables OMGPVM
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
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
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
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...
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_NGFS_GetFSIndexVal
namespace push
namespace local TM_NGFS , _ , %1
set #RESULT *TM_FS . %1
namespace pop
set !TM_Function_found #TRUE
return #RESULT
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:
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