mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 30
M
mbot Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jan 2004
Posts: 30
Hey.

I'm messing with an autovoice script. I need to know how to include several parameters in the on join part. Meaning, instead of writing it like this:
Code:
on *:JOIN:#:{
  if ($chan = #channel1) { goto avoice }
  if ($chan = #channel2) { goto avoice }
  if ($chan = #channel3) { goto avoice }
  else { goto end }
  :avoice
  mode $chan +v $nick
  :end
}

Can I do something like this?
Code:
on *:JOIN:#:{
  if ($chan = $channel1) & ($chan = #channel2) & ($chan = #channel3) & ($nick != $me) $ ($me isop) { goto avoice }
  else { goto end }
  :avoice
  mode $chan +v $nick
  :end
}

Well, I've tried but for some reason it failed to work.
Second, I have some problems with a "dymanic" menu. The code bolow works fine. It's when I enter code similar to the one in the top problems begin.
Code:
menu menubar {
  .autoV is ( $+ $iif(%options.autoV, On, Off) $+ ) : {
    if (%options.autoV) { goto AVOFF }
    else { goto AVON }
    :AVON
    echo -a autoV is now enabled
    %options.autoV = $iif(%options.autoV, 0, 1)
    { goto END }
    :AVOFF
    echo -a autoV is now disabled
    %options.autoV = $iif(%options.autoV, 0, 1)
    { goto END }
    :END
  }

Any ideas how to combine them ?

Regards

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Code:
on !*:JOIN:#:{
  if ($chan == #channel1) || ($chan == #channel2) || ($chan == #channel3) && ($me isop $chan) mode $chan +v $nick
}

You should take a look at the if-then-else section of mIRC's helpfile (/help /if), specifically the subsections The operators and Combining comparisons. The code I've given uses the ! event prefix (/help Event prefixes) which prevents you from triggering the event yourself, which is why it doesn't check if $me == $nick.


For the second problem:
Code:
menu menubar {
  .autoV is ( $+ $iif(%options.autoV, On, Off) $+ ):{
    echo -a autoV is now $iif(%options.autoV, disabled, enabled)
    %options.autoV = $iif(%options.autoV, 0, 1)
  }
}

You might want to look into using groups (/help Groups) instead of a global variable.

Last edited by starbucks_mafia; 18/01/04 04:48 PM.

Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
mIRC also has built-in auto-voice system... /help /avoice

/avoice on
/avoice *!*@* #chan1,#chan2,#chan3


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Jan 2004
Posts: 30
M
mbot Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jan 2004
Posts: 30
Hey.

First to you theRat. Appreciate your reply but thought it would be fun to do one myself....and to find out if I could do it by myself (well, I couldn't as we know by now, .... happens smirk) but thanks anyway.
As goes for you, starbucks_mafia. You made my day. Been messing with how to combine them, and you basically told how. For what ever reason, besides the fact that I find it easier to modify, I chose a version similar to this:
Code:
menu menubar {
  .autoV is ( $+ $iif(%options.autoV, On, Off) $+ ) : {
    if (%options.autoV) { goto AVOFF }
    else { goto AVON }
    :AVON
    enable #VMODE
    echo -a autoV is now enabled
    %options.autoV = $iif(%options.autoV, 0, 1)
    { goto END }
    :AVOFF
    disable #VMODE
    echo -a autoV is now disabled
    %options.autoV = $iif(%options.autoV, 0, 1)
    { goto END }
    :END
  }
#VMODE on
on !*:JOIN:#:{
  if ($chan == #channel1) || ($chan == #channel2) || ($chan == #channel3) && ($me isop $chan) mode $chan +v $nick
}
#VMODE end

It may not be beautiful, but hey...i works.
I've noticed that mIRC in general displays that it has enabled/disabled the group like this: * Group(s) disabled, as it does when loading/unloading files, though I did not tell it to. Is there any way to avoid this? And if so...how?
Thanks to both of you.
Regards

Last edited by mbot; 18/01/04 09:13 PM.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Code:
menu menubar {
  .autoV is ( $+ $group(#VMODE) $+ ) :{
    if ($group(#VMODE) == on) {
      .disable #VMODE
      echo -a autoV is now disabled
    }
    else {
      .enable #VMODE
      echo -a autoV is now enabled
    }
  }
}
#VMODE on
on @*:JOIN:#channel1,#channel2,#channel3:mode # +v $nick
#VMODE end

Note the prefix dots -> .disable .enable <- these make the command "quiet"

on @*:JOIN:#channel1,#channel2,#channel3: <- only triggers if you are opped on any of those channels

$group(#groupname) returns "on" or "off"

Joined: Jan 2004
Posts: 30
M
mbot Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jan 2004
Posts: 30
Hey.

Thanks, the dots worked like a charm. grin

Regards


Link Copied to Clipboard