mIRC Home    About    Download    Register    News    Help

Print Thread
#91893 27/07/04 07:46 AM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2003
Posts: 92
i was wondering how do u make it write sumthing to an .ini . example when i type .add 1000 user it wud write in the ini
[levels]
1000= nick1, nick2,nick3

when i type .add 900 user it wud write in the ini
[levels]
900= nick1, nick2,nick3

wut i have only overwrites wuts there, any ideas? thanx


k1ll3rz
#91894 27/07/04 09:32 AM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
In order to prevent it overwriting you should retrieve the value of the current data first then include that in your writeini command, for example:

//writeini file.ini levels 1000 $addtok($readini(file.ini,levels,1000),newnick,44)

So that adds "newnick" to your levels section under item "1000". The $addtok ensures that there will be no repeated nicknames and will separate each nickname with a comma.

#91895 27/07/04 09:33 AM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Do you mean something like:

alias add {
writeini filename.ini levels $1 nick1,nick2,nick3

}



I don't know from where it gets nick 1, nick2 ....
If its from User that you enter with the command, then you could use $2-
You can seperate the users with spaces, and then use: $replace($2-,$chr(32),$chr(44)) to put "," instead of spaces.


Link Copied to Clipboard