In Scripts:
Code: Select all
createMiniConsole("reagents",0,2,150,215)
setBackgroundColor("reagents",0,0,0,100);
setMiniConsoleFontSize("reagents", 10)
setWindowWrap("reagents", 85);
setTextFormat("reagents",55,0,0,0,0,255,0,0,0);
moveWindow( "reagents" , 1095 , 320 )
hideWindow( "reagents" )
showWindow( "reagents" )
Pattern: ^rupdate
Code: Select all
clearUserWindow("reagents")
setFgColor( "reagents", 102, 255, 0 )
setBgColor( "reagents", 0, 0, 0 )
echoUserWindow("reagents", "\n")
echoUserWindow("reagents", "\n")
echoUserWindow("reagents", "\n")
echoUserWindow("reagents", "\nFire Reagents " .. firereagent)
echoUserWindow("reagents", "\nWater Reagents " .. waterreagent)
echoUserWindow("reagents", "\nEarth Reagents " .. earthreagent)
echoUserWindow("reagents", "\nAir Reagents " .. airreagent)
echoUserWindow("reagents", "\nGem Reagents " .. gemreagent)
echoUserWindow("reagents", "\nEthereal Reagents " .. etherealreagent)
Code: Select all
firereagent = matches[2]
expandAlias ( "rupdate" )
In Triggers:
Pattern: ^A (\w.*) flares brightly and vanishes\! [Perl Regex]
Code: Select all
if matches[2] == "pinch of sulfur" then
firereagent = firereagent - 1
end
if matches [2] == "browning mandrake leaf" then
earthreagent = earthreagent - 1
end
if matches [2] == "feather from a roc" then
airreagent = airreagent - 1
end
if matches [2] == "shimmering white fish scale" then
waterreagent = waterreagent - 1
end
if matches [2] == "sunstone" then
etherealreagent = etherealreagent - 1
end
expandAlias ( "rupdate" )
Fire Reagents #
Water Reagents #
Earth Reagents #
etc.
My problem is that I don't know how to utilize the table.save() and table.load() so that my reagent numbers carry over each time I exit and relog. Do I put table.save()/table.load() in a new script file, or in the original script file that contains the miniconsole information? Or does it belong in an alias that I have to type each time in order to load it up? Sorry if this is basic, but it's been proving to be a rough transition from mud coding to real coding. To summarize this huge post.. Could you explain exactly how I make my variables save?
Thank you!