mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
Can it really be true that there is no way that mirc can fetch multiply nicks in an OP/DEOP/VOICE/DEVOICE etc event?

I tried the following:

Command: = //mode # -oo nick1 nick2
Code: = on @*:deOP:#: { echo -a $1- }
Result : -o nick1

Command: = //mode # -oo nick1 nick2
Code: = on @*:deOP:#: { echo -a $mode(1).deop $mode(2).deop }
Result : nick1

I find no way to fetch $3 in these events...

If none can come up with a very simple answer, I would say its a future mIRC feature....



Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
If you look more carefully, you should see two lines echoed, one for each nick. Anyway, the on RAWMODE event is designed for exactly what you want. Type /help on rawmode or /help on op and scroll down. The $mode() identifier also makes sense and is really useful only inside the on rawmode event.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
In addition to qwerty's post, you may also want to have this little snipplet. It takes a mode change such as:

+oo-v+n KingTomato qwerty Jesper

and turnes it into something managable such as:

+o:KingTomato +o:qwerty -v:Jesper +n

Basically, you can then use $wildtok and look for your mode change like

Code:
var %modes = +o:KingTomato +o:qwerty -v:Jesper +n, %m = 1, %nicks
while ($wildtok(%modes, +o:*, %m, 32)) {
  %nicks = %nicks $gettok($ifmatch, 2, $asc(:))
  /inc %m
}


That would return %nicks = KingTomato qwerty

Code:
alias parsemode {
  /set -u0 %param 2
  /set -u0 %m 1
  while (%m <= $len($gettok($1, 1, 32))) {
    /set -u0 %chr $mid($gettok($1, 1, 32), %m, 1)
    if (%chr isin +-) { /set -u0 %mod %chr }
    else {
      if ((%chr isincs $remove($gettok($chanmodes,1-3,44),$chr(44))) || (%chr isincs qaohv)) {
        /set -u0 %modes $addtok(%modes, $+(%mod,%chr,:,$gettok($1, %param, 32)), 32)
        /inc -u0 %param
      }
      else { /set -u0 %modes $addtok(%modes, $+(%mod,%chr), 32) }
    }
    /inc -u0 %m
  }
  return %modes
}


-KingTomato
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
If I look carefully I would see 2 lines 1 for each nick..... well then mirc just forgets to echo the second line :P cause it only echos 1 frown

Interesting script KingTomato, but not quite 'simple' for everyone to understand. smile

Further more, I actually mistyped in the original post.

on @*:deOP:#Jesper: { echo -a $1- }
When 1 user is being deop'ed the mirc echos "-o nickname"
when 2 users is being deop'ed mirc echos nothing.

and its the same for "on @1:RAWMODE:#Jesper: { echo -a $1- }"

Ok I got it to echo both nicks now, by using:
Code:
on @*:deOP:#Jesper: { 
  echo -a $mode(0).deop
  ;returns the number of opped nicks
  echo -a $mode(1).deop
  ;returns the first deopped nick
  echo -a $mode(2).deop
  ;returns the 2nd deopped nick
}


but it echos twice, like its looping.. any ideas?
and why wont it work with "echo -a $mode(1).deop $mode(2).deop" ?

****LAST EDIT****
I suddenly just got it to work, except for the double ech, any ideas? smile
Thanks for the inputs smile

Last edited by Jesper; 12/07/03 11:03 PM.
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
hmm it seems only to work if it is myself that does the -o'ing frown

Nick1 has the code, and nick2 does the -oo and its not triggered, however if nick1 does -oo then it is...


Code:
on @*:deOP:#: {
  echo -a starting script
  echo -a using /set %var while testing 
  set %deopnicks $mode(1).deop $mode(2).deop $mode(3).deop $mode(4).deop $mode(5).deop $mode(6).deop
  echo -a is variable set? can you see it here: %deopnicks
  echo -a asking if nick1 & nick2 is in the variable
  if (nick1 isin %deopnicks) && (nick2 isin %deopnicks) { insert command here }
  echo -a was they both shown ?
}


any ideas ?
and before you you say use ON RAWMODE, i tried that alleady wink and its the same... script is not triggered if it wasnt myself that did the -oo'ing frown


Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
The reason the on DEOP doesn't trigger is the @ prefix, which I didn't notice at first. When you deop yourself, you're no longer an op, so the event won't trigger if it has the @ prefix.

Did you try on RAWMODE with the @ too? If yes, remove it and test it again, it should work.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
yeps it works now, many thanks qwer smile


Link Copied to Clipboard