Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [script]
- n0=on 500,543:TEXT:*:#: { halt }
- n1=on *:START: {
- n2= set %conversation 0
- n3=}
- n4=on *:LOAD: {
- n5= set %conversation 0
- n6= set %amadj $lines(bot\adjectives.txt)
- n7= set %amnou $lines(bot\nouns.txt)
- n8= echo -at Loaded random script
- n9= echo -at Set conversation to default, set amadj and amnou to right amount
- n10=}
- n11=on *:UNLOAD: {
- n12= unset %conversation
- n13= unset %convbot1.tmp
- n14= unset %convbot2.tmp
- n15= unset %convchan.tmp
- n16= unset %convbotname.tmp
- n17= unset %convsay.tmp
- n18= unset %amadj
- n19= unset %amnou
- n20= echo -at Unloaded random script
- n21= echo -at Unset conversation variables
- n22=}
- n23=
- n24=on *:TEXT:!conv:#: {
- n25= if ($me == %bot1) {
- n26= if (%bot1 ison $chan && %bot2 ison $chan) {
- n27= if (%conversation == 0) {
- n28= set %conversation 1
- n29= {
- n30= set -e %convbot1.tmp $rand(%bot1_s,%bot2_s)
- n31= :convbot2
- n32= set -e %convbot2.tmp $rand(%bot1_s,%bot2_s)
- n33= if (%convbot1.tmp == %convbot2.tmp) { goto convbot2 }
- n34= }
- n35= set -e %convchan.tmp $chan
- n36= botconv %convbot1.tmp %convbot2.tmp greeting1
- n37= }
- n38= else {
- n39= msg $chan You will have to wait, another conversation is going on...
- n40= }
- n41= }
- n42= else {
- n43= msg $chan 4ERROR: Not all the bots are in the channel
- n44= }
- n45= }
- n46=}
- n47=alias -l botconv {
- n48= ;Syntax: <poster> <receiver> <message file>
- n49= ;Usage: Internally used by the bots to have a conversation. Uses the bot IDs+1 to define who's the poster and receiver.
- n50= ; Message file contains a referral to the next file and the actual message, separated by a blank. Resets conversation when "end" is called
- n51= {
- n52= if ($2 == 2) { set -e %convbotname.tmp %bot1 }
- n53= elseif ($2 == 3) { set -e %convbotname.tmp %bot2 }
- n54= ;elseif ($2 == 4) { set -e %convbotname.tmp %bot3 }
- n55= ;elseif ($2 == 5) { set -e %convbotname.tmp %bot4 }
- n56= }
- n57= {
- n58= set -e %convsay.tmp $replace($read(bottalk\ $+ $3 $+ .txt), <bot>, %convbotname.tmp)
- n59= scon $1 msg %convchan.tmp $right(%convsay.tmp, $calc($len(%convsay.tmp) - $pos(%convsay.tmp, $chr(32), 1)))
- n60= if ($left(%convsay.tmp, $calc($pos(%convsay.tmp, $chr(32), 1) - 1)) == end) {
- n61= unset %convbot1.tmp
- n62= unset %convbot2.tmp
- n63= unset %convchan.tmp
- n64= unset %convbotname.tmp
- n65= unset %convsay.tmp
- n66= set %conversation 0
- n67= }
- n68= else {
- 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)) }
- 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)) }
- n71= else {
- n72= echo 4 -st ERROR:1 Something went terribly wrong (/botconv)
- n73= halt
- n74= }
- n75= }
- n76= }
- n77=}
- n78=
- n79=on *:TEXT:!random:#:{
- n80= if ($me == %bot1) {
- n81= var %i = $rand(1,5)
- n82= if (%i <= 4) { scon $bot_say($chan) msg $chan $replace($read(bot\randommessages.txt), <nick>, $nick) }
- n83= else { scon $bot_say($chan) describe $chan $replace($read(bot\randomactions.txt), <nick>, $nick) }
- n84= }
- n85=}
- n86=on *:TEXT:!quotesamount:#: {
- n87= if ($me == %bot1) {
- n88= scon $bot_say($chan) msg $chan We stored %quotesamount quotes up till now (in %quotefile files)
- n89= }
- n90=}
- n91=on *:TEXT:!knowledge:#: {
- 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 }
- n93=}
- n94=on *:TEXT:!addadjective*:#: {
- n95= if ($me == %bot1 && $1 == !addadjective) {
- n96= if ($2 != $null) {
- n97= if ($2- !isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
- n98= if ($nick == %owner) {
- n99= inc %amadj
- n100= write bot\adjectives.txt $2-
- n101= scon $bot_say($chan) msg $chan Successfully added adjective " $+ $2- $+ "!
- n102= }
- n103= else {
- n104= if (%suggested == $null) {
- n105= scon $bot_say($chan) .notice $nick Adjective has been sent!
- n106= .msg %owner New adjective from $nick $+ : $2-
- n107= set -e %suggested $nick
- n108= set -e %suggestion Add adjective $2-
- n109= }
- n110= else { scon $bot_say($chan) msg $chan 4ERROR: There's already another suggestion in the query }
- n111= }
- n112= }
- n113= else {
- n114= scon $bot_say($chan) msg $chan 4ERROR: There's already an adjective " $+ $read(bot\adjectives.txt,$readn) $+ "
- n115= }
- n116= }
- n117= else {
- n118= scon $bot_say($chan) msg $chan 4ERROR: Usage: !addadjective <adjective>
- n119= }
- n120= }
- n121=}
- n122=on *:TEXT:!addadj*:#: {
- n123= if ($me == %bot1 && $1 == !addadj) {
- n124= if ($2 != $null) {
- n125= if ($2- !isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
- n126= if ($nick == %owner) {
- n127= inc %amadj
- n128= write bot\adjectives.txt $2-
- n129= scon $bot_say($chan) msg $chan Successfully added adjective " $+ $2- $+ "!
- n130= }
- n131= else {
- n132= if (%suggested == $null) {
- n133= scon $bot_say($chan) .notice $nick Adjective has been sent!
- n134= .msg %owner New adjective from $nick $+ : $2-
- n135= set -e %suggested $nick
- n136= set -e %suggestion Add adjective $2-
- n137= }
- n138= else { scon $bot_say($chan) msg $chan 4ERROR: There's already another suggestion in the query }
- n139= }
- n140= }
- n141= else {
- n142= scon $bot_say($chan) msg $chan 4ERROR: There's already an adjective " $+ $read(bot\adjectives.txt,$readn) $+ "
- n143= }
- n144= }
- n145= else {
- n146= scon $bot_say($chan) msg $chan 4ERROR: Usage: !addadj <adjective>
- n147= }
- n148= }
- n149=}
- n150=on *:TEXT:!addnoun*:#: {
- n151= if ($me == %bot1 && $1 == !addnoun) {
- n152= if ($2 != $null) {
- n153= if ($2- !isin $read(bot\nouns.txt,w,* $+ $2- $+ *)) {
- n154= if ($nick == %owner) {
- n155= inc %amnou
- n156= write bot\nouns.txt $2-
- n157= scon $bot_say($chan) msg $chan Successfully added noun " $+ $2- $+ "!
- n158= }
- n159= else {
- n160= if (%suggested == $null) {
- n161= scon $bot_say($chan) .notice $nick Noun has been sent!
- n162= .msg %owner New noun from $nick $+ : $2-
- n163= set -e %suggested $nick
- n164= set -e %suggestion Add noun $2-
- n165= }
- n166= else { scon $bot_say($chan) msg $chan 4ERROR: There's already another suggestion in the query }
- n167= }
- n168= }
- n169= else {
- n170= scon $bot_say($chan) msg $chan 4ERROR: There's already a noun " $+ $read(bot\nouns.txt,$readn) $+ "
- n171= }
- n172= }
- n173= else {
- n174= scon $bot_say($chan) msg $chan 4ERROR: Usage: !addnoun <noun>
- n175= }
- n176= }
- n177=}
- n178=on *:TEXT:!deladjective*:#: {
- n179= if ($me == %bot1 && $nick == %owner && $1 == !deladjective) {
- n180= if ($2 != $null) {
- n181= if ($2- isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
- n182= scon $bot_say($chan) msg $chan Successfully deleted adjective " $+ $read(bot\adjectives.txt, $readn) $+ "!
- n183= write -dl $+ $readn bot\adjectives.txt
- n184= dec %amadj
- n185= }
- n186= else {
- n187= scon $bot_say($chan) msg $chan 4ERROR: There's no adjective " $+ $2- $+ "
- n188= }
- n189= }
- n190= else {
- n191= scon $bot_say($chan) msg $chan 4ERROR: Usage: !deladjective <adjective>
- n192= }
- n193= }
- n194= elseif ($me == %bot1 && $1 == !deladjective) {
- n195= scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command
- n196= }
- n197=}
- n198=on *:TEXT:!deladj*:#: {
- n199= if ($me == %bot1 && $nick == %owner && $1 == !deladj) {
- n200= if ($2 != $null) {
- n201= if ($2- isin $read(bot\adjectives.txt,w,* $+ $2- $+ *)) {
- n202= scon $bot_say($chan) msg $chan Successfully deleted adjective " $+ $read(bot\adjectives.txt, $readn) $+ "!
- n203= write -dl $+ $readn bot\adjectives.txt
- n204= dec %amadj
- n205= }
- n206= else {
- n207= scon $bot_say($chan) msg $chan 4ERROR: There's no adjective " $+ $2- $+ "
- n208= }
- n209= }
- n210= else {
- n211= scon $bot_say($chan) msg $chan 4ERROR: Usage: !deladj <adjective>
- n212= }
- n213= }
- n214= elseif ($me == %bot1 && $1 == !deladj) {
- n215= scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command
- n216= }
- n217=}
- n218=on *:TEXT:!delnoun*:#: {
- n219= if ($me == %bot1 && $nick == %owner && $1 == !delnoun) {
- n220= if ($2 != $null) {
- n221= if ($2- isin $read(bot\nouns.txt,w,* $+ $2- $+ *)) {
- n222= scon $bot_say($chan) msg $chan Successfully deleted noun " $+ $read(bot\nouns.txt, $readn) $+ "!
- n223= write -dl $+ $readn bot\nouns.txt
- n224= dec %amnou
- n225= }
- n226= else {
- n227= scon $bot_say($chan) msg $chan 4ERROR: There's no noun " $+ $2- $+ "
- n228= }
- n229= }
- n230= else {
- n231= scon $bot_say($chan) msg $chan 4ERROR: Usage: !delnoun <noun>
- n232= }
- n233= }
- n234= elseif ($me == %bot1 && $1 == !delnoun) {
- n235= scon $bot_say($chan) msg $chan 4ERROR: You are not authorized to use this command
- n236= }
- n237=}
- n238=on *:TEXT:!randomword:#: {
- n239= if ($me == %bot1) {
- n240= var %i = $rand(1,%knownwordsfile)
- n241= scon $bot_say($chan) msg $chan Random word: " $+ $read(Dictionary\words $+ %i $+ .txt) $+ "
- n242= }
- n243=}
- n244=on *:TEXT:!random*:#: {
- n245= if ($me == %bot1 && $1 == !random) {
- n246= if ($2 != $null) {
- n247= if ($2 ison $chan) {
- n248= var %adjective = $read(bot\adjectives.txt)
- n249= var %noun = $read(bot\nouns.txt)
- 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
- n251= }
- n252= elseif ($2 isnum && Lithium ison $chan) { halt }
- n253= else { scon $bot_say($chan) msg $chan 4ERROR: $2 isn't in channel }
- n254= }
- n255= else {
- n256= scon $bot_say($chan) msg $chan 4ERROR: Usage: !random <nick>
- n257= }
- n258= }
- n259=}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement