Irc Api
IrcApi
This is a plugin which acts as a bridge between Minecraft and Irc.
By itself this plugin does nothing, So you hook into it.
You can then use the plugin to control an Irc bot!
The bot's behavior must be dictated by you.
You could just use PircBot instead of this plugin, You will suffer some discomfort as its not easier but overall it will give you a slight performance boost.
But the benefit of this is that you can hook more then one plugin into the Irc bot.
As well as its a simple drag and drop and hooking some stuff into your plugin.
Update!
In IrcApi 4.0 you can now toggle delays between IRC and the bot.
Just use disableDelay(), enableDelay() and isDelay()
In IrcApi 3.0 it now supports multiple IRC servers and connections.
You need to make a new instance of the api per server. And a defining bot name each instance.
If you simply just want one bot in your plugin then you do not have to worry about a botname.
This uses PircBot which is a java IRC Api.
But this has been changed as to provide events and be useable by plugins.
Instead of a single plugin making the connection you can hook your plugins into this single API.
To use the IRC functions hook onto IrcApi.
Such as this
IrcApi irc = new IrcApi();
Or if you want to create another. You can simple just do this.
No limits.
IrcApi irc1 = new IrcApi("BotName");
Then you can easily use
irc.connect(ServerIp);
etc.
Its recommended you do this first however
irc.setName(MyName);
Else your bot will attempt to join the server as "PircBot"
All the API functions for PircBot are there.
The API docoments for using PircBot.
http://www.jibble.org/javadocs/pircbot/index.html
If a event is missing or needs extending, Don't try to use the native PircBot way to get your events.
You will have to modify the API itself to fire the events or ask me to add them.
Try not to link to PircBot itself as quite frankly instead of using the previous connection I'm fairly sure you will be making a new IRC client.
And it would be far better to use the PircBot API instead of my API if you plan to use your own IRC stuff.
Source is included inside the file.
Currently the Bukkit Events inside it are not all the events it can do. But its the majority of the ones you need.
This also features automatic coloring and formatting switching between IRC and MC.
To install this on your server just drag and drop into your plugins folder
Then hook your plugins into it.
A few IrcApi events
- IrcJoinEvent - Fires when someone joins a channel
- IrcMessageEvent - Fires when someone says something in a channel
- IrcPrivateMessageEvent - Fires when someone messages you
- IrcNoticeEvent - Fires when someone notices you
- IrcActionEvent - Fires when someone does a action eg /me slaps everyone with a fish
- IrcKickEvent - Fires when someone has been kicked from a channel (Possibly us)
- IrcQuitEvent - Fires when someone quits the server. (Possibly us)
IrcApi irc = new IrcApi();
IrcApi irc1 = new IrcApi("lib");
public void onEnable() {
//register events
irc.setName("KingKong");
irc1.setName("library");
irc.connect("irc.myserver.com");
irc1.connect("irc.myserver.com");
irc.joinChannel("#AChannel");
irc1.joinChannel("#AChannel")
irc.sendMessage("#AChannel", "KingKong has entered the building!");
irc1.sendMessage("#AChannel", "This API is awesome KingKong!");
irc.sendMessage("libraryaddict", "Im private messaging you library!");
}
@EventHandler
public void onChat(IRCMessageEvent event) {
Bukkit.broadcastMessage("<" + event.getNick() + "> " + event.getMessage()); //Just broadcasted what they said as if they were ingame.
}
I apologize for the bad formatting however I am not used to this.
Bukkit dev's formatting is very strange to me.
If someone would like to help me or setup the page for me.
I would be very thankful.
@zack6849
Yes.
I use
@libraryaddict
Awesome! cant i just get the player chat event and send that message to the irc channel with this?
Update!
Uploaded new api. This supports more then one server. Was requested by deathcrazyuberlironman
You can do this by adding a string to your instance call. Such as IrcApi irc = new IrcApi("MyNewBotName");