mIRC Home    About    Download    Register    News    Help

Print Thread
#50805 23/09/03 03:41 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
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?


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#50806 23/09/03 04:36 AM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
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,.) }
#50807 23/09/03 04:41 AM
Joined: Aug 2003
Posts: 136
Vogon poet
Offline
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.
#50808 23/09/03 04:43 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
the variables will be called as normal, same as you have multiple script files.


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#50809 23/09/03 04:49 AM
Joined: Aug 2003
Posts: 136
Vogon poet
Offline
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.
#50810 23/09/03 08:30 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
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
#50811 23/09/03 10:32 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
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.



trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#50812 23/09/03 10:34 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
Do what mIRC does and leave only the first one.


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#50813 23/09/03 10:47 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
hash table managers arent hard to make.
/help $hget
/help dialogs


new username: tidy_trax
#50814 23/09/03 10:57 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
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.
#50815 23/09/03 02:44 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
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
#50816 23/09/03 03:53 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
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.
#50817 23/09/03 05:29 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
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

Link Copied to Clipboard