|
Joined: Dec 2002
Posts: 196
Vogon poet
|
OP
Vogon poet
Joined: Dec 2002
Posts: 196 |
My variable file is very big now, already 9.3k, I would suggest an option to have multiple variable files.
Also, how big can variable files go to?
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
I must ask what you have in that file? and why so many %var's ? i have a full script configured and everything, and it isnt that big, and i have everything "almost" made true %var.
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Aug 2003
Posts: 136
Vogon poet
|
Vogon poet
Joined: Aug 2003
Posts: 136 |
That wouldnt seem practical to me, scripts would be messed up trying to figure out which variable file to try to read, and lets hope it would have more then one variable file loaded or else scripts with the same variable would be set off by other scripts. Also, how would you call upon these variables?
In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
|
|
|
|
Joined: Dec 2002
Posts: 196
Vogon poet
|
OP
Vogon poet
Joined: Dec 2002
Posts: 196 |
the variables will be called as normal, same as you have multiple script files.
|
|
|
|
Joined: Aug 2003
Posts: 136
Vogon poet
|
Vogon poet
Joined: Aug 2003
Posts: 136 |
so in 4 different scripts I would call for %room yet in one script it assigns it as the current room Im in and in another script it assigns what room I just left and lets say in a third It assigns all the nicks in a certain room to that variable, how would I get around all that? Wouldnt it be easier to just skim down your variable file and make sure some arent just old ones set by scripts you have unloaded.
In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
how about you delete some variables and learn. /help $readini /help $read /help /write /help /writeini /help hashtables /help Local Variables
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 196
Vogon poet
|
OP
Vogon poet
Joined: Dec 2002
Posts: 196 |
How about those information I need to get access quickly. I know hash tables are a nice alternative, but I can't access them as quickly as mIRC Script Editor>Variables.
|
|
|
|
Joined: Dec 2002
Posts: 196
Vogon poet
|
OP
Vogon poet
Joined: Dec 2002
Posts: 196 |
Do what mIRC does and leave only the first one.
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
hash table managers arent hard to make. /help $hget /help dialogs
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
There's no functional reason as such that I can see why mIRC couldn't have multiple variable files, but the question becomes 'why would you need them?'. You're at 9.3k right now, has variable storage/retrieval become buggy? Which file would variables be assigned to? Even if the standard ini file storage has limitations (there used to be a 64k limit, not sure if that's still true), you don't need to store them in an ini. My variables are all stored in a separate .mrc file by themself and I'm reasonably sure mIRC wouldn't impose a limitation on that.
But do you really need 9.3k of variables? Global variables are the 'messiest' means of storage available. In another post here you mentioned your script was made of many modules, using a global variable for modules could quite easily lead to variable 'contamination' where two modules use the same variable name. You might find it more manageable if you grouped your data into hash tables - there's no meaningful performance difference for most things, it lessens the chance of name clashes between modules, and it can provide added functionality for certain types of data ($hfind()).
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Quite frankly I'm still baffled by the sheer amount of variables - what possible reason could you have for so many. I run a bot, full protection scripts, the works, and it has less than 20 permanent variables, everything else is local.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Well he said the file was 9.3KB, so that could easily work out to about 50 variables at around 190 characters each. Even 9300 variables is entirely possible if someone used global variables for everything. For example an MP3 player script which stored a playlist in global variables could take up hundreds or thousands of variables in itself, or a bot that calculated detailed channel statistics at runtime could quite easily reach those sorts of figures. Of course both those things would make a lot more sense as hash tables. Personally I have only 2 global variables, and that's only because the code that uses them was written back when I first learned to script and I haven't bothered to update it.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Both those things would also make a lot more sense NOT store in variables.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
|