_MM_IKKE

script.ini

Nov 22nd, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 9.36 KB | None | 0 0
  1. [script]
  2. n0=on 500,543:TEXT:*:#: { halt }
  3. n1=on *:LOAD: {
  4. n2=  echo -at Loaded scripting mode
  5. n3=  echo -at No new variables added, all are global
  6. n4=}
  7. n5=on *:UNLOAD: {
  8. n6=  .unload -rs testscript.ini
  9. n7=  echo -at Unloaded scripting mode
  10. n8=  echo -at No variables unset, all are global. Unloaded test script
  11. n9=}
  12. n10=
  13. n11=on *:TEXT:!addcmd*:#: {
  14. n12=  if ($nick == %owner && $me == %bot1 && $1 == !addcmd) {
  15. n13=    if ($2 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd <command> | halt }
  16. n14=    elseif ($2 == on) {
  17. n15=      if ($3 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd on (Optional: <#|?|*>) <trigger> | halt }
  18. n16=      elseif ($4 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd on (Optional: <#|?|*>) <trigger> | halt }
  19. n17=      elseif (($3 == $chr(35) || $3 == $chr(63) || $3 == $chr(42)) && $4 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd on <#|?|*> <trigger> | halt }
  20. n18=      elseif ($left($3,1) == $chr(35) || $3 == $chr(63) || $3 == $chr(42)) {
  21. n19=        writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 1) $2 *:TEXT: $+ $4- $+ : $+ $3 $+ : $chr(123)
  22. n20=        if ($3 == ?) { scon $bot_say($chan) msg $chan Responding on message " $+ $replace($4- ,*,<text>) $+ " in all queries }
  23. n21=        elseif ($3 == *) { scon $bot_say($chan) msg $chan Responding on message " $+ $replace($4- ,*,<text>) $+ " in all windows }
  24. n22=        elseif ($3 == $chr(35)) { scon $bot_say($chan) msg $chan Responding on message " $+ $replace($4- ,*,<text>) $+ " in all channels }
  25. n23=        else { scon $bot_say($chan) msg $chan Responding on message " $+ $replace($4- ,*,<text>) $+ " in channel $3 }
  26. n24=      }
  27. n25=      else {
  28. n26=        writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 1) $2 *:TEXT: $+ $3- $+ :#: $chr(123)
  29. n27=        scon $bot_say($chan) msg $chan Responding on message " $+ $replace($3- ,*,<text>) $+ " in all channels
  30. n28=      }
  31. n29=    }
  32. n30=    else {
  33. n31=      if ($2 == if) {
  34. n32=        if ($3) { scon $bot_say($chan) msg $chan Only responding if $replace($3- , isop, has @ on, ishop, has % on, isprotect, has & on, isvoice, has + on, ison, is online at) }
  35. n33=        else { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd if <comparison> | halt }
  36. n34=      }
  37. n35=      elseif ($2 == msg) {
  38. n36=        if ($4 != $null && ($me ison $3 || $3 ison $chan)) { scon $bot_say($chan) msg $chan 4ERROR: $3 is not a channel/ $+ $3 is not in the channel | halt }
  39. n37=        elseif ($4) { scon $bot_say($chan) msg $chan Send message $4- }
  40. n38=        elseif ($3) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd msg <channel> <message> | halt }
  41. n39=        else { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd msg <channel> <message> | halt }
  42. n40=      }
  43. n41=      elseif ($2 == .timer || $2 == timer) {
  44. n42=        if ($3 == $null || $3 !isnum) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer <amount of repeats> <delay> <commands> | halt }
  45. n43=        elseif ($4 == $null || $4 !isnum) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer <amount of repeats> <delay> <commands> | halt }
  46. n44=        elseif ($5 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer <amount of repeats> <delay> <commands> | halt }
  47. n45=        elseif ($3 == 1) {
  48. n46=          if ($5 == if) {
  49. n47=            if ($6) { scon $bot_say($chan) msg $chan Timer: Wait $4 $+ secs till checking if $replace($6- , isop, has @ on, ishop, has % on, isprotect, has & on, isvoice, has + on, ison, is online at) }
  50. n48=            else { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer 1 <delay> if <comparison> <bracket> | halt }
  51. n49=          }
  52. n50=          elseif ($5 == msg) {
  53. n51=            if ($7) { scon $bot_say($chan) msg $chan Send message $7- after $4 $+ secs }
  54. n52=            elseif ($6) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer 1 <delay> msg <channel> <message> | halt }
  55. n53=            else { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer 1 <delay> msg <channel> <message> | halt }
  56. n54=          }
  57. n55=        }
  58. n56=        else {
  59. n57=          if ($5 == msg) {
  60. n58=            if ($7) { scon $bot_say($chan) msg $chan Timer: Repeating message " $+ $7- $+ " $3 times, with a delay of $4 $+ secs. }
  61. n59=            elseif ($6) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer <amount of repeats> <delay> msg <channel> <message> | halt }
  62. n60=            else { scon $bot_say($chan) msg $chan 4ERROR: Usage: !addcmd .timer <amount of repeats> <delay> msg <channel> <message> | halt }
  63. n61=          }
  64. n62=          else { scon $bot_say($chan) msg $chan 4ERROR: Senseless timer? | halt }
  65. n63=        }
  66. n64=      }
  67. n65=      elseif ($2 == $chr(125)) { scon $bot_say($chan) msg $chan Closing script... }
  68. n66=      else { scon $bot_say($chan) msg $chan Unknown command for me... }
  69. n67=      writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 1) $2-
  70. n68=    }
  71. n69=    scon $bot_say($chan) msg $chan Command written to testscript.ini (line $calc($readini(testscript.ini,mirc,lines) + 1) $+ )
  72. n70=    writeini testscript.ini mirc lines $calc($readini(testscript.ini,mirc,lines) + 1)
  73. n71=  }
  74. n72=  elseif ($me == %bot1 && $1 == !addcmd) { scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command }
  75. n73=}
  76. n74=on *:TEXT:!delcmd*:#: {
  77. n75=  if ($nick == %owner && $me == %bot1 && $1 == !delcmd) {
  78. n76=    if ($2 == $null || $2 !isnum) { scon $bot_say($chan) msg $chan 4ERROR: Usage !delcmd <line> }
  79. n77=    elseif ($2 == $readini(testscript.ini,mirc,lines)) {
  80. n78=      scon $bot_say($chan) msg $chan Deleting $readini(testscript.ini,n,script,n $+ $2) $+ ...
  81. n79=      remini testscript.ini script n $+ $2
  82. n80=      if ($readini(testscript.ini,mirc,lines) > 1) {
  83. n81=        writeini testscript.ini mirc lines $calc($readini(testscript.ini,mirc,lines) - 1)
  84. n82=      }
  85. n83=      else {
  86. n84=        writeini testscript.ini mirc lines 0
  87. n85=        scon $bot_say($chan) msg $chan Scripts section has been reset.
  88. n86=      }
  89. n87=    }
  90. n88=    else {      
  91. n89=      scon $bot_say($chan) msg $chan Deleting $readini(testscript.ini,n,script,n $+ $2) $+ ...
  92. n90=      writeini testscript.ini script n $+ $2 $crlf
  93. n91=    }
  94. n92=  }
  95. n93=  elseif ($me == %bot1 && $1 == !delcmd) { scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command }
  96. n94=}
  97. n95=on *:TEXT:!shortcmd*:#: {
  98. n96=  if ($nick == %owner && $me == %bot1 && $1 == !shortcmd) {
  99. n97=    if ($2 == $null || ($2 != text && $2 != action)) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !shortcmd <text|action> <trigger> <cmds> }
  100. n98=    elseif ($3 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !shortcmd <text>|action> <trigger> <cmds> }
  101. n99=    elseif ($4 == $null) { scon $bot_say($chan) msg $chan 4ERROR: Usage: !shortcmd <text>|action> <trigger> <cmds> }
  102. n100=    else {
  103. n101=      writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 1) on *: $+ $2 $+ : $+ $3 $+ : $+ $active $+ : $chr(123)
  104. n102=      writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 2) if ( $+ $chr(36) $+ me == $chr(37) $+ bot1) $chr(123)
  105. n103=
  106. n104=      if ($4 == msg || $4 == describe) { writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 3) scid $+($chr(36),scon,$chr(40),$chr(36),bot_say,$chr(40),$chr(36),chan,$chr(41),$chr(41)) $4- }
  107. n105=      else { writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 3) scid $+($chr(36),scon,$chr(40),$chr(36),bot_say,$chr(40),$chr(36),chan,$chr(41),$chr(41)) msg $chr(36) $+ chan $5- }
  108. n106=
  109. n107=      writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 4) $chr(125)
  110. n108=      writeini testscript.ini script n $+ $calc($readini(testscript.ini,mirc,lines) + 5) $chr(125)
  111. n109=      writeini testscript.ini mirc lines $calc($readini(testscript.ini,mirc,lines) + 5)
  112. n110=      .timer 1 1 .load -rs testscript.ini
  113. n111=      scon $bot_say($chan) .timer 1 1 msg $chan Command written and scripts editor loaded
  114. n112=    }
  115. n113=  }
  116. n114=  elseif ($me == %bot1 && $1 == !shortcmd) { scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command }
  117. n115=}
  118. n116=on *:TEXT:!clearcmds:#: {
  119. n117=  if ($nick == %owner && $me == %bot1) {
  120. n118=    remini testscript.ini script
  121. n119=    writeini testscript.ini mirc lines 0
  122. n120=    scon $bot_say($chan) msg $chan Scripts section has been reset.
  123. n121=  }
  124. n122=  elseif ($me == %bot1) { scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command }
  125. n123=}
  126. n124=on *:TEXT:!load:#: {
  127. n125=  if ($nick == %owner && $me == %bot1) {
  128. n126=    .load -rs testscript.ini
  129. n127=    scon $bot_say($chan) msg $chan Loaded testscript.ini
  130. n128=  }
  131. n129=  elseif ($me == %bot1) { scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command }
  132. n130=}
  133. n131=on *:TEXT:!unload:#: {
  134. n132=  if ($nick == %owner && $me == %bot1) {
  135. n133=    .unload -rs testscript.ini
  136. n134=    scon $bot_say($chan) msg $chan Unloaded testscript.ini
  137. n135=  }
  138. n136=  elseif ($me == %bot1) { scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command }
  139. n137=}
  140.  
  141. [DDE]
  142. ServerStatus=on
  143. ServiceName=mirc
Add Comment
Please, Sign In to add comment