2016-10-12 21:58:16 -07:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Copyright © 2016 Project Golan
|
|
|
|
|
//
|
|
|
|
|
// See "LICENSE" for more information.
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Fun stuff.
|
|
|
|
|
// .carmack, .revenant, .wan, .nyan, .:^)
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
using System;
|
2016-10-27 23:48:58 -07:00
|
|
|
|
using System.Linq;
|
2016-10-12 21:58:16 -07:00
|
|
|
|
|
|
|
|
|
namespace ProjectGolan.Vrobot3.Modules
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
// Mod_Fun
|
|
|
|
|
//
|
|
|
|
|
public class Mod_Fun : IBotModule
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
// ShitpostingDevice
|
|
|
|
|
//
|
|
|
|
|
private class ShitpostingDevice
|
|
|
|
|
{
|
|
|
|
|
private String word, final;
|
|
|
|
|
private Random rnd = Utils.GetRND();
|
|
|
|
|
private int min, max;
|
|
|
|
|
private Bot bot;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// ShitpostingDevice constructor
|
|
|
|
|
//
|
|
|
|
|
public ShitpostingDevice(String word, String final, int min, int max,
|
|
|
|
|
Bot bot)
|
|
|
|
|
{
|
|
|
|
|
this.word = word;
|
|
|
|
|
this.final = final;
|
|
|
|
|
this.min = min;
|
|
|
|
|
this.max = max;
|
|
|
|
|
this.bot = bot;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// run
|
|
|
|
|
//
|
|
|
|
|
public void run(User usr, Channel channel, String msg)
|
|
|
|
|
{
|
2016-10-27 17:57:00 -07:00
|
|
|
|
var n = rnd.Next(min, max);
|
|
|
|
|
var outp = String.Empty;
|
2016-10-12 21:58:16 -07:00
|
|
|
|
|
2016-10-27 17:57:00 -07:00
|
|
|
|
if(bot.clientInfo.hasColors && rnd.Next(0, 8) == 1)
|
2016-10-12 21:58:16 -07:00
|
|
|
|
for(int i = 0; i < 6; i++)
|
|
|
|
|
{
|
|
|
|
|
String[] colors = { "04", "07", "08", "09", "12", "06" };
|
|
|
|
|
outp += "\x03";
|
|
|
|
|
outp += colors[i];
|
|
|
|
|
outp += word;
|
|
|
|
|
outp += word;
|
|
|
|
|
}
|
|
|
|
|
else
|
2016-10-27 17:57:00 -07:00
|
|
|
|
for(var i = 0; i < n; i++)
|
2016-10-12 21:58:16 -07:00
|
|
|
|
outp += word;
|
|
|
|
|
|
|
|
|
|
bot.reply(usr, channel, outp + final);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Mod_Fun constructor
|
|
|
|
|
//
|
2016-10-27 17:57:00 -07:00
|
|
|
|
public Mod_Fun(Bot bot) :
|
|
|
|
|
base(bot)
|
2016-10-12 21:58:16 -07:00
|
|
|
|
{
|
2016-10-27 23:48:58 -07:00
|
|
|
|
commands["carmack"] = new BotCommandStructure {
|
2016-10-12 21:58:16 -07:00
|
|
|
|
cmd = new ShitpostingDevice("MM", "", 3, 20, bot).run,
|
2016-10-27 23:48:58 -07:00
|
|
|
|
hidden = true
|
2016-10-12 21:58:16 -07:00
|
|
|
|
};
|
2016-10-27 23:48:58 -07:00
|
|
|
|
|
|
|
|
|
commands["revenant"] = new BotCommandStructure {
|
2016-10-12 21:58:16 -07:00
|
|
|
|
cmd = new ShitpostingDevice("AA", "", 3, 20, bot).run,
|
2016-10-27 23:48:58 -07:00
|
|
|
|
hidden = true
|
2016-10-12 21:58:16 -07:00
|
|
|
|
};
|
2016-10-27 23:48:58 -07:00
|
|
|
|
|
|
|
|
|
commands["wan"] = new BotCommandStructure {
|
2016-10-12 21:58:16 -07:00
|
|
|
|
cmd = new ShitpostingDevice("wan ", "- !", 2, 12, bot).run,
|
2016-10-27 23:48:58 -07:00
|
|
|
|
hidden = true
|
2016-10-12 21:58:16 -07:00
|
|
|
|
};
|
2016-10-27 23:48:58 -07:00
|
|
|
|
|
|
|
|
|
commands["nyan"] = new BotCommandStructure {
|
2016-10-12 21:58:16 -07:00
|
|
|
|
cmd = new ShitpostingDevice("nyan ", "!~", 2, 12, bot).run,
|
2016-10-27 23:48:58 -07:00
|
|
|
|
hidden = true
|
2016-10-12 21:58:16 -07:00
|
|
|
|
};
|
2016-10-27 23:48:58 -07:00
|
|
|
|
|
|
|
|
|
commands[":^)"] = new BotCommandStructure {
|
2016-10-12 21:58:16 -07:00
|
|
|
|
cmd = (usr, channel, msg) => bot.message(channel, ":^)"),
|
2016-10-27 23:48:58 -07:00
|
|
|
|
hidden = true
|
2016-10-12 21:58:16 -07:00
|
|
|
|
};
|
|
|
|
|
|
2016-10-27 23:48:58 -07:00
|
|
|
|
// commands["box"] = new BotCommandStructure {
|
|
|
|
|
// cmd = cmdBox,
|
|
|
|
|
// hidden = true,
|
|
|
|
|
// role = BotRole.HalfAdmin
|
|
|
|
|
// };
|
|
|
|
|
|
2016-10-12 21:58:16 -07:00
|
|
|
|
events.onMessage += onMessage;
|
2017-02-12 21:13:17 -08:00
|
|
|
|
|
|
|
|
|
postSetup();
|
2016-10-12 21:58:16 -07:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-27 23:48:58 -07:00
|
|
|
|
//
|
|
|
|
|
// cmdBox
|
|
|
|
|
//
|
|
|
|
|
// public void cmdBox(User usr, Channel channel, String msg)
|
|
|
|
|
// {
|
|
|
|
|
// var outp = msg + '\n';
|
|
|
|
|
//
|
|
|
|
|
// for(var i = 1; i < msg.Length; i++)
|
|
|
|
|
// {
|
|
|
|
|
// var ln = msg[i].ToString();
|
|
|
|
|
// ln = ln.PadRight(msg.Length);
|
|
|
|
|
// ln += msg[msg.Length - i];
|
|
|
|
|
// outp += ln + '\n';
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// outp += msg.Reverse();
|
|
|
|
|
//
|
|
|
|
|
// bot.messageRaw(channel, outp);
|
|
|
|
|
// }
|
|
|
|
|
|
2016-10-12 21:58:16 -07:00
|
|
|
|
//
|
|
|
|
|
// onMessage
|
|
|
|
|
//
|
|
|
|
|
public void onMessage(User usr, Channel channel, String msg)
|
|
|
|
|
{
|
|
|
|
|
if(msg.Contains("OLD MEN"))
|
|
|
|
|
bot.message(channel, "WARNING! WARNING!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// EOF
|