mIRC Home    About    Download    Register    News    Help

Print Thread
#110870 11/02/05 05:46 AM
Joined: Jul 2004
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
Hi all,
Code:
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 laugh

#110871 11/02/05 05:59 AM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
Code:
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.

#110872 11/02/05 06:14 AM
Joined: Jul 2004
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
yea, i misplaced the brackets frown

Thanks alot for the help and also the rapid reply nycdiesel smile

#110873 11/02/05 11:12 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You can do away with some haltdefs, and also one of the $readini calls.
Code:
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
}

#110874 11/02/05 03:19 PM
Joined: Jul 2004
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
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) smile

#110875 11/02/05 03:50 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You're very welcome laugh


Link Copied to Clipboard