|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
how can i $readini and put whole list (that is in ini under some section) in notice or msg chan ?
coz i have
blacklist.ini [blackmark]
*!*addres1 *!*addres2
etc... crap is that i dont want to define item (1) but to read ALL items
is that even possible ?
Last edited by raZOR; 04/04/06 12:02 AM.
IceCapped
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
look at using $ini some test
alias getblackmark {
var %itemcount $ini(blacklist.ini, blackmark,0)
var %i = 1
while (%i <= %itemcount) {
echo -a $ini(blacklist.ini, blackmark,%i)
var %getitem = $ini(blacklist.ini, blackmark,%i)
echo -a $READINI(blacklist,blackmark,%getitem,%i)
inc %i
}
} Comment: I didnt test this
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
it reads 1st line and get error for this line: echo -a $READINI(blacklist,blackmark,%getitem,%i)
IceCapped
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
alias iniread {
; Syntax: /iniread <#chan> <section> <path\file>
if ($1 !ischan) echo -ac info * You're not on $+($1,.)
elseif (!$isfile($3-)) echo -ac info * File doesn't exist. $+($chr(40),$3-,$chr(41))
elseif (!$ini($3-,$2)) echo -ac info * Section $+(,$2,) does not exist. $+($chr(40),$3-,$chr(41))
else {
var %i = 1
while ($ini($3-,$2,%i) != $null) {
.timer 1 %i msg $1 $readini($3-,$2,$v1)
inc %i
}
}
} alias iniread { ; Syntax: /iniread <#chan> <section> <path\file> if ($1 !ischan) echo -ac info * You're not on $+($1,.) elseif (!$isfile($3-)) echo -ac info * File doesn't exist. $+($chr(40),$3-,$chr(41)) elseif (!$ini($3-,$2)) echo -ac info * Section $+(,$2,) does not exist. $+($chr(40),$3-,$chr(41)) else { var %i = 1 while ($ini($3-,$2,%i) != $null) { .timer 1 %i msg $1 $readini($3-,$2,$v1) inc %i } } }
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
ehm, it says file doesnt exist altho it does :P
* File doesn't exist. ()
i tried
//iniread blackmark $scriptdir\blacklist.ini and //iniread blackmark blacklist.ini
Last edited by raZOR; 04/04/06 12:50 AM.
IceCapped
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
If it's not in the mIRC directory you need to supply the path.
Try: /iniread <#chan> blackmark blacklist.ini
Supply the path if it's not in your mIRC folder.
Last edited by mIRCManiac; 04/04/06 12:52 AM.
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
edited =)
i think $scriptdir should do altho file is in main mirc folder
IceCapped
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
Or that too.
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
no hard feelings i removed #chan thigs coz i want notice but for start i only gave ECHO
alias iniread {
; Syntax: /iniread <section> <path\file>
if (!$isfile($3-)) echo -ac info * File doesn't exist. $+($chr(40),$3-,$chr(41))
elseif (!$ini($3-,$2)) echo -ac info * Section $+(,$2,) does not exist. $+($chr(40),$3-,$chr(41))
else
var %i = 1
while ($ini($3-,$2,%i) != $null) {
.echo -a $readini($3-,$2,$v1)
inc %i
}
}
and as stated above it wont work
IceCapped
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
Hey that's quite alright, do whatever you want with it alias iniread {
; Syntax: /iniread <section> <path\file>
if (!$isfile($2-)) echo -ac info * File doesn't exist. $+($chr(40),$2-,$chr(41))
elseif (!$ini($[color:red]2[/color]-,$1)) echo -ac info * Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41))
else {
var %i = 1
while ($ini($2-,$1,%i) != $null) {
echo -a $readini($2-,$1,$v1)
inc %i
}
}
} alias iniread { ; Syntax: /iniread <section> <path\file> if (!$isfile($2-)) echo -ac info * File doesn't exist. $+($chr(40),$2-,$chr(41)) elseif (!$ini($ 2-,$1)) echo -ac info * Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41)) else { var %i = 1 while ($ini($2-,$1,%i) != $null) { echo -a $readini($2-,$1,$v1) inc %i } } } ~ Edit ~
Sorry, change the part in red.
Last edited by mIRCManiac; 04/04/06 01:10 AM.
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
* Section blackmark does not exist. (D:\mirc\blacklist.ini)
and yet it does exist :P
proof:
[blackmark]
*!*@im.so.[censored].pro.vg=1 *!*@c-2d7c70d5.03-86-6b6c6d1.cust.bredbandsbolaget.se=1
Last edited by raZOR; 04/04/06 01:09 AM.
IceCapped
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
now it only reads
1 1
where ini is:
[blackmark]
*!*@im.so.[censored].pro.vg=1 *!*@c-2d7c70d5.03-86-6b6c6d1.cust.bredbandsbolaget.se=1
IceCapped
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
argh
Remove the $readini
alias iniread { ; Syntax: /iniread <section> <path\file> if (!$isfile($2-)) echo -ac info * File doesn't exist. $+($chr(40),$2-,$chr(41)) elseif (!$ini($2-,$1)) echo -ac info * Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41)) else { var %i = 1 while ($ini($2-,$1,%i) != $null) { echo -a $v1 inc %i } } }
/exit
Last edited by mIRCManiac; 04/04/06 01:37 AM.
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
woohooo it works !!!! thank you thank you ! -> sorry for long time reply (i had to sleep) :P
IceCapped
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
it reads 1st line and get error for this line: echo -a $READINI(blacklist,blackmark,%getitem,%i) alias getblackmark { var %itemcount $ini(blacklist.ini, blackmark,0) var %i = 1 while (%i <= %itemcount) { echo -a $ini(blacklist.ini, blackmark,%i) var %getitem = $ini(blacklist.ini, blackmark,%i) echo -a $READINI(blacklist,blackmark,%getitem) inc %i } } sorry, Im a bit rusty but i think that will work
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
now it only reads 1 1 where ini is: [blackmark] *!*@im.so.[censored].pro.vg=1 *!*@c-2d7c70d5.03-86-6b6c6d1.cust.bredbandsbolaget.se=1 you can use the $ini to help you write the ini so the address is the data, rather than the item you just need to have a var %itemcount $ini(blacklist.ini,blackmark,0) + $ctime so when you write it writeini blacklist.ini blackmark %itemcount (address info) so in the ini it would look like [blackmark] 11144177152=nick!user@host 21144177377=nick!user@host2 so on
|
|
|
|
|