|
|
Joined: Jul 2004
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Jul 2004
Posts: 14 |
Hi all, ctcp ^*:time:?:{
if ($readini(system\data\master.ini,c2cp,time) == On ) {
if ($readini(system\data\master.ini,c2cp,option) == Current) {
.notice $nick $readini(system\data\master.ini,c2cp,message) | haltdef
}
if ($readini(system\data\master.ini,c2cp,option) == Random) {
.notice $nick $read(system\data\text\c2cp.txt) | haltdef
}
elseif ($readini(system\data\master.ini,c2cp,time) == Off ) { haltdef }
}
} If i turned the c2cp,time to On, everything works The problem is that if i turned c2cp,time to Off, it shouldnt suppose to send any time reply out... Any ideas ? all the values are correct, i know there is something wrong with the brackets or something... I tried checking it with mirc's script editor ({}) checker and it didnt detect any bracket error... Thanks in advance
|
|
|
|
Joined: Dec 2004
Posts: 81
Babel fish
|
Babel fish
Joined: Dec 2004
Posts: 81 |
ctcp ^*:time:?:{
if ($readini(system\data\master.ini,c2cp,time) == On) {
if ($readini(system\data\master.ini,c2cp,option) == Current) {
.notice $nick $readini(system\data\master.ini,c2cp,message)
haltdef
}
if ($readini(system\data\master.ini,c2cp,option) == Random) {
.notice $nick $read(system\data\text\c2cp.txt)
haltdef
}
}
elseif ($readini(system\data\master.ini,c2cp,time) == Off) { haltdef }
}
Try that. You have the brackets misplaced I think.
|
|
|
|
Joined: Jul 2004
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Jul 2004
Posts: 14 |
yea, i misplaced the brackets Thanks alot for the help and also the rapid reply nycdiesel
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You can do away with some haltdefs, and also one of the $readini calls. ctcp ^*:time:*:{
if ($readini(system\data\master.ini,c2cp,time) == On) {
if ($readini(system\data\master.ini,c2cp,option) == Current) {
.notice $nick $readini(system\data\master.ini,c2cp,message)
}
elseif ($v1 == Random) { .notice $nick $read(system\data\text\c2cp.txt) }
}
haltdef
}
|
|
|
|
Joined: Jul 2004
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Jul 2004
Posts: 14 |
Hi iori, I opened /help $v1 and founded out: if ($readini(system\data\master.ini,c2cp,time) $v1 = ($readini(system\data\master.ini,c2cp,time) Thanks alot iori for the shorter code and also for teaching me something new today ($v1)
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You're very welcome
|
|
|
|
|
|