Admin/ircop user lister

By napa182 on May 03, 2008

Ok what this does is lists the users and ip's on the server you admin or ircop at. just another way to help run ur server and know who's on. You have to be admin or ircop to use this. this is also made for ircd servers. Copy/paste into a new remote. To open right click in a channel of in ur menubar..

il still be upgrading this every so often, but for now enjoy..

dialog lus {
  title "List Users On Server"
  size -1 -1 132 127
  option dbu
  box "User List", 1, 2 2 58 63
  list 2, 4 11 54 51, size
  box "User's IP", 3, 62 2 68 63
  list 4, 65 11 63 51, size
  box "Functions", 5, 2 83 128 42
  button "Kill", 6, 4 91 40 10, flat
  button "Zline", 7, 46 91 40 10, flat
  button "Notice", 8, 88 91 40 10, flat
  button "Clipboard", 9, 46 102 40 10, flat
  button "Refresh", 10, 88 102 40 10, flat
  text "", 11, 4 73 54 7, center
  box "User Count", 12, 2 65 58 17
  box "Date/Time", 13, 62 65 68 17
  text "", 14, 65 73 63 7, center
  button "List Chan", 15, 4 102 40 10, flat
  button "IP Info", 16, 4 113 124 10, flat
}
dialog lus1 {
  title "IP"
  size -1 -1 131 98
  option dbu
  box "IP Info", 1, 2 2 127 94
  text "IP Address:", 2, 4 24 29 8
  edit "", 3, 46 24 81 9, read autohs center
  text "City:", 4, 4 36 13 8
  edit "", 5, 46 36 81 9, read autohs center
  text "State or Region:", 6, 4 48 41 8
  edit "", 7, 46 48 81 9, read autohs center
  text "Country:", 8, 4 60 23 8
  edit "", 9, 46 60 81 9, read autohs center
  text "ISP:", 10, 4 73 11 8
  edit "", 11, 46 73 81 9, read autohs center
  button "Clipboard", 12, 4 84 61 10, flat
  button "Close", 13, 66 84 61 10, flat cancel
  text "User Nick:", 14, 4 12 25 8
  edit "", 15, 46 12 81 9, read autohs center
}
dialog lus2 {
  title "ChanList"
  size -1 -1 79 117
  option dbu
  box "Channel's User Is On", 1, 2 2 75 113
  list 2, 4 11 71 39, size
  button "Close", 3, 4 59 35 10, flat cancel
  text "Text Label", 4, 4 51 70 7, center
  button "Join Chan", 5, 40 59 35 10, flat
  button "Kick", 6, 4 70 35 10, flat
  button "Ban", 7, 40 70 35 10, flat
  button "+/- q", 8, 4 81 35 10, flat
  button "+/- a", 9, 40 81 35 10, flat
  button "+/- o", 10, 4 92 35 10, flat
  button "+/- h", 11, 40 92 35 10, flat
  button "+/- v", 12, 4 103 35 10, flat
  button "Insult Ban", 13, 40 103 35 10, flat
}
on *:load: { 
  echo 12 -a You Have Just Loaded Napa182's User Lister
  echo 12 -a A Script0rs Inc. Production 
  echo -a 14,1(14,1¯15,1¯0,1¯0,1º $+($chr(171),$chr(164),$chr(88),$chr(167),$chr(199),$chr(174),$chr(238),$chr(254),$chr(116),$chr(48),$chr(174),$chr(167),$chr(88),$chr(164),$chr(187)) º0,1¯15,1¯14,1¯) $+ $chr(153) 
}
on *:snotice:*connecting*:{ if ($dialog(lus)) { did -r lus 2,4,11 | did -b lus 6-9,15,16 | trace } }
on *:quit:{ if ($dialog(lus)) { did -r lus 2,4,11 | did -b lus 6-9,15,16 | trace } }
alias -l lus { $iif($count($usermode,N,O,C,A,a,o),dialog $iif($dialog(lus),-v,-md lus) lus,noop $input(You Need To Be IRCOP Or Admin To Use This Script,uho,Error)) }
alias -l lus1 { dialog $iif($dialog(lus1),-v,-md lus1) lus1 }
alias -l lus2 { dialog $iif($dialog(lus2),-v,-md) lus2 lus2 }
alias -l lus3 { whois $did(lus,2).seltext | did -r lus2 2,4 | did -a lus2 4 User: $did(lus,2).seltext | did -b lus2 5-13 }
alias -l lus4 { return $remove($did(lus2,2).seltext,&,+,%,@,~,!,?) }
alias -l lus5 { return $did(lus,2).seltext }
alias -l lusdatetime { did -ra lus 14 $time(mmm ddd d h:nn:ss tt) }
menu menubar,channel {
  .User Lister:{ lus }
}
on *:dialog:lus:close:0:{ .timerlusdatetime off  }
on *:dialog:lus:init:0:{ did -b lus 6-9,15,16 | did -a lus 14 $time(mmm ddd d h:nn:ss tt) | if ($timer(lusdatetime)) { haltdef } | else { .timerlusdatetime 0 1 lusdatetime } | trace }
on *:dialog:lus:sclick:*: { if ($did == 2) || ($did == 4) { did -c lus 2,4 $did(lus,$did).sel | did -e lus 6-9,15,16 | if ($dialog(lus2)) { dialog -x lus2 lus2 } }
  if ($did = 6) { if ($input(Are You Sure You Want To Kill User $did(2).seltext,uqy,Kill User $did(2).seltext $+ ?)) { kill $did(2).seltext Killed } }
  if ($did = 7) { if ($input(Are You Sure You Want To Zline User $did(2).seltext,uqy,Zline User $did(2).seltext $+ ?)) { Gzline *@ $+ $did(4).seltext 0 Zlined! } }
  if ($did = 8) { var %lusnotice $input(Enter Notice To Send To $did(2).seltext,uiye,Send Notice) | if (%lusnotice) { .Notice $did(2).seltext %lusnotice | noop $input(Notice Has Been Sent To $did(2).seltext,uio,Notice Sent) } }
  if ($did = 9) { clipboard $did(2).seltext $did(4).seltext }
  if ($did = 10) { did -r lus 2,4,11 | did -b lus 6-9,15,16 | trace | if ($dialog(lus2)) dialog -x lus2 | if ($dialog(lus1)) dialog -x lus1 }
  if ($did = 15) { $lus2 | $lus3 }
  if ($did = 16) { $lus1 | if ($sock(iplookup)) .sockclose iplookup | sockopen iplookup www.melissadata.com 80 | sockmark iplookup $did(4).seltext }
}
on *:dialog:lus2:init:0:{ did -b $dname 5-13 }
on *:dialog:lus2:sclick:*: { 
  if ($did = 2) { did -e $dname 5-13 }
  if ($did = 5) { 
    if (!$did(2).seltext) { 
    noop $input(Please Highlite A Channel To Join,uho,Error) } 
    else { join $lus4 } 
  } 
  if ($did = 6) { kick $lus4 $lus5 Cya | $lus3 }
  if ($did = 7) { ban -ku30 $lus4 $lus5 2 30 second ban | $lus3 }
  if ($did = 8) { .os mode $lus4 $iif($left($nick($lus4,$lus5).pnick,1) = ~,-q,+q) $lus5 | $lus3 }
  if ($did = 9) { .os mode $lus4 $iif($left($nick($lus4,$lus5).pnick,1) = &,-a,+a) $lus5 | $lus3 }
  if ($did = 10) { .os mode $lus4 $iif($left($nick($lus4,$lus5).pnick,1) = @,-o,+o) $lus5 | $lus3 }
  if ($did = 11) { .os mode $lus4 $iif($left($nick($lus4,$lus5).pnick,1) = %,-h,+h) $lus5 | $lus3 }
  if ($did = 12) { .os mode $lus4 $iif($left($nick($lus4,$lus5).pnick,1) = +,-v,+v) $lus5 | $lus3 }
  if ($did = 13) { if ($sock(baninsult)) sockclose baninsult | .sockopen baninsult www.randominsults.net 80 | sockmark baninsult $lus4 $lus5 2 }
}
on *:dialog:lus1:sclick:12: { clipboard 04Nick:09 $did(15) 04IP Address:09 $did(3) 04City:09 $did(5) 04State or Region:09 $did(7) 04Country:09 $did(9) 04ISP:09 $did(11)  }
raw *:*: {
  if ($dialog(lus)) {
    if ($istok(311 379 307 312 335 317 318 206 310 313 301,$numeric,32)) { haltdef }
    elseif ($istok(205 204,$numeric,32)) { did -a lus 2 $4 | whois $4 | haltdef }
    elseif ($numeric = 209 && $3 = clients) { did -a lus 11 $4 User's Online | haltdef } 
    elseif ($numeric = 378 && $dialog(lus2)) { haltdef }
    elseif ($numeric = 378) { did -a lus 4 $7 | haltdef }
    elseif ($dialog(lus2) && $numeric = 319) { didtok lus2 2 32 $3- | haltdef }
    else { haltdef }
  }
}
on *:sockopen:iplookup: { 
  sockwrite -nt $sockname GET $+(/lookups/iplocation.asp?ipaddress=,$sock(iplookup).mark) HTTP/1.1 
  sockwrite -nt $sockname Host: $+(www.melissadata.com,$str($crlf,2))
}
on *:sockread:iplookup: {
  var %ip | sockread %ip
  if ($regex(%ip,/IP Address<\/td><td><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 3 $regml(1) }
  if ($regex(%ip,/City<\/td><td><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 5 $regml(1) }
  if ($regex(%ip,/State or Region<\/td><td><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 7 $regml(1) }
  if ($regex(%ip,/Country<\/td><td><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 9 $regml(1) }
  if ($regex(%ip,/ISP<\/td><td><b>(.+)&nbsp;<\/b><\/td><\/tr>/)) { did -ra lus1 11 $regml(1) | did -ra lus1 15 $did(lus,2).seltext | .sockclose iplookup }
}
on *:sockopen:baninsult: { 
  sockwrite -nt $sockname GET / HTTP/1.1 
  sockwrite -nt $sockname Host: $+(www.randominsults.net,$str($crlf,2))
}
on *:sockread:baninsult: {
  var %baninsult | sockread %baninsult
  if ($regex(%baninsult,/<i>(.+)<\/i>/)) { ban -k $sock(baninsult).mark $regml(1) | .sockclose baninsult | $lus3 } 
}

Comments

Sign in to comment.
horstefan   -  Dec 11, 2012

use this to get iplookup working again:

on *:sockread:iplookup: {
  var %ip | sockread %ip
  if ($regex(%ip,/IP Address<\/td><td align='left'><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 3 $regml(1) }
  if ($regex(%ip,/City<\/td><td align='left'><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 5 $regml(1) }
  if ($regex(%ip,/State or Region<\/td><td align='left'><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 7 $regml(1) }
  if ($regex(%ip,/Country<\/td><td align='left'><b>(.+)<\/b><\/td><\/tr>/)) { did -ra lus1 9 $regml(1) }
  if ($regex(%ip,/ISP<\/td><td align='left'><b>(.+) <\/b><\/td><\/tr>/)) { did -ra lus1 11 $regml(1) | did -ra lus1 15 $did(lus,2).seltext | .sockclose iplookup }
}
 Respond  
Jethro   -  Sep 11, 2011

jaytea, to level with you, I haven't had the pleasure in using the $usermode. I presumed that it could well be triggered if you had any of those modes set at the same time...or one single mode at a time. I'm uncertain.

In regex, as I've learned that, with square brackets, the regex will search for exactly one character, no matter how many characters are in between these brackets. That, I believe, will make the regex example I show above the same as the $istokcs() version.

 Respond  
jaytea   -  Sep 11, 2011
$iif($regex($usermode,/[NOCAao]/),User Lister)

this is exactly the same as the $countcs() version, which is correct.

$iif($istokcs(N O C A a o,$usermode,32),User Lister)

this is completely different and incorrect.

 Respond  
yelow79   -  Sep 11, 2011

lol good catch Jethro, Yes I did make a typo. I haven't used regex or istok very much so I don't often think of them. very good point tho, I like the suggestion.

I have a working global system for this. it's kinda ugly atm
I changed

on *:snotice:*connecting*:{ if ($dialog(lus)) { did -r lus 2,4,11 | did -b lus 6-9,15,16 | trace } } 

to

on *:snotice:*connecting*:{ if ($dialog(lus)) { did -r lus 2,4,11 | did -b lus 6-9,15,16 | trace socrates.misfits-irc.net | trace hercules.misfits-irc.net } }

I didn't honestly think this would work but it works very well.
Note that my network is very small with only two leafs, I would imagine many more would cause problems. Also note that not just that line needed to be changed, every line that executed the trace command had to changed

 Respond  
Jethro   -  Sep 11, 2011

yelow79, you made a typo. It's $iif , not $iff

I'd not use $countcs() though if I were you, 'cause it functions pretty much like isincs.

Use $regex() or $istokcs()

$iif($istokcs(N O C A a o,$usermode,32),User Lister)
$iif($regex($usermode,/[NOCAao]/),User Lister)
 Respond  
yelow79   -  Sep 11, 2011

Okay this is above my head. I thought I would be able to figure it out but it's not happening fast enough for me. Can someone help me fix this so that it looks for users on the whole network instead of just on the local server? Thanks.

I have one suggestion as well. I would put the check for usermode like this

menu status,channel {
  $iff($countcs($usermode,N,O,C,A,a,o),User Lister):{ lus }
}

I also changed the menubar to status to make it more usable for those who connect to multiple networks at once.
My reasoning for this is that this way the option will only show up in the popup if they have the correct modes. Keeps the popups more tidy

 Respond  
Jethro   -  Sep 07, 2011

Dani, actually it ain't napa's fault. Ask Hawkee why it happened. This question had been asked before.

 Respond  
Dani_l11   -  Sep 07, 2011

napa why you break hawkee's layout?

 Respond  
yelow79   -  Sep 07, 2011

Fantastic script napa. I will be editing it to fit my own personal needs (whole network instead of just single server, for global ops)

 Respond  
Eugenio   -  Sep 10, 2008

/me rolls

 Respond  
napa182   -  Sep 10, 2008

well like i said on the server i didnt test the kill nore the kline and as for the other part if you want it like that then do it ur self and this script is not ment to keep the dialog open ffs

 Respond  
Eugenio   -  Sep 10, 2008

Also when it asks you if your sure you want to kill/kline ask for a reason.
apart from that I love this code and think Dans ideas are really good ;o (yes its a first ;x)
thanks steve

 Respond  
EL   -  Sep 10, 2008

Couple of things steve on the CS code redo.Your missing a ) bracket on line 54 and 55 wich wont allow the kill and k-line to fire.Also when it updates wen a user quits or connects he whole dialog refreshes i d opt to just have the lists them sleves refresh so you dont have like say on a high traffic server/network the damn dialog popin up every 20 secs or what ever also maybe add a $input box for a optional reason for both the kill and k-line and maybe even a option for a timed banns.Also like to see an addition for removing k-lines;p and even addin shuns,other then thats its all peachy ^_^.`-.-´

:EDit:: maybe evena blacklist option ;p

 Respond  
EL   -  Sep 10, 2008

O_O''

 Respond  
Calliope   -  Sep 10, 2008

this is gonna come in handy eh
lol and EW @ poppet fluttering his lashes at you for a script ;\ imma test this out now all i need are some victims...oh EL dahlin...

 Respond  
RaGnar   -  Sep 09, 2008

Hello, im a oper on Galaxynet, is it possible to do so for the network im in? a dumb qnt though. nice one.

 Respond  
TheWhistler   -  Sep 09, 2008

looks good to me and i'm a NetAdmin, havent tried it out but it works ok for now

 Respond  
Eugenio   -  Sep 09, 2008

Thanks Steve
/me rates 9 ;o

 Respond  
napa182   -  Sep 09, 2008

ok here it is for chatspace

dialog lus {
  title "List Users On Server"
  size -1 -1 132 116
  option dbu
  box "User List", 1, 2 2 58 63
  list 2, 4 11 54 51, size vsbar
  box "User's IP", 3, 62 2 68 63
  list 4, 65 11 63 51, size vsbar
  box "Functions", 5, 2 83 128 31
  button "Kill", 6, 4 91 40 10, flat
  button "K-line", 7, 46 91 40 10, flat
  button "Notice", 8, 88 91 40 10, flat
  button "Clipboard", 9, 46 102 40 10, flat
  button "Refresh", 10, 88 102 40 10, flat
  text "", 11, 4 73 54 7, center
  box "User Count", 12, 2 65 58 17
  box "Date/Time", 13, 62 65 68 17
  text "", 14, 65 73 63 7, center
  button "List Chan", 15, 4 102 40 10, flat
}
dialog lus2 {
  title "ChanList"
  size -1 -1 79 73
  option dbu
  box "Channel's User Is On", 1, 2 2 75 69
  list 2, 4 11 71 39, size vsbar
  button "Close", 3, 4 59 35 10, flat cancel
  text "", 4, 4 51 70 7, center
  button "Join Chan", 5, 40 59 35 10, flat
}
on *:load: { 
  echo 12 -a You Have Just Loaded Napa182's User Lister
  echo 12 -a A Script0rs Inc. Production 
  echo -a 14,1(14,1¯15,1¯0,1¯0,1º $+($chr(171),$chr(164),$chr(88),$chr(167),$chr(199),$chr(174),$chr(238),$chr(254),$chr(116),$chr(48),$chr(174),$chr(167),$chr(88),$chr(164),$chr(187)) º0,1¯15,1¯14,1¯) $+ $chr(153)
}
alias lus { $iif($countcs($usermode,N,O,C,A,a,o),dialog $iif($dialog(lus),-v,-md) lus lus,noop $input(You Need To Be IRCOP Or Admin To Use This Script,uho,Error)) }
alias lus2 { dialog $iif($dialog(lus2),-v,-md) lus2 lus2 }
menu menubar,channel {
  .User Lister:{ lus }
}
alias lusdatetime { did -ra lus 14 $time(mmm ddd d h:nn:ss tt) }
on *:dialog:lus:close:0:{ .timerlusdatetime off  }
on *:dialog:lus:init:0:{ did -b lus 6-9,15 | did -a lus 14 $time(mmm ddd d h:nn:ss tt) | if ($timer(lusdatetime)) { haltdef } | else { .timerlusdatetime 0 1 lusdatetime } | trace | lusers }
on *:dialog:lus:sclick:*: { if ($did == 2) || ($did == 4) { did -c lus 2,4 $did(lus,$did).sel | did -e lus 6-9,15 | if ($dialog(lus2)) { dialog -x lus2 lus2 } }
  if ($did == 6) { if ($input(Are You Sure You Want To Kill User $did(2).seltext,uqy,Kill User?)) { kill $did(2).seltext Killed  } }
  if ($did == 7) { if ($input(Are You Sure You Want To K-line User $did(2).seltext,uqy,K-line User?)) { Kline $+(*,$did(4).seltext) 0 K-lined Bitch! } }
  if ($did == 8) { var %lusnotice $input(Enter Notice To Send To $did(2).seltext,uiye,Send Notice) | if (%lusnotice) { .Notice $did(2).seltext %lusnotice | noop $input(Notice Has Been Sent To $did(2).seltext,uio,Notice Sent) } }
  if ($did == 9) { clipboard $did(2).seltext $did(4).seltext }
  if ($did == 10) { did -r lus 2,4,11 | did -b lus 6-9,15 | trace | lusers | if ($dialog(lus2)) { dialog -x lus2 lus2 } }
  if ($did == 15) { lus2 | whois $did(2).seltext | did -r lus2 2,4 | did -a lus2 4 User: $did(2).seltext }
}
on *:dialog:lus2:sclick:*: { 
  if ($did == 5) {
    if (!$did(2).seltext) { noop $input(Please Highlite A Channel To Join,uho,Error) }
    else { join $remove($did(2).seltext,&,+,%,@,~,!,?) }
  }
}
raw *:*: {
  if ($dialog(lus)) {
    if ($istok(311 379 307 312 335 317 318 206 310 313 301 251 252 254 265,$numeric,32)) { haltdef }
    if ($istok(205 204,$numeric,32)) { did -a lus 2 $remove($left($4,$pos($4,$chr(91),1)),$chr(91)) | did -a lus 4 $remove($mid($4,$calc($pos($4,@,1) + 0),$calc($len($4))),$chr(93)) | haltdef }
    if ($numeric == 255) { did -a lus 11 $4 User's Online | haltdef }
    if ($dialog(lus2)) && ($numeric == 319) { didtok lus2 2 32 $3- | haltdef }
  }
}
on *:snotice:*connecting*:{ if ($dialog(lus)) { did -r lus 2,4,11 | did -b lus 6-9,15 | trace | lusers } }
on *:quit:{ if ($dialog(lus)) { did -r lus 2,4,11 | did -b lus 6-9,15 | trace | lusers } }
 Respond  
Eugenio   -  Sep 09, 2008

thanks man

 Respond  
napa182   -  Sep 09, 2008

um i guess i can do that.

 Respond  
Eugenio   -  Sep 09, 2008

rofl @ chunkeh monkeh being IRCop, gawd halp that server
ffs
anyhow steve make me one for chatspace ffs
/me flutters eyelashes

 Respond  
ChunkieMonkey   -  Aug 24, 2008

Umm... EL... I'm an IRCop..... But nice script (obv)

 Respond  
napa182   -  May 07, 2008

well it wont auto open the dialog when people join, and it only updates if you have the dialog open, but i do get what you are saying.

 Respond  
Scakk   -  May 07, 2008

The only issue I have is that it resets the list every time a person joins the network on any server. Perhaps have a way to set it for just the server you are on. Another words only update list if the connect to the server you are on. Also may want to add a way to stop the updating if spam bots attack as that would make the dialog open and close repeatedly. Other than that pretty good.

 Respond  
EL   -  May 07, 2008

SEE I CARE even tho i cant use it cause im not aDMIN on a IrcD server ffs but this pwnz i dont have to test it lawl i can read the code these twat don\'t know wat good coding is they pass this up to test or there aren\'t aNy admin ircops on ircD servs around hawkee =/ what ever the case its still a good code ima rate it a TEN jp i cant yanno but its a 8 fo sho.`-.-´

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.