mIRC Home    About    Download    Register    News    Help

Print Thread
#113025 28/02/05 03:40 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
I'm not getting there...........
I want a on/off switch for this:

on *:text:*:#:{
if $highlight($nick $1-) {
window -C @Highlights -1 -1 800 240
aline @Highlights $timestamp 4 $nick 12<3-6=7-4= 14noemde je in 12 $chan $+ 4=7-6=3-12> $1-
}

the only thing i know is to load and unload it but there have to be more ways to make on/ogg switch.
Please help me.

#113026 28/02/05 03:50 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
menu menubar {
  Highlight
  .On: { 
    .enable #highlight 
    echo -a Highlighting is now on.
  }
  .-
  .Off: {
    .disable #highlight 
    echo -a Highlighting is now off.
  }
}

#highlight off
on *:text:*:#:{
  if ($highlight($nick $1-)) {
    window -C @Highlights -1 -1 800 240
    aline @Highlights $timestamp 4 $nick 12&lt;3-6=7-4= 14noemde je in 12 $chan $+ 4=7-6=3-12&gt; $1-
  }
}
#highlight end

#113027 28/02/05 04:11 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
thank you very much SladeKraven.
you did the job.
seems i was thinking to hard .... lol

#113028 28/02/05 04:12 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome. smile

#113029 28/02/05 09:11 PM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i like variable switches better :P


The Kodokan will move you, one way or another.
#113030 28/02/05 09:25 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well, the difference with variable switches and #group switches is that you know they will definately either be on or off or $null if the group doesn't exist

I guess it has just kind of stuck with me. For instance marking a dialogs 3state checkbox as indeterminate.

set %switch yes
set %switch no
set %switch maybe

Where you can set as many switches with variables as you want. Whereas if it's a group has to be either on or off, it's a bit like a boolean; a boolean can either be true or false.

But, you should just stick to what you are most comfortable with.

Last edited by SladeKraven; 28/02/05 09:59 PM.
#113031 01/03/05 01:22 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
its really a matter of convience
if for whatever reason you want "sub" switches within a group variables the reason i tend to use %switches is that i was previously unaware of the fact that conflict could be allieviated by making seperate script files so i have this big crazy mash of code with like 5 ifs on one on join
so theyre the disorganized mans switch of choice


The Kodokan will move you, one way or another.
#113032 01/03/05 02:06 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Btw, there is an important difference between using a #group vs vars.

In the case of a group which is disabled, the event within the group is never triggered, whereas in the case of a var that is set to off, the remote is triggered and then there is a check for the value of the var, which then stops processing after it founds out the var is off.

It's like

on *!:JOIN:#: VS. on *:JOIN:#: if $nick != $me { }

Suppose you have 2 on joins in the same remote file (bit stupid example but anyway)

If the first one is enclosed in a disabled group, the second on join event will trigger since the first was ignored. However, if the first uses a var to check if it should process or not, it means it already triggered, so no matter what, whether the first on join event is on/off, the second will not trigger.

Greets


Gone.
#113033 01/03/05 01:00 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Not a bad example i thought.
I could see it in use in something like, the first on join might be for actions to be taken, but only when a certian BOT is present in the channel, the second on join trips when the bot arrives and enables the first one, which then stops the second one from working smile, the group the first one is in might also have a on part/exit of the bot that disables the group.

I personally love and hate stuff like this, Loved becuase its normally clever and seamless how it works, and hated becuase if your debugging it, you sit there and go, whys this one not working it should be going Damn whats going on with this second one?!?!?

#113034 01/03/05 01:37 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I agree with everything you said, hehe, sometimes you are like "what on earth is going wrong" and it's because of these little things. The bot example was good.


Gone.
#113035 02/03/05 02:40 AM
Joined: Dec 2002
Posts: 10
A
Pikka bird
Offline
Pikka bird
A
Joined: Dec 2002
Posts: 10
I use both #groups and %variables in my switches, mood choice

Highlight
.$iif($group(#highlight) == off,On?) { .enable #highlight | echo -s 11,02*** Highlight Is Now On $me  }
.$iif($group(#highlight) == on,Off?) { .disable #highlight | echo -s 11,02*** Hightlight Is Now Off $me  }
Highlight
.$iif(%highlight == off,On?) { set %highlight On | echo -s 11,02*** Highlight Is Now On $me  }
.$iif(%highlight == on,Off?) { set %highlight Off | echo -s 11,02*** Highlight Is Now Off $me  }


Link Copied to Clipboard