Guest User

Untitled

a guest
May 27th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.37 KB | None | 0 0
  1. on *:LOAD:{
  2. R.help
  3. set %R.np on
  4. }
  5.  
  6. alias R.help {
  7. echo -a ;======== RELAY v1.1 ========
  8. echo -a ;=============================
  9. echo -a ; A script to relay messages
  10. echo -a ; between the same channel on
  11. echo -a ; different networks
  12. echo -a ;-----------------------------
  13. echo -a ; by: MaxP
  14. echo -a ; (#logic :: DALnet & Aniverse)
  15. echo -a ;=============================
  16. echo -a ; This addon well relay all messages between the same channel name on all the networks your on and have joined that channel.
  17. echo -a ; to see the nicks on the same channel (different network) type !whodat <network>
  18. echo -a ; to see the topic on the same channel (different network) type !whodat <network>
  19. echo -a ; to manualy turn the network prefix on/off type /prefix
  20. echo -a ; ie. If Im on #logic on both Aniverse and DALnet, the trigger !whodat DALnet well tell me who is on #logic of DALnet.
  21. echo -a ; The events that are auto messaged are: PART, JOIN, QUIT, and Nick Change.
  22. echo -a ; The addon can be disabled from the menubar
  23. }
  24.  
  25. menu menubar {
  26. relay
  27. .$iif($group(#relay) == on,$style(1)) ON: .enable #relay
  28. .$iif($group(#relay) == off,$style(1)) OFF: .disable #relay
  29. .-
  30. .$iif(%R.np == on,$style(1)) Network Prefix: Prefix
  31. .-
  32. .Help: R.help
  33. .-
  34. .unload:{ unload -rs $script }
  35. }
  36.  
  37. alias §erver {
  38. ;<-c|v> <network/server>
  39. var %n = 1
  40. while ($scon(%n)) {
  41. if (($scon(%n).$network == $2) || ($scon(%n).$server == $2)) {
  42. if ($1 == -v) { return $iif($scon(%n).$status == connected,OK,NC) }
  43. elseif ($1 == -c) { return scon %n }
  44. }
  45. inc %n
  46. }
  47. return NA
  48. }
  49.  
  50. #relay off
  51. on *:ACTION:*:#:{ do describe # [ $nick(#,$nick).pnick ] $1- }
  52. on *:TEXT:*:#:{
  53. if ($1 == !whodat) {
  54. if (!$2) {
  55. if ($net(#)) { whodat $nick $ifmatch # | return }
  56. else { notice $nick the syntax for !whodat is: !whodat <network> | return }
  57. }
  58. whodat $nick $2 # | return
  59. }
  60. if ($1 == !topic) {
  61. if (%R.net) { notice $nick I am currently checking the topic for another user please try again in a few moments. | return }
  62. if (!$2) {
  63. if ($net(#)) { R.topic $nick $ifmatch # | return }
  64. else { notice $nick the syntax for !topic is: !topic <network> | return }
  65. }
  66. R.topic $nick $2 # | return
  67. }
  68. do msg # [ $nick(#,$nick).pnick ] $1-
  69. }
  70.  
  71. on *:INPUT:#:{
  72. if ($1 == !whodat) {
  73. if (!$2) {
  74. if ($net(#)) { .timer 1 1 whodat $me $ifmatch # | return }
  75. else { .timer 1 1 echo -a the syntax for !whodat is: !whodat <network> | return }
  76. }
  77. .timer 1 1 whodat $me $2 # | return
  78. }
  79. elseif ($1 == /me) { do describe # [ $me ] $2- | return }
  80. elseif ($left($1,1) == /) { return }
  81. else { do msg # [ $me ] $1- }
  82. }
  83.  
  84.  
  85. on *:PART:#:{ do msg # [ $nick ] PART }
  86. on *:KICK:#:{ do msg #  $knick was kicked on $network by $nick (Reason: $1- ) }
  87. on *:JOIN:#:{ do msg # [ $nick ] JOIN }
  88. on *:QUIT:{ var %n = 1 | while ($comchan($nick,%n)) { .timer 1 1 do msg $ifmatch [ $nick ] QUIT ( $1- ) | inc %n } }
  89. on *:NICK:{ var %n = 1 | while ($comchan($newnick,%n)) { .timer 1 1 do msg $ifmatch  $+ $nick is now known as $newnick | inc %n } }
  90. on *:DISCONNECT:{ do msg -a I am now DISCONNECTED from $network }
  91. on *:CONNECT:{ .timer 1 5 do msg -a I am now CONNECTED to $network }
  92. #relay end
  93.  
  94.  
  95. alias -l c {
  96. if ($§erver(-v,$1) != OK) { halt }
  97. return $§erver(-c,$1)
  98. }
  99.  
  100. ;<do> <chan> <txt>
  101. alias -l do {
  102. var %net = $network, %cid = $cid, %chan = $2, %n
  103. if ($2 == -a) {
  104. var %m = 1, %chan = $chan(%m)
  105. }
  106. :1
  107. %n = 1
  108. while ($scon(%n)) {
  109. if ($scon(%n).$status == connected) && ($scon(%n).$network != %net) {
  110. scon %n
  111. if ($me ison %chan) { $1 %chan $iif(%R.np == on,( $+ %net $+ )) $3- }
  112. }
  113. inc %n
  114. }
  115. if ($2 == -a) {
  116. scon %cid
  117. inc %m
  118. if ($chan(%m)) { %chan = $ifmatch | goto 1 }
  119. }
  120. }
  121.  
  122. ;<chan>
  123. alias -l net {
  124. var %n = 1 | var %c | var %net = $network | var %w
  125. while ($scon(%n)) {
  126. scon %n
  127. if ($me ison $1) && ($scon(%n).$status == connected) {
  128. if ($scon(%n).$network != %net) { %w = $ifmatch }
  129. inc %c
  130. }
  131. inc %n
  132. }
  133. return $iif(%c == 2,%w)
  134. }
  135.  
  136. alias Prefix { set %R.np $iif(%R.np == on,off,on) | echo -a Network prefix for Relay has been turned: $iif(%R.np == on,ON,OFF) }
  137. ;;Trigger(s)
  138.  
  139. ;<nick><network><chan>
  140. alias -l whodat {
  141. var %net = $network
  142. if ($§erver(-v,$2) == OK) { $iif($1 != $me,notice $1,echo -a) Nicks on $2 chatting on $3 }
  143. else { $iif($1 != $me,notice $1,echo -a) I am not connected to: $2 | halt }
  144. var %n = 1 | var %l = 1 | var %m
  145. $c($2)
  146. while ($nick($3,%n).pnick) {
  147. %m = %m • $ifmatch
  148. if (%l == 4) { $c(%net) | $iif($1 != $me,.timer 1 $calc( %n / 4) notice $1 %m,echo -a %m) | var %m | var %l | $c($2) }
  149. inc %l
  150. inc %n
  151. }
  152. $c(%net)
  153. if (%m) { $iif($1 != $me,.timer 1 $int($calc( %n / 4)) notice $1 %m,echo -a %m) }
  154. }
  155.  
  156. alias -l R.topic {
  157. if ($§erver(-v,$2) != OK) { $iif($1 != $me,notice $1,echo -a) I am not connected to: $2 | halt }
  158. set %R.net $network
  159. set %R.nick $1
  160. set %R.chan $3
  161. .timer 1 6 unset %R.*
  162. $c($2)
  163. .topic $3
  164. }
  165.  
  166. raw 332:*:{
  167. if (%R.net) {
  168. var %net = $network
  169. $c(%R.net)
  170. $iif(%R.nick != $me,notice %R.nick,echo -a) Topic for %R.chan on %net
  171. $iif(%R.nick != $me,notice %R.nick,echo -a) $2-
  172. unset %R.*
  173. }
  174. }
Add Comment
Please, Sign In to add comment