Advertisement
IRCgo

Color Whois AdiIRC Script

Feb 27th, 2023
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.14 KB | None | 0 0
  1. ; http://dev.adiirc.com/boards/5/topics/170
  2. ; Colored Whois Script 1.0 by Amiga600
  3. ; Plus edition mod v0.1.8 by pereba
  4. ; Modifies the whole of the /WHOIS output, Re-arranges Channel Names
  5. ; in alphabetical order, and in order of rights level, eg ~&@%+
  6.  
  7. ; Colors Channels based on users rights
  8. ; eg. ~Purple &Yellow @Red %Green +Blue Modeless=Green
  9.  
  10. ; mIRC Colors: White0 Black1 DarkBlue2 DarkGreen3 LightRed4 DarkRed5
  11. ; Purple6 Brown7 Yellow8 LightGreen9 DarkCyan10 LightCyan11 LightBlue12
  12. ; LightPurple13 DarkGrey14 White15
  13.  
  14. ; Colors can be adjusted below to users preferences
  15. ; whoismain - Main color of the whois block (14=grey)
  16. ; whoisother - the extra data of the whois block (3=dark green)
  17.  
  18. ; ==== Config =====
  19.  
  20. ; colors explained above:
  21. alias -l whoismain return 14
  22. alias -l whoisother return 2
  23. alias -l ColorCloneScan return 7
  24. alias -l ColorCloneScanMatch return 6
  25. alias -l ColorTimeAgo return 14
  26. alias -l ColorAdmin return 13
  27. alias -l ColorOwner return 13
  28. alias -l ColorProtect return 8
  29. alias -l ColorOp return 4
  30. alias -l ColorHalfOp return 9
  31. alias -l ColorVoice return 11
  32. alias -l ColorIsAway return 4
  33.  
  34. ; Timestamp in each line? Set 1 to enable it (OFF by default).
  35. alias -l EnableTimestamp return 0
  36.  
  37. ; Where to display the whois? 1 for custom window, other value current window. Default is 1.
  38. alias -l EnableWhoisWindow return 1
  39.  
  40. ; Window mode: 1 (default) for tool/modal (no taskbar entry), other value for standalone desktop window.
  41. alias -l WindowMode return 1
  42.  
  43. ; Set desktop whois window on top? 1 to enable, other value to disable. ON by default.
  44. alias -l whoisontop return 1
  45.  
  46. ; Window entry display: 0 = hide from switchbar/treebar, 1 = show in switchbar, 2 = show in treebar, 3 = show in both. Default is 1.
  47. alias -l WindowDisplay return 0
  48.  
  49. ; Window size (default 650x300)
  50. alias -l width return 650
  51. alias -l height return 300
  52.  
  53. ; Set alias bellow to 1 if you want to see the raw code for each whois line (OFF by default)
  54. alias -l EnableEchoRaw return 0
  55.  
  56. ; Set 1 to clear whois windows if previously opened. ON by default.
  57. alias -l whoisclear return 1
  58.  
  59. ; Simulate AdiIRC random nick color? set 1 to enable (ON by default)
  60. ; this option doesn't use the AdiIRC internal random nick colors, just mimic the formula to generate the unique color per nick.
  61. alias -l RandomNickColor return 1
  62.  
  63. ; Enable ip* link to online lookup service? for now using geoip.flagfox.net service. Set 1 to enable. On by default.
  64. ; *normally visible only for IRCop or yourself.
  65. alias -l iplink return 1
  66.  
  67. ; ==== Script =====
  68.  
  69. on $*:hotlink:$($ipregex):@whois*: {
  70. if ($iplink != 1) { halt }
  71. if ($hotlink(event) == dclick) { run http://geoip.flagfox.net/?ip= $+ $1 }
  72. }
  73.  
  74. alias -l ipregex {
  75. return /\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b/
  76. }
  77.  
  78. alias -l RandomNickColorGen {
  79. return $iif($RandomNickColor == 1, $whoisother $chr(3) $+ $calc(($left($regsubex($1,/(.)/g,$asc(\1) $chr(32) $chr(43) ),-3) ) % 16) $+ $1, $whoisother $1)
  80. }
  81.  
  82. menu @whois:* {
  83. dclick: if ($whoisclear == 1) { clear %whoistitle } | whois $gettok($active,2,160) $gettok($active,2,160)
  84. $style(2) Version 0.1.8:/
  85. -
  86. About: run http://dev.adiirc.com/boards/5/topics/170
  87. -
  88. Close: window -c $active
  89. }
  90.  
  91. alias -l echoMode {
  92. return $iif($EnableWhoisWindow == 1, $iif($EnableTimestamp == 1,-t) %whoistitle $iif($EnableEchoRaw == 1, $1-, $2-), -a $+ $iif($EnableTimestamp == 1,-t) $iif($EnableEchoRaw == 1, $1-, $2-))
  93. }
  94.  
  95. raw 311:*: {
  96. set -e %whoistitle $+(@,Whois:,$chr(160),$2,$chr(160),$chr(40),$network,$chr(41))
  97. if ($EnableWhoisWindow == 1) {
  98. if ($whoisclear == 1) { clear %whoistitle }
  99. else { if ($window(%whoistitle)) { echo %whoistitle $chr(160) } }
  100. $iif($window(%whoistitle), window -a %whoistitle, window -dCk0iw $+ $WindowDisplay $+ $iif($whoisontop == 1, o) $iif($WindowMode == 1, +L) %whoistitle -1 -1 $width $height)
  101. }
  102. echo $echoMode([000]) $chr(3) $+ $whoismain *** Start Of Whois For User $chr(3) $+ $RandomNickColorGen($2) $chr(3) $+ $whoismain ***
  103. echo $echoMode([311]) $chr(3) $+ $whoismain $strip($2) is $chr(3) $+ $whoisother $+ $strip($3) $+ @ $+ $strip($4) $chr(3) $+ $whoismain $+ ( $+ $6- $+ )
  104. halt
  105. }
  106.  
  107. raw 379:*:{ echo $echoMode([379]) $chr(3) $+ $whoismain $2 User Modes: $chr(3) $+ $whoisother $strip($6) $chr(3) $+ $whoismain Server Modes: $chr(3) $+ $whoisother $strip($7) | halt }
  108. raw 378:*:{ echo $echoMode([378]) $chr(3) $+ $whoismain $2 Host: $chr(3) $+ $whoisother $strip($6) $chr(3) $+ $whoismain IP: $chr(3) $+ $whoisother $strip($7) | halt }
  109. raw 307:*:{ echo $echoMode([307]) $chr(3) $+ $whoismain $strip($2-) | halt }
  110. raw 319:*:{
  111. var %chan $sorttok($strip($3-),32,c)
  112. var %chan $replace(%chan,$chr(32),$chr(3) $+ $whoisother $+ $chr(32))
  113. var %chan $replace(%chan,$chr(33),$chr(3) $+ $ColorAdmin $+ $chr(33) ) | ; !admin (same as Owner in some networks) Purple
  114. var %chan $replace(%chan,$chr(126),$chr(3) $+ $ColorOwner $+ $chr(126) ) | ; ~Owner Purple
  115. var %chan $replace(%chan,$chr(38),$chr(3) $+ $ColorProtect $+ $chr(38) ) | ; &Protect Yellow
  116. var %chan $replace(%chan,$chr(64),$chr(3) $+ $ColorOp $+ $chr(64) ) | ; @Op Red
  117. var %chan $replace(%chan,$chr(37),$chr(3) $+ $ColorHalfOp $+ $chr(37) ) | ; %HalfOp Green
  118. var %chan $replace(%chan,$chr(43),$chr(3) $+ $ColorVoice $+ $chr(43) ) | ; +Voice L-Blue
  119. var %total = $comchan($2,0), %output, %x = 1
  120. if (%total > 1) && ($2 != $me) {
  121. while ( %x <= %total ) {
  122. %output = $addtok(%output,$comchan($2,%x),32)
  123. %bosta = $comchan($2,%x)
  124. var %chan $replace(%chan,%bosta,$chr(31) $+ %bosta $+ $chr(31))
  125. inc %x
  126. }
  127. }
  128. echo $echoMode([319]) $chr(3) $+ $whoismain $2 on $numtok(%chan,32) Channels: $chr(3) $+ $whoisother %chan
  129. halt
  130. }
  131. raw 312:*:{ echo $echoMode([312]) $chr(3) $+ $whoismain $2 Server: $chr(3) $+ $whoisother $strip($3) ( $+ $strip($4-) $+ ) | halt }
  132. raw 301:*:{ echo $echoMode([301]) $chr(3) $+ $whoismain $strip($2) is $chr(3) $+ $ColorIsAway $+ AWAY $+ $chr(3) $+ $whoismain $+ : $chr(3) $+ $whoisother $3- | halt }
  133. raw 313:*:{ echo $echoMode([313]) $chr(3) $+ $whoismain $strip($2-) | halt }
  134. raw 338:*:{ echo $echoMode([313]) $chr(3) $+ $whoismain $strip($2) $chr(3) $+ $whoisother $strip($3-) | halt }
  135. raw 310:*:{ echo $echoMode([310]) $chr(3) $+ $whoismain $strip($2-) | halt }
  136. raw 335:*:{ echo $echoMode([335]) $chr(3) $+ $whoismain $strip($2-) | halt }
  137. raw 614:*:{ echo $echoMode([614]) $chr(3) $+ $whoismain $strip($2-) | halt }
  138. raw 671:*:{ echo $echoMode([671]) $chr(3) $+ $whoismain $strip($2-) | halt }
  139. raw 320:*:{ echo $echoMode([320]) $chr(3) $+ $whoismain $strip($2-) | halt }
  140. raw 330:*:{ echo $echoMode([330]) $chr(3) $+ $whoismain $2 $4- $chr(3) $+ $whoisother $3 | halt }
  141. raw 317:*:{ echo $echoMode([317]) $chr(3) $+ $whoismain $2 Idle: $chr(3) $+ $whoisother $strip($duration($3)) $chr(3) $+ $whoismain - SignOn: $chr(3) $+ $whoisother $strip($asctime($4)) $chr(3) $+ $ColorTimeAgo $+ ( $+ $duration($calc($ctime - $4)) ago) | halt }
  142. raw 275:*:{ echo $echoMode([275]) $chr(3) $+ $whoismain $strip($2-) | halt }
  143. raw 615:*:{ echo $echoMode([615]) $chr(3) $+ $whoismain $2 User Modes: $chr(3) $+ $whoisother $strip($6) $chr(3) $+ $whoismain Server Modes: $chr(3) $+ $whoisother $strip($7) | halt }
  144. raw 616:*:{ echo $echoMode([616]) $chr(3) $+ $whoismain $2 Host: $chr(3) $+ $whoisother $strip($5) $chr(3) $+ $whoismain IP: $chr(3) $+ $whoisother $strip($6) | halt }
  145.  
  146. raw 401:*:{ set %wdone veadinho } ;nick not found
  147.  
  148. raw 318:*: {
  149. if (%wdone) { ;stop cuz nick not found
  150. haltdef
  151. unset %namec %wdone %whoistitle
  152. return
  153. }
  154. haltdef
  155. var %whois.Clones $ial($address($2,2),0)
  156. if (%whois.Clones > 1) {
  157. echo $echoMode([Clones]) $chr(3) $+ $ColorCloneScan User/Service $+ $chr(3) $+ $ColorCloneScanMatch $2 $chr(3) $+ $ColorCloneScan $+ has $calc($ial($address($2,2),0) - 1) Other Clone(s):
  158. var %iee $ial($address($2,2),0)
  159. var %x %iee
  160. while %iee {
  161. if ($gettok($ial($address($2,2),%iee),1,33) != $2) {
  162. dec %x
  163. echo $echoMode([Clones], $chr(3) $+ $ColorCloneScan %x = $v1 $chr(3) $+ $ColorCloneScanMatch $address($v1,5))
  164. }
  165. dec %iee
  166. }
  167. }
  168. echo $echoMode([318]) $chr(3) $+ $whoismain *** End Of Whois ***
  169. unset %namec %whoistitle
  170. }
  171.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement