AiMinusN

Colored Nicks mIRC Script

Nov 27th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.04 KB | None | 0 0
  1. ;Coloured nicks 1.5.5 by CrazySpence, Software as is but you may find me on the Blitzed network
  2. ;in the mIRC server list or simply irc.blitzed.org if you want to request information/permission to
  3. ;integrate it into another script or simply shoot the breeze :Þ ®
  4.  
  5. alias nocolourdcc {
  6. if ($1) {
  7. if ($readini(crazyspence.ini,colournicks,$chr(61) $+ $1) == off) writeini crazyspence.ini colournicks $chr(61) $+ $1 on
  8. else writeini crazyspence.ini colournicks $chr(61) $+ $1 off
  9. }
  10. else echo 9You must specify a nickname
  11. }
  12.  
  13. alias nocolour {
  14. if ($1) {
  15. if ($readini(crazyspence.ini,colournicks,$1) == off) writeini crazyspence.ini colournicks $1 on
  16. else writeini crazyspence.ini colournicks $1 off
  17. }
  18. else echo 3You must specify a nickname or Channel
  19. }
  20.  
  21. alias cnickstheme {
  22. if ($readini(mirc.ini,text,theme) != cnicks) writeini crazyspence.ini colournicks oldtheme $readini(mirc.ini,text,theme)
  23. writeini mirc.ini colors n $+ $ini(mirc.ini,colors,0) cnicks,1,6,4,5,11,3,3,3,3,3,3,0,5,7,6,9,3,11,3,5,11,1,0,1,4,15,6,1
  24. color -ls cnicks
  25. }
  26.  
  27. alias nickcolour {
  28. if ($1 == 0) return 3
  29. if ($1 == 1) return 4
  30. if ($1 == 2) return 6
  31. if ($1 == 3) return 8
  32. if ($1 == 4) return 9
  33. if ($1 == 5) return 10
  34. if ($1 == 6) return 11
  35. if ($1 == 7) return 12
  36. if ($1 == 8) return 13
  37. }
  38. alias nickformat {
  39. if ($readini(crazyspence.ini,colournicks,$1) == off) return
  40. if ($readini(crazyspence.ini,colournicks,$2) == off) return
  41. set %colournicks.i 1
  42. set %colournicks.sum 0
  43. while ($mid($2,%colournicks.i,1) != $null) {
  44. set %colournicks.sum $calc(%colournicks.sum + $asc($mid($2,%colournicks.i,1)))
  45. inc %colournicks.i
  46. }
  47. set %colournicks.sum $calc(%colournicks.sum % 9)
  48. set %colournicks.colour $nickcolour(%colournicks.sum)
  49. if ($left($1,1) == $chr(35)) {
  50. if ($3 == $chr(42)) {
  51. if ($mid($readini(mirc.ini,options,n2),$calc($pos($readini(mirc.ini,options,n2),$chr(44),30) - 1),1) == 1) {
  52. return  $+ %colournicks.colour * $nick($1,$2).pnick
  53. }
  54. else return  $+ %colournicks.colour * $2
  55. }
  56. if ($mid($readini(mirc.ini,options,n2),$calc($pos($readini(mirc.ini,options,n2),$chr(44),30) - 1),1) == 1) {
  57. return 12 $+ < $+ %colournicks.colour $+ $nick($1,$2).pnick $+ 12>
  58. }
  59. else return 12 $+ < $+ %colournicks.colour $+ $2 $+ 12>
  60. }
  61. if ($3 == $chr(42)) {
  62. return  $+ %colournicks.colour * $2
  63. }
  64. return 12 $+ < $+ %colournicks.colour $+ $2 $+ 12>
  65. }
  66.  
  67. menu channel {
  68. -
  69. $iif($group(#colourednicks).status != off,$style(2)) Enable Coloured nicks:/enable #colourednicks
  70. $iif($group(#colourednicks).status == off,$style(2)) Disable Coloured nicks:/disable #colourednicks
  71. -
  72. }
  73. on 1:load:{
  74. echo 13Loading....
  75. echo 13Right click a channel to get the enable/disable toggle for coloured nicks
  76. echo 13/cnickstheme can create a new theme and change your colours to compliment the scripts features. Your original theme will not be harmed by using this command and can be restored via the colour dialog or by unloading the script
  77. }
  78. on 1:start:{
  79. echo 13Coloured Nicks 11by 13CrazySpence
  80. echo 11Ported from 13X-Chat's 11Coloured nick system
  81. echo 11/nocolour <nickname or #channel> and /nocolourdcc <nickname> to toggle colours for that nickname, channel or dcc
  82. }
  83.  
  84. on 1:unload:{
  85. if ($readini(mirc.ini,text,theme) == cnicks) {
  86. echo -a -- Restoring original Theme
  87. color -s $readini(crazyspence.ini,colournicks,oldtheme)
  88. }
  89. echo -a -- Unloading and Checking for other CrazySpence scripts (they all use the same ini file)
  90. if ($script(alog.mrc)) {
  91. remini crazyspence.ini colournicks
  92. echo -a -- CrazySpence script still active and crazyspence.ini will not be deleted, removing colournicks section from CrazySpence.ini
  93. return
  94. }
  95. if ($script(foreverplayer.mrc)) {
  96. remini crazyspence.ini colournicks
  97. echo -a -- CrazySpence script still active and crazyspence.ini will not be deleted, removing colournicks section from CrazySpence.ini
  98. return
  99. }
  100. remove crazyspence.ini
  101. echo -a -- no CrazySpence scripts detected, crazyspence.ini removed
  102. }
  103.  
  104. #colourednicks on
  105. on ^1:text:*:#:{
  106. if (($readini(mirc.ini,timestamp,$chan) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) echo $chan $timestamp $nickformat($chan, $nick) $1-
  107. else echo $chan $nickformat($chan, $nick) $1-
  108. if ($readini(mirc.ini,flashing,$chan) == on) flash
  109. unset %colournicks.*
  110. haltdef
  111. }
  112. on ^1:text:*:?:{
  113. if ($halted == $true) halt ;this is to stop this script from overriding another scripts (mp3 forever for example) default filtering
  114. if (($readini(mirc.ini,timestamp,$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) echo $nick $timestamp $nickformat($nick,$nick) $1-
  115. else echo $nick $nickformat($nick,$nick) $1-
  116. if ($readini(mirc.ini,flashing,$nick) == on) flash
  117. unset %colournicks.*
  118. haltdef
  119. }
  120. on ^1:chat:*:{
  121. if ($readini(mirc.ini,colournicks,=$nick) == off) return
  122. set %colournicks.i 1
  123. set %colournicks.sum 0
  124. while ($mid(=$nick,%colournicks.i,1) != $null) {
  125. set %colournicks.sum $calc(%colournicks.sum + $asc($mid($nick,%colournicks.i,1)))
  126. inc %colournicks.i
  127. }
  128. set %colournicks.sum $calc(%colournicks.sum % 9)
  129. set %colournicks.colour $nickcolour(%colournicks.sum)
  130. if ($1 == ACTION) set %colournicks.message  $+ %colournicks.colour $+ * $nick $left($2-,$calc($len($2-) - 1))
  131. else set %colournicks.message 12< $+ %colournicks.colour $+ $nick $+ 12> $1-
  132. if (($readini(mirc.ini,timestamp,=$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) echo =$nick $timestamp %colournicks.message
  133. else echo =$nick %colournicks.message
  134. if ($readini(mirc.ini,flashing,=$nick) == on) flash
  135. unset %colournicks.i
  136. unset %colournicks.sum
  137. unset %colournicks.colour
  138. unset %colournicks.message
  139. haltdef
  140. }
  141.  
  142. on ^1:action:*:#:{
  143. if (($readini(mirc.ini,timestamp,$chan) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) echo $chan $timestamp $nickformat($chan,$nick,$chr(42)) $1-
  144. else echo $chan $nickformat($chan, $nick,$chr(42)) $1-
  145. if ($readini(mirc.ini,flashing,$chan) == on) flash
  146. unset %colournicks.*
  147. haltdef
  148. }
  149. on ^1:action:*:?:{
  150. if (($readini(mirc.ini,timestamp,$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) echo $nick $timestamp $nickformat($nick,$nick,$chr(42)) $1-
  151. else echo $nick $nickformat($nick,$nick,$chr(42)) $1-
  152. if ($readini(mirc.ini,flashing,$nick) == on) flash
  153. unset %colournicks.*
  154. haltdef
  155. }
  156. on 1:input:#:{
  157. if ($1 == /msg) {
  158. return
  159. }
  160. if ($1 == /me) {
  161. if (($readini(mirc.ini,timestamp,$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) {
  162. echo $chan $timestamp $nickformat($chan, $me,$chr(42)) $2- 
  163. raw -q PRIVMSG $chan : $+ $chr(001) $+ ACTION $2- $+ $chr(001)
  164. unset %colournicks.*
  165. haltdef
  166. }
  167. else {
  168. echo $chan $nickformat($chan, $me,$chr(42)) $2- 
  169. raw -q PRIVMSG $chan : $+ $chr(001) $+ ACTION $2- $+ $chr(001)
  170. unset %colournicks.*
  171. haltdef
  172. }
  173. }
  174. if ($1 == /describe) {
  175. return
  176. }
  177. if ($left($1,1) == /) return
  178. if (($readini(mirc.ini,timestamp,$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) {
  179. echo $chan $timestamp $nickformat($chan,$me) $1-
  180. raw -q PRIVMSG $chan : $+ $1-
  181. unset %colournicks.*
  182. haltdef
  183. }
  184. else {
  185. echo $chan $nickformat($chan,$me) $1-
  186. raw -q PRIVMSG $chan : $+ $1-
  187. unset %colournicks.*
  188. haltdef
  189. }
  190. }
  191. on 1:input:?:{
  192. if ($1 == /msg) {
  193. return
  194. }
  195. if ($1 == /me) {
  196. if (($readini(mirc.ini,timestamp,$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) {
  197. echo $active $timestamp $nickformat($me,$me,$chr(42)) $2- 
  198. raw -q PRIVMSG $active : $+ $chr(001) $+ ACTION $2- $+ $chr(001)
  199. unset %colournicks.*
  200. haltdef
  201. }
  202. else {
  203. echo $active $nickformat($me,$me,$chr(42)) $2- 
  204. raw -q PRIVMSG $active : $+ $chr(001) $+ ACTION $2- $+ $chr(001)
  205. unset %colournicks.*
  206. haltdef
  207. }
  208. }
  209. if ($1 == /describe) {
  210. return
  211. }
  212. if ($left($1,1) == /) return
  213. if (($readini(mirc.ini,timestamp,$nick) == on) || ($mid($readini(mirc.ini,options,n4),$calc($pos($readini(mirc.ini,options,n4),$chr(44),12) - 1),1) == 1)) {
  214. echo $active $timestamp $nickformat($me,$me) $1-
  215. raw -q PRIVMSG $active : $+ $1-
  216. unset %colournicks.*
  217. haltdef
  218. }
  219. else {
  220. echo $active $nickformat($me,$me) $1-
  221. raw -q PRIVMSG $query : $+ $1-
  222. unset %colournicks.*
  223. haltdef
  224. }
  225. }
  226.  
  227. #colourednicks end
Add Comment
Please, Sign In to add comment