mIRC Home    About    Download    Register    News    Help

Print Thread
#28084 04/06/03 12:32 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
what would be the best way to read/write from an .ini file?
I have a msg that i want to go to a couple channels instead of all channels i am on, so i am using something like /msg #chan1,#chan2 %msg_here. As of right now, i have them listed in my ini file as
[messages]
msgchans=#chan1,#chan2

but sometimes i am not on both channels at the same time, how can i get my script to determine if i am on a channel that is in msgchans and then send the message to that channel, cause i realy dont like getting the "Cant Send To Channel" thingy whenever i send a message.

Also, how do i Add/delete channels IF i keep it like i have it now?


hope this makes sense


thanks


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
#28085 04/06/03 12:51 PM
Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
to add more channel to the ini u can do
//writeini file.ini messages msgchans $addtok($readini(file.ini,messages,msgchans),#channel,44)
and delete
//writeini file.ini messages msgchans $remtok($readini(file.ini,messages,msgchans),#channel,44)
and what u want is:
//var %x = 1,%y = $readini(file.ini,messages,msgchans),%z = %y | while (%x <= $numtok(%y,44)) { if ($me !ison $gettok(%y,%x,44)) { %z = $remtok(%z,$gettok(%y,%x,32),44) } | inc %x } | if (%z) msg %z %msg_here




Last edited by ScatMan; 04/06/03 12:52 PM.

Link Copied to Clipboard