Advertisement
_MM_IKKE

random.ini

Nov 22nd, 2018
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 10.48 KB | None | 0 0
  1. [script]
  2. n0=on 500,543:TEXT:*:#: { halt }
  3. n1=on *:START: {
  4. n2=  set %conversation 0
  5. n3=}
  6. n4=on *:LOAD: {
  7. n5=  set %conversation 0
  8. n6=  set %amadj $lines(bot\adjectives.txt)
  9. n7=  set %amnou $lines(bot\nouns.txt)
  10. n8=  echo -at Loaded random script
  11. n9=  echo -at Set conversation to default, set amadj and amnou to right amount
  12. n10=}
  13. n11=on *:UNLOAD: {
  14. n12=  unset %conversation
  15. n13=  unset %convbot1.tmp
  16. n14=  unset %convbot2.tmp
  17. n15=  unset %convchan.tmp
  18. n16=  unset %convbotname.tmp
  19. n17=  unset %convsay.tmp
  20. n18=  unset %amadj
  21. n19=  unset %amnou
  22. n20=  echo -at Unloaded random script
  23. n21=  echo -at Unset conversation variables
  24. n22=}
  25. n23=
  26. n24=on *:TEXT:!conv:#: {
  27. n25=  if ($me == %bot1) {
  28. n26=    if (%bot1 ison $chan && %bot2 ison $chan) {
  29. n27=      if (%conversation == 0) {
  30. n28=        set %conversation 1
  31. n29=        {
  32. n30=          set -e %convbot1.tmp $rand(%bot1_s,%bot2_s)
  33. n31=          :convbot2
  34. n32=          set -e %convbot2.tmp $rand(%bot1_s,%bot2_s)
  35. n33=          if (%convbot1.tmp == %convbot2.tmp) { goto convbot2 }
  36. n34=        }
  37. n35=        set -e %convchan.tmp $chan
  38. n36=        botconv %convbot1.tmp %convbot2.tmp greeting1
  39. n37=      }
  40. n38=      else {
  41. n39=        msg $chan You will have to wait, another conversation is going on...
  42. n40=      }
  43. n41=    }
  44. n42=    else {
  45. n43=      msg $chan 4ERROR: Not all the bots are in the channel
  46. n44=    }
  47. n45=  }
  48. n46=}
  49. n47=alias -l botconv {
  50. n48=  ;Syntax: <poster> <receiver> <message file>
  51. n49=  ;Usage: Internally used by the bots to have a conversation. Uses the bot IDs+1 to define who's the poster and receiver.
  52. n50=  ;       Message file contains a referral to the next file and the actual message, separated by a blank. Resets conversation when "end" is called
  53. n51=  {
  54. n52=    if ($2 == 2) { set -e %convbotname.tmp %bot1 }
  55. n53=    elseif ($2 == 3) { set -e %convbotname.tmp %bot2 }
  56. n54=    ;elseif ($2 == 4) { set -e %convbotname.tmp %bot3 }
  57. n55=    ;elseif ($2 == 5) { set -e %convbotname.tmp %bot4 }
  58. n56=  }
  59. n57=  {
  60. n58=    set -e %convsay.tmp $replace($read(bottalk\ $+ $3 $+ .txt), <bot>, %convbotname.tmp)
  61. n59=    scon $1 msg %convchan.tmp $right(%convsay.tmp, $calc($len(%convsay.tmp) - $pos(%convsay.tmp, $chr(32), 1)))
  62. n60=    if ($left(%convsay.tmp, $calc($pos(%convsay.tmp, $chr(32), 1) - 1)) == end) {
  63. n61=      unset %convbot1.tmp
  64. n62=      unset %convbot2.tmp
  65. n63=      unset %convchan.tmp
  66. n64=      unset %convbotname.tmp
  67. n65=      unset %convsay.tmp
  68. n66=      set %conversation 0
  69. n67=    }
  70. n68=    else {
  71. n69=      if ($1 == %convbot1.tmp) { .timer 1 $rand(1,5) botconv %convbot2.tmp %convbot1.tmp $left(%convsay.tmp, $calc($pos(%convsay.tmp, $chr(32), 1) - 1)) }
  72. n70=      elseif ($1 == %convbot2.tmp) { .timer 1 $rand(1,5) botconv %convbot1.tmp %convbot2.tmp $left(%convsay.tmp, $calc($pos(%convsay.tmp, $chr(32), 1) - 1)) }
  73. n71=      else {
  74. n72=        echo 4 -st ERROR:1 Something went terribly wrong (/botconv)
  75. n73=        halt
  76. n74=      }
  77. n75=    }
  78. n76=  }
  79. n77=}
  80. n78=
  81. n79=on *:TEXT:!random:#:{
  82. n80=  if ($me == %bot1) {
  83. n81=    var %i = $rand(1,5)
  84. n82=    if (%i <= 4) { scon $bot_say($chan) msg $chan $replace($read(bot\randommessages.txt), <nick>, $nick) }
  85. n83=    else { scon $bot_say($chan) describe $chan $replace($read(bot\randomactions.txt), <nick>, $nick) }
  86. n84=  }
  87. n85=}
  88. n86=on *:TEXT:!quotesamount:#: {
  89. n87=  if ($me == %bot1) {
  90. n88=    scon $bot_say($chan) msg $chan We stored %quotesamount quotes up till now (in %quotefile files)
  91. n89=  }
  92. n90=}
  93. n91=on *:TEXT:!knowledge:#: {
  94. n92=  if ($me == %bot1) { scon $bot_say($chan) msg $chan I currently know %amadj adjectives and %amnou nouns, that makes $calc(%amadj * %amnou) possible combinations }
  95. n93=}
  96. n94=on *:TEXT:!addadjective*:#: {
  97. n95=  if ($me == %bot1 && $1 == !addadjective) {
  98. n96=    if ($2 != $null) {
  99. n97=      if ($2- !isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
  100. n98=        if ($nick == %owner) {
  101. n99=          inc %amadj
  102. n100=          write bot\adjectives.txt $2-
  103. n101=          scon $bot_say($chan) msg $chan Successfully added adjective " $+ $2- $+ "!
  104. n102=        }
  105. n103=        else {
  106. n104=          if (%suggested == $null) {
  107. n105=            scon $bot_say($chan) .notice $nick Adjective has been sent!
  108. n106=            .msg %owner New adjective from $nick $+ : $2-
  109. n107=            set -e %suggested $nick
  110. n108=            set -e %suggestion Add adjective $2-
  111. n109=          }
  112. n110=          else { scon $bot_say($chan) msg $chan 4ERROR: There's already another suggestion in the query }
  113. n111=        }
  114. n112=      }
  115. n113=      else {
  116. n114=        scon $bot_say($chan) msg $chan 4ERROR: There's already an adjective " $+ $read(bot\adjectives.txt,$readn) $+ "
  117. n115=      }
  118. n116=    }
  119. n117=    else {
  120. n118=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !addadjective <adjective>
  121. n119=    }
  122. n120=  }
  123. n121=}
  124. n122=on *:TEXT:!addadj*:#: {
  125. n123=  if ($me == %bot1 && $1 == !addadj) {
  126. n124=    if ($2 != $null) {
  127. n125=      if ($2- !isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
  128. n126=        if ($nick == %owner) {
  129. n127=          inc %amadj
  130. n128=          write bot\adjectives.txt $2-
  131. n129=          scon $bot_say($chan) msg $chan Successfully added adjective " $+ $2- $+ "!
  132. n130=        }
  133. n131=        else {
  134. n132=          if (%suggested == $null) {
  135. n133=            scon $bot_say($chan) .notice $nick Adjective has been sent!
  136. n134=            .msg %owner New adjective from $nick $+ : $2-
  137. n135=            set -e %suggested $nick
  138. n136=            set -e %suggestion Add adjective $2-
  139. n137=          }
  140. n138=          else { scon $bot_say($chan) msg $chan 4ERROR: There's already another suggestion in the query }
  141. n139=        }
  142. n140=      }
  143. n141=      else {
  144. n142=        scon $bot_say($chan) msg $chan 4ERROR: There's already an adjective " $+ $read(bot\adjectives.txt,$readn) $+ "
  145. n143=      }
  146. n144=    }
  147. n145=    else {
  148. n146=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !addadj <adjective>
  149. n147=    }
  150. n148=  }
  151. n149=}
  152. n150=on *:TEXT:!addnoun*:#: {
  153. n151=  if ($me == %bot1 && $1 == !addnoun) {
  154. n152=    if ($2 != $null) {
  155. n153=      if ($2- !isin $read(bot\nouns.txt,w,* $+ $2- $+ *)) {
  156. n154=        if ($nick == %owner) {
  157. n155=          inc %amnou
  158. n156=          write bot\nouns.txt $2-
  159. n157=          scon $bot_say($chan) msg $chan Successfully added noun " $+ $2- $+ "!
  160. n158=        }
  161. n159=        else {
  162. n160=          if (%suggested == $null) {
  163. n161=            scon $bot_say($chan) .notice $nick Noun has been sent!
  164. n162=            .msg %owner New noun from $nick $+ : $2-
  165. n163=            set -e %suggested $nick
  166. n164=            set -e %suggestion Add noun $2-
  167. n165=          }
  168. n166=          else { scon $bot_say($chan) msg $chan 4ERROR: There's already another suggestion in the query }
  169. n167=        }
  170. n168=      }
  171. n169=      else {
  172. n170=        scon $bot_say($chan) msg $chan 4ERROR: There's already a noun " $+ $read(bot\nouns.txt,$readn) $+ "
  173. n171=      }
  174. n172=    }
  175. n173=    else {
  176. n174=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !addnoun <noun>
  177. n175=    }
  178. n176=  }
  179. n177=}
  180. n178=on *:TEXT:!deladjective*:#: {
  181. n179=  if ($me == %bot1 && $nick == %owner && $1 == !deladjective) {
  182. n180=    if ($2 != $null) {
  183. n181=      if ($2- isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
  184. n182=        scon $bot_say($chan) msg $chan Successfully deleted adjective " $+ $read(bot\adjectives.txt, $readn) $+ "!
  185. n183=        write -dl $+ $readn bot\adjectives.txt
  186. n184=        dec %amadj
  187. n185=      }
  188. n186=      else {
  189. n187=        scon $bot_say($chan) msg $chan 4ERROR: There's no adjective " $+ $2- $+ "
  190. n188=      }
  191. n189=    }
  192. n190=    else {
  193. n191=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !deladjective <adjective>
  194. n192=    }
  195. n193=  }
  196. n194=  elseif ($me == %bot1 && $1 == !deladjective) {
  197. n195=    scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command
  198. n196=  }
  199. n197=}
  200. n198=on *:TEXT:!deladj*:#: {
  201. n199=  if ($me == %bot1 && $nick == %owner && $1 == !deladj) {
  202. n200=    if ($2 != $null) {
  203. n201=      if ($2- isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
  204. n202=        scon $bot_say($chan) msg $chan Successfully deleted adjective " $+ $read(bot\adjectives.txt, $readn) $+ "!
  205. n203=        write -dl $+ $readn bot\adjectives.txt
  206. n204=        dec %amadj
  207. n205=      }
  208. n206=      else {
  209. n207=        scon $bot_say($chan) msg $chan 4ERROR: There's no adjective " $+ $2- $+ "
  210. n208=      }
  211. n209=    }
  212. n210=    else {
  213. n211=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !deladj <adjective>
  214. n212=    }
  215. n213=  }
  216. n214=  elseif ($me == %bot1 && $1 == !deladj) {
  217. n215=    scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command
  218. n216=  }
  219. n217=}
  220. n218=on *:TEXT:!delnoun*:#: {
  221. n219=  if ($me == %bot1 && $nick == %owner && $1 == !delnoun) {
  222. n220=    if ($2 != $null) {
  223. n221=      if ($2- isin $read(bot\nouns.txt,w,* $+ $2- $+ *)) {
  224. n222=        scon $bot_say($chan) msg $chan Successfully deleted noun " $+ $read(bot\nouns.txt, $readn) $+ "!
  225. n223=        write -dl $+ $readn bot\nouns.txt
  226. n224=        dec %amnou
  227. n225=      }
  228. n226=      else {
  229. n227=        scon $bot_say($chan) msg $chan 4ERROR: There's no noun " $+ $2- $+ "
  230. n228=      }
  231. n229=    }
  232. n230=    else {
  233. n231=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !delnoun <noun>
  234. n232=    }
  235. n233=  }
  236. n234=  elseif ($me == %bot1 && $1 == !delnoun) {
  237. n235=    scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command
  238. n236=  }
  239. n237=}
  240. n238=on *:TEXT:!randomword:#: {
  241. n239=  if ($me == %bot1) {
  242. n240=    var %i = $rand(1,%knownwordsfile)
  243. n241=    scon $bot_say($chan) msg $chan Random word: " $+ $read(Dictionary\words $+ %i $+ .txt) $+ "
  244. n242=  }
  245. n243=}
  246. n244=on *:TEXT:!random*:#: {
  247. n245=  if ($me == %bot1 && $1 == !random) {
  248. n246=    if ($2 != $null) {
  249. n247=      if ($2 ison $chan) {
  250. n248=        var %adjective = $read(bot\adjectives.txt)
  251. n249=        var %noun = $read(bot\nouns.txt)
  252. n250=        scon $bot_say($chan) describe $chan slaps $nick($chan,$nick($chan,$2)) around a bit with $iif(($left(%adjective,1) == a || $left(%adjective,1) == e || $left(%adjective,1) == u || $left(%adjective,1) == i || $left(%adjective,1) == o) && $left(%adjective,2) != eu,an,a) %adjective %noun    
  253. n251=      }
  254. n252=      elseif ($2 isnum && Lithium ison $chan) { halt }
  255. n253=      else { scon $bot_say($chan) msg $chan 4ERROR: $2 isn't in channel }
  256. n254=    }
  257. n255=    else {
  258. n256=      scon $bot_say($chan) msg $chan 4ERROR: Usage: !random <nick>
  259. n257=    }
  260. n258=  }
  261. n259=}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement