Advertisement
Guest User

The script I'm having trouble with

a guest
Jun 29th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 8.88 KB | None | 0 0
  1. alias floodcooldownnote {
  2.   if ( $me !isop $chan ) {
  3.     if ((%flood [ $+ [ $1 ] ]) || ($($+(%,flood,$1,.,$nick),2))) { halt }
  4.     set -u3 %flood [ $+ [ $1 ] ] On
  5.     set -u3 %flood [ $+ [ $1 ] $+ [ . ] $+ [ $nick ] ] On
  6.   }
  7. }
  8. alias meisnotTwitchMod {
  9.   return $iif($msgtags(user-type).key == mod || $mid(#, 2-) == $me, $false)
  10. }
  11.  
  12. alias IamaTwitchMod {
  13.   return $iif($msgtags(user-type).key == mod || $mid(#, 2-) == $me, $false)
  14. }
  15.  
  16. alias autokbnote {
  17.   if ( $server == tmi.twitch.tv ) {
  18.     if ( $me isop $chan ) {
  19.       timeout $nick
  20.       halt
  21.     }
  22.     if ( $me isop $chan ) {
  23.       ban $chan $nick 2
  24.       kick $chan $nick
  25.       halt
  26.     }
  27.   }
  28. }
  29. ON $*:TEXT:!adelnote*:#:{
  30.   var %ntchan = $chr(35) $+ $2
  31.   var %nonexistentnote that note doesn't exist.;that note doesn't ring any bells.;that request returned a null value. Maybe the note doesn't exist?;I can't find that note anywhere.;I don't recall having that note.;note was not found in the database.
  32.   IF ( $2 = $null ) { return }
  33.   IF ( $3 = $null ) { return }
  34.   IF ( $4 = $null ) { return }
  35.   IF ( $nick isin %botowners ) {
  36.     IF ( %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $4 ] ] == $null ) {
  37.       floodcooldownnote
  38.       msg $chan $nick $+ , $gettok(%nonexistentnote,$rand(1,6),59)
  39.       return
  40.     }
  41.     UNSET %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $4 ] ]
  42.     UNSET %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $3 ] ] [ $+ [ . ] ] [ $+ [ $4 ] ]
  43.     UNSET %note_info. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $4 ] ]
  44.     IF ( $4 == $nick ) {
  45.       floodcooldownnote
  46.       MSG $chan $nick $+ , your message has been deleted.
  47.       return
  48.     }    
  49.     floodcooldownnote
  50.     MSG $chan $nick $+ , $4 $+ 's message has been deleted.
  51.   }
  52. }
  53. ON $*:TEXT:!sadelnote*:#:{
  54.   var %ntchan = $chr(35) $+ $3
  55.   var %noteexist that note doesn't exist.;that note doesn't ring any bells.;that request returned a null value. Maybe the note doesn't exist?;I can't find that note anywhere.;I don't recall having that note.;note was not found in the database.
  56.   IF ( $2 = $null ) { return }
  57.   IF ( $3 = $null ) { return }
  58.   IF ( $4 = $null ) { return }
  59.   IF ( $nick isin %botowners ) {
  60.     IF ( %notes_for. [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $5 ] ] == $null ) {
  61.       floodcooldownnote
  62.       msg $chan $nick $+ , $gettok(%noteexist,$rand(1,6),59)
  63.       return
  64.     }
  65.     UNSET %notes_for. [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $5 ] ]
  66.     UNSET %note_from_to. [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $4 ] ] [ $+ [ . ] ] [ $+ [ $5 ] ]
  67.     UNSET %note_info. [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ %ntchan ] ] [ $+ [ . ] ] [ $+ [ $5 ] ]
  68.     IF ( $4 == $nick ) {
  69.       floodcooldownnote
  70.       MSG $chan $nick $+ , your message has been deleted.
  71.       return
  72.     }    
  73.     floodcooldownnote
  74.     MSG $chan $nick $+ , $4 $+ 's message has been deleted.
  75.   }
  76. }
  77. ON $*:TEXT:!delnote*:#:{
  78.   var %thenoteinfo = $nick $2
  79.   var %doesnotexist that note doesn't exist.;that note doesn't ring any bells.;that request returned a null value. Maybe the note doesn't exist?;I can't find that note anywhere.;I don't recall having that note.;note was not found in the database.
  80.   IF ( $nick isin %bannedusers ) { autokbnote }
  81.   IF ( $nick isin %twitchbots ) { return }
  82.   IF ( $2 = $null ) { return }
  83.   IF ( %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] == $null ) {
  84.     floodcooldownnote
  85.     MSG $chan $nick $+ , $gettok(%doesnotexist,$rand(1,6),59)
  86.     return
  87.   }
  88.   IF ( %note_info. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] != %thenoteinfo ) {
  89.     IF ( $nick !isin %botowners ) {
  90.       floodcooldownnote
  91.       MSG $chan $nick $+ , Unauthorized
  92.       return
  93.     }
  94.   }  
  95.   UNSET %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ]
  96.   UNSET %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ] [ $+ [ . ] ] [ $+ [ $2 ] ]
  97.   UNSET %note_info. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ]
  98.   IF ( $2 == $nick ) {
  99.     floodcooldownnote
  100.     MSG $chan $nick $+ , your message has been deleted.
  101.     return
  102.   }      
  103.   floodcooldownnote
  104.   MSG $chan $nick $+ , your message for $2 has been deleted.
  105. }
  106.  
  107. ON $*:TEXT:!adminnote*:#:{
  108.   var %notevaradmin1 $server $+ . $+ $2 $+ . $+ $3 $+ . $+ $4
  109.   var %notevaradmin2 $server $+ . $+ $2 $+ . $+ $4
  110.   var %adminrandnotemsg Message from $3 to $4 $+ : $5- $+ ;Note left for $4 by $3 $+ : $5- $+ ;Message left for $4 by $3 $+ : $5-
  111.   IF ( $nick isin %botowners ) {
  112.     IF ( $2 = $null ) { return }
  113.     IF ( $3- = $null ) { return }
  114.     inc %note_id
  115.     inc %note_id. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ $4 ] ]
  116.     SET %note_info. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ $4 ] ] $3 $4
  117.  
  118.     ; set %notes_for.* variable that contains the names of everyone who has left a note for the targeted user
  119.     SET %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ $4 ] ] %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ $4 ] ] $3
  120.     ECHO $chan -- Variable %note_from_to. $+ %notevaradmin2 created --
  121.     SET %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] [ $+ [ . ] ] [ $+ [ $3 ] ] [ $+ [ . ] ] [ $+ [ $4 ] ] $gettok(%adminrandnotemsg,$rand(1,3),59)
  122.     ECHO $chan -- Variable %note_from_to. $+ %notevaradmin1 created --
  123.     floodcooldownnote
  124.     MSG $chan $nick $+ , message has been added to the database with ID no %note_id $+ .
  125.   }
  126. }
  127. var %varban = chatter testuser95
  128. ON $*:TEXT:/^!note\s\w+\s/iS:#:{
  129.   ; %randnotemsg the fix for repetative messages when you leave a message for others
  130.   var %randnotemsg Message from $nick to $2 $+ : $3- $+ ;Note left for $2 by $nick $+ : $3- $+ ;Message left for $2 by $nick $+ : $3-
  131.   ; %randnotemsgself the fix for repetative messages when you leave a message for yourself
  132.   var %randnotemsgself Message left by $nick $+ : $3- $+ ;Note left by $nick $+ : $3- $+ ; $+ $nick left note: $3-
  133.   IF ( $nick isin %bannedusers ) { autokbnote }
  134.   IF ( $nick isin %twitchbots ) { return }
  135.   IF ( $2 isin %twitchbots ) { return }
  136.   IF ( $2 = $null ) { return }
  137.   IF ( $3- = $null ) { return }
  138.   inc %note_id
  139.   inc %note_id. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ]
  140.   SET %note_info. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] $nick $2
  141.   ; set %notes_for.* variable that contains the names of everyone who has left a note for the targeted user
  142.   SET %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] $nick
  143.   ; set %notes_from_to.* variable that contains the message from the user to the targeted user
  144.   IF ( $2 != $nick ) {
  145.     SET %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] $gettok(%randnotemsg,$rand(1,3),59)
  146.     floodcooldownnote
  147.     MSG $chan $nick $+ , your message has been left for $2 with ID no %note_id $+ .
  148.     return
  149.   }  
  150.   SET %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] $gettok(%randnotemsgself,$rand(1,3),59)
  151.   floodcooldownnote
  152.   MSG $chan $nick $+ , your message has been left with ID no %note_id $+ .
  153. }
  154.  
  155. on *:JOIN:#: { postmessage }
  156. on *:TEXT:*:#: { postmessage }
  157.  
  158. alias postmessage {
  159.   var %notebegin %note_from_to.
  160.   var %notebegin2 %notes_for.
  161.   var %notebegin3 %note_info.
  162.   var %notevar1 $server $+ . $+ $chan $+ . $+ $v1 $+ . $+ $nick
  163.   var %notevar2 $server $+ . $+ $chan $+ . $+ $nick
  164.   IF (%notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ]) {
  165.     VAR %x_notes 1
  166.     WHILE ($gettok(%notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ],%x_notes,32)) {
  167.       MSG $chan %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $v1 ] ] [ $+ [ . ] ] [ $+ [ $nick ] ]
  168.       UNSET %note_from_to. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $v1 ] ] [ $+ [ . ] ] [ $+ [ $nick ] ]
  169.       ECHO $chan -- Variable %notebegin $+ %notevar1 erased --
  170.       INC %x_notes
  171.       DEC %note_id. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ]
  172.     }
  173.     UNSET %notes_for. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ]
  174.     ECHO $chan -- Variable %notebegin2 $+ %notevar2 erased --
  175.     UNSET %note_info. [ $+ [ $server ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] [ $+ [ . ] ] [ $+ [ $nick ] ]
  176.     ECHO $chan -- Variable %notebegin3 $+ %notevar2 erased --
  177.   }
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement