unrealircd_mods/man/fantasy.md

3.3 KiB

fantasy

Fantasy commands may sound familiar if you're using Anope IRC services or have fucked with InspIRCd at some point. They're basically aliases for certain commands and are visible to other users, since they're generally called like !cmd dicks. Unreal provides aliases too but afaik that only works for /cmd dicks, which isn't visible to others. You can also change the command prefix to like ?cmd or \cmd or whatever you want (one character max), just not /cmd. ;] It also supports a few special inline variables, more on that bel0w.

Furthermore, these aliases are limited to channel messages. There's not much you can do in private messages anyways, besides maybe ACTION shit.

Keep in mind messages similar to !!cmd (like, more than one leading cmdchar) are ignored, as well as messages starting with any other character

Special variables:
I'll put these before the config block so you'll have that info before you get to it. ;] You can use all the special variants for $1 through $9.

  • $chan => Will obv be replaced with the channel you dumped the command in
  • $1 => Will be replaced with the user's first argument
  • $1- => Becomes the first argument plus everything after it (greedy)
  • $1i => If the first arg is a nick, replace it with their ident/username
  • $1h => If the first arg is a nick, replace it with their hostname

You cannot use multiple greedy vars however, raisins should be obvious.

Config block:
Creating aliases might be a bit complex, so I'll just dump an example config right here and explain in-line with comments. =]

fantasy {
	// Change command prefix to \, so it becomes \dovoice etc
	//cmdchar \;

	// "!dovoice urmom" results in "/mode $chan +v urmom"
	dovoice         "MODE $chan +v $1";
	unvoice         "MODE $chan -v $1";

	// "!fgt urmom" is turned into "/kick $chan urmom :ayyyyy ur faget"
	fgt             "KICK $chan $1 :ayyyyy ur faget";

	// "!bitchnigga urmom dickface" results in a separate "/kick $chan $nick :nigga b0iiii" for both urmom and dickface
	bitchnigga      "KICK $chan $1- :nigga b0iiii";

	// "!ayylmao urmom u goddam fuckstick" becomes "/kick urmom :u goddam fuckstick"
	ayylmao         "KICK $chan $1 :$2-";

	// "!invex urmom" is majikked into "/mode $chan +I *!*@urmom.tld"
	invex           "MODE $chan +I *!*@$1h";
	uninvex         "MODE $chan -I *!*@$1h";

	// "!safe urmom" will become "/kick $chan urmom :$chan is a safe space lol m8 urmom"
	safe            "KICK $chan $1 :$chan is a safe space lol m8 $1";

	// It is also possible to have the same alias issue multiple commands ;]
	safe            "MODE $chan +b *!*@$1h";

	// You can also go through ChanServ, provided you have access with it
	n               "PRIVMSG ChanServ :KICK $chan $1 change your nick and rejoin lol";

    // Set a channel to registered-only and muted
    floodprot       "MODE $chan +Rm";
};

As you may have noticed there are some colons in there. These are required, because otherwise there's no telling where the target arg stops and the message begins. Also, in case you do !devoice (so without ne args) it will try and voice the user who issued it. Permissions for using the resulting command are eventually (and automajikally) checked by the internal do_cmd() call I have in hur. ;3