mIRC Home    About    Download    Register    News    Help

Print Thread
#72563 23/02/04 09:05 PM
Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2002
Posts: 174
How do i put these in 1 line so it has the auto op and auto voice etc on 1 line with a tick if it's on and no tick if it's off i have a code for channel modes but having trouble using the same way for control modes.

That's for the Channel Modes.

$iif(l isincs $gettok($chan(#).mode,1,32),$style(1)) Limit $chan(#).limit « l »: { mode # $iif(l isincs $gettok($chan(#).mode,1,32),-l,+l $$?="Set Size Limit") }

And trying to do the same way for these.

Control Menu
.Auto Op « %auto.op »
..$iif(%auto.op == on,$style(1)) On: { .aop on | set %auto.op On | echo -s 14Auto Op is now «9 On14 » }
..$iif(%auto.op == off,$style(1)) Off: { .aop off | set %auto.op Off | echo -s 14Auto Op is now «9 Off14 » }
.Auto Voice « %auto.voice »
..$iif(%auto.voice == on,$style(1)) On: { .avoice on | set %auto.voice On | echo -s 14Auto Voice is now «9 On14 » }
..$iif(%auto.voice == off,$style(1)) Off: { .avoice off | set %auto.voice Off | echo -s 14Auto Voice is now «9 Off14 » }
.Ignore « %ignore »
..$iif(%ignore == on,$style(1)) On: { .ignore on | set %ignore On | echo -s 14Ignore is now «9 On14 » }
..$iif(%ignore == off,$style(1)) Off: { .ignore off | set %ignore Off | echo -s 14Ignore is now «9 Off14 » }
.Notify « %notify »
..$iif(%notify == on,$style(1)) On: { .notify on | set %notify On | echo -s 14Notify is now «9 On14 » }
..$iif(%notify == off,$style(1)) Off: { .notify off | set %notify Off | echo -s 14Notify is now «9 Off14 » }
.Protect « %protect »
..$iif(%protect == on,$style(1)) On: { .protect on | set %protect On | echo -s 14Protect is now «9 On14 » }
..$iif(%protect == off,$style(1)) Off: { .protect off | set %protect Off | echo -s 14Protect is now «9 Off14 » }

I have the %var stuff in there for now, but hoping there is another way to still use the same format but without using the %var as i was hoping to remove them from my %var section if it's not needed.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Control Menu
Code:
.Auto Op 	« $iif($aop,On,Off) »
..$iif($aop,$style(1)) On: { .aop on | echo -s 14Auto Op is now «9 On14 » }
..$iif([b]![/b]$aop,$style(1)) Off: { .aop off | echo -s 14Auto Op is now «9 Off14 » }

You can do the rest the same using, $avoice/!$avoice, $ignore/!$ignore, $protect/!$protect.

The odd man out is "Notify" -- $iif($gettok($readini($mircini,options,n0),6,44),On,Off)
Code:
.Notify 	« $iif($gettok($readini($mircini,options,n0),6,44),On,Off) »
..$iif($gettok($readini($mircini,options,n0),6,44),$style(1)) On: { .notify on | echo -s 14Notify is now «9 On14 » }
..$iif(!$gettok($readini($mircini,options,n0),6,44),$style(1)) Off: { .notify off | echo -s 14Notify is now «9 Off14 » }

Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2002
Posts: 174
Nope that didn't seem to work, I was looking for something that is 1 liner, i can't do a tick on this to show you but will use an x instead

Control Menu
x Auto Op
x Auto Voice
Ignore
x Notify
x Protect

Something like that i was looking for so it cuts down allot of code similar to the Channel Modes part, the way you done the code was what i already had.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Ah OK I misunderstood you, do them like so...
Code:
.$iif($aop,$style(1)) Auto Op:.aop $iif($aop,off,on) | echo -s 14Auto Op is now «9 $iif($aop,on,off) 14 »

Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2002
Posts: 174
Cool that worked, how do i go about doing the notify part as same as that format too?

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Yeah, the same, but it will be easier to set a var to the $readini result.
Code:
.$iif($gettok($readini($mircini,options,n0),6,44),$style(1)) Notify:{ 
  var %a = $gettok($readini($mircini,options,n0),6,44) 
  .notify $iif(%a,off,on)  
  echo -s 14Notify is now «9 $iif(%a,off,on) 14 »  
}

The multi-line format is only for the forum. smile


Link Copied to Clipboard