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.
https://github.com/libraryaddict/IRC
I'm actually working on something called ExtremeAPI you don't mind me using your source code do you? It would really help me out! :)
@Libraryaddict The IrcQuitEvent doesn't seem to be working. Doesn't run when someone quits the IRC channel
HELLO LIBRARYADDICT
If you like, I can setup the page for ya.. No probs.
@Ikadmin
Whats wrong with it?
Update?
I made my own listener, works great! Thanks :)
@Ikadmin
You will need to make a custom listener.
But yes.
So, I can make it so vote rewards are said on more than 1 server at a time?
@zack6849
Irc quit event is when they quit?
Could you perhaps add a functionality to see what channel someone leaves in the ircquitevent??
@CeramicTitan
That would be requiring to look up their hostname.
Theres a logging feature in this somewhere, Try enable that then do a whois
Would it be possible to do i geographical look up with this api?
@zack6849
I don't think so
I cant seem to find a method to get the ip address of a user in the irc, is there a way to do this?
@libraryaddict Thanks!
@breezeyboy
Thats already in.
You are probably using a old version.
Once you have your thingy.
Such as
Just use
As for their modes.
That just converts their modes into a ranking format from 0 (none) to 5 (owner)
You can also use
@libraryaddict
Like there are mode like owner and that mode is +q, i think the prefix for that is ~ because i wanna set up a console system
Also, there is no rawsend above, please add it :P
@breezeyboy
Use sendRawLine to send irc commands which are not in the api.
As for irc mode you mean what exactly?
@libraryaddict
Thanks!!!!!!!!!!!! please add support to see what irc mode there are! && support for sending irc commands!
/me starts coding