mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
ok, brief overview. i am trying to change this lil script to a op only tool. it logs the ip's of users and keeps keeps an eye on'em if(when) they change nicks.. ok i have it so the commands are locked to all but ops, but however there is a echp command that displays a msg to me stating that users ip loged with one or more additional nicks(and lists them all) when they join a room. but it does it for all levels, not just ops. is there a way to have this op specific also?
here's the script.
Code:
ON *:START: {
  hmake trackusers 10
  if ($isfile(trackusers.dat)) {
    hload trackusers trackusers.dat
  }
}
on *:JOIN:#: {
  if ($hget(trackusers,$address($nick,3))) {
    var %n = $ifmatch
    if ($istok(%n,$nick,32)) { var %d = $deltok(%n,$findtok(%n,$nick,1,32),32) }
    else { var %d = %n }
    if (!%d) { return }
     echo $colour(info) -ti2 $chan * $nick has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d 
    if (!$istok(%n,$nick,32)) {
      hadd trackusers $address($nick,3) %n $nick
    }
  }
  else {
    hadd trackusers $address($nick,3) $nick
  }
}
on *:NICK: {
  if ($hget(trackusers,$address($newnick,3))) {
    var %n = $ifmatch
    if (!$istok(%n,$newnick,32)) {
      hadd trackusers $address($newnick,3) %n $newnick
    }
  }
  else {
    hadd trackusers $address($nick,3) $newnick
  }
}
menu nicklist {
    $iif($me isop $chan,Nick Tracker)
    .Track Users
    ..View Other Nicknames 
    if (!$address($$1,3)) { echo $colour(info) -ti2 # * IAL not updated for $$1 $+ , performing userhost lookup | userhost $$1 | return }
    if ($hget(trackusers,$address($$1,3))) {
      var %n = $ifmatch
      if ($istok(%n,$$1,32)) { var %d = $deltok(%n,$findtok(%n,$$1,1,32),32) }
      else { var %d = %n }
      if (!%d) { goto notknown }
      echo $colour(info) -ti2 # * $$1 has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    }
    else {
      :notknown
      echo $colour(info) -ti2 # * $$1 has not been known by any other nickname
    }
  }
  .Reset:hdel trackusers $address($$1,3)
}
ON *:EXIT: {
  if ($hget(trackusers)) { hsave -o trackusers trackusers.dat }
}   


any help is appreciated.
thanks in advance

Joined: Feb 2004
Posts: 50
D
Babel fish
Offline
Babel fish
D
Joined: Feb 2004
Posts: 50
I'm not entirely sure what you mean here, but if you mean you only want this script to work when you are opped, then simply use the @ suffix for your events.

on @*:JOIN:#: { } for example, will only work if someone joins when you are opped.

Alternatively, if you want to continue updating your info even when you are not opped, but don't want the echo to show, simply use the same method you have in the nicklist popups, using if ($me isop $chan) { } etc.

Hope this helps.

Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
okay Ddan, thats exactly what i was looking for on both counts..

thanks so much!
grin

Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
i don't think i have this right.. here's what i have now:
Code:
 
ON *:START: {
  hmake trackusers 10
  if ($isfile(trackusers.dat)) {
    hload trackusers trackusers.dat
  }
}
on *:JOIN:#: {
  if ($hget(trackusers,$address($nick,3))) {
    var %n = $ifmatch
    if ($istok(%n,$nick,32)) { var %d = $deltok(%n,$findtok(%n,$nick,1,32),32) }
    else { var %d = %n }
    if (!%d) { return }
    [color:red]   if ($me isop $chan)  [/color]  { echo $colour(info) -ti2 $chan * $nick has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d 
    if (!$istok(%n,$nick,32)) {
      hadd trackusers $address($nick,3) %n $nick
    }
  }
  else {
    hadd trackusers $address($nick,3) $nick
  }
}
on *:NICK: {
  if ($hget(trackusers,$address($newnick,3))) {
    var %n = $ifmatch
    if (!$istok(%n,$newnick,32)) {
      hadd trackusers $address($newnick,3) %n $newnick
    }
  }
  else {
    hadd trackusers $address($nick,3) $newnick
  }
}
menu nicklist {
     [color:green] $iif($me isop $chan,Nick Tracker) [/color] 
    .Track Users
    ..View Other Nicknames 
    if (!$address($$1,3)) { echo $colour(info) -ti2 # * IAL not updated for $$1 $+ , performing userhost lookup | userhost $$1 | return }
    if ($hget(trackusers,$address($$1,3))) {
      var %n = $ifmatch
      if ($istok(%n,$$1,32)) { var %d = $deltok(%n,$findtok(%n,$$1,1,32),32) }
      else { var %d = %n }
      if (!%d) { goto notknown }
      echo $colour(info) -ti2 # * $$1 has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    }
    else {
      :notknown
      echo $colour(info) -ti2 # * $$1 has not been known by any other nickname
    }
  }
  .Reset:hdel trackusers $address($$1,3)
}
ON *:EXIT: {
  if ($hget(trackusers)) { hsave -o trackusers trackusers.dat }
}  


now i'm getting these errors:

VIEW Unknown command
-
ON Unknown command
-
MENU Unknown command
-
TRACK Unknown command

any ideas?
this is what i changed before with np
this is the new change

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
well, as a GUESS:

Code:
menu nicklist {
[color:green]$iif($me isop #,Nick Tracker)[/color] 
    .Track Users
[color:blue] ..View Other Nicknames[/color] [color:red]{[/color]
    if (!$address($$1,3)) { echo $colour(info) -ti2 # * IAL not updated for $$1 $+ , performing userhost lookup | userhost $$1 | return }
    if ($hget(trackusers,$address($$1,3))) {
      var %n = $ifmatch
      if ($istok(%n,$$1,32)) { var %d = $deltok(%n,$findtok(%n,$$1,1,32),32) }
      else { var %d = %n }
      if (!%d) { goto notknown }
      echo $colour(info) -ti2 # * $$1 has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    }
    else {
      :notknown
      echo $colour(info) -ti2 # * $$1 has not been known by any other nickname
    }
  }
  .Reset:hdel trackusers $address($$1,3)
}


Green is your newly added text with a slight change (and I DOUBT that would make it work but sometimes it can be weird). The BLUE is my question. It seems like there should be brackets of some kind (colored red) there (to me). Also, from the looks of it there COULD be a bracket mismatch going on cause I only see:

3 { (including the new one I put there) and 4 }


Those who fail history are doomed to repeat it
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
heh,
i found my problem(i think). a real dumb not paying attension thing.. i was trying to run it in .txt format instead of .ini or .mrc..

and i think your right about the bracket(s), i havn't tried it yet but will post to let ya know the outcome.

thanks landonsandor
smile



Link Copied to Clipboard