This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tiin57's profile picture

Mikhail 1.4 - IRC bot with Lua plugin support!

Started by Tiin57, 09 March 2013 - 01:10 AM
Tiin57 #1
Posted 09 March 2013 - 02:10 AM
After the original failure of Mikhail several months ago, I rewrote the bot three times. Doing so has produced two things; the ReflectX API (https://github.com/tiin57/ReflectX) and Mikhail 1.4. Mikhail 1.4 is a fully-fledged bot written in Java with the PircBotX framework. Of course, it's not just Java. There is currently full sandboxing for Lua and Beanshell (Java in script form).
You can create a Beanshell plugin (probably a command) for Mikhail (with full access to Java APIs).
IRC commands:
$wget <url> /bsh/def_example.bsh (Don't use pastebin or anything with a ? or &amp; in the URL; those are currently broken)
$loadscript bsh /bsh/def_example.bsh
$example
An example Beanscript plugin can be found here.
There is currently no plugin creation using Lua; I am working on it, though.
You can create a Lua plugin (probably a command) for Mikhail.
IRC commands:
$wget <url> /lua/def_example.lua (Don't use pastebin or anything with a ? or &amp; in the URL; those are currently broken)
$loadscript lua /lua/def_example.lua
$example
An example Lua plugin can be found here.
The parameter e is a org.pircbotx.hooks.events.MessageEvent Java object converted to Lua userdata. Just think of it as a Lua object. The documentation for Mikhail's IRC API (sendMessage(), getChannel(), and more) can be found at http://site.pircbotx...docs/index.html
You'll want to look for org.pircbotx.PircBotX and org.pircbotx.hooks.events.MessageEvent, as those will be the most used. There is a pre-defined variable in Mikhail's Lua environment; bot, which is the PircBotX instance that governs Mikhail.
Github: https://github.com/tiin57/mikhail

Mikhail lives 24/7 in #ccuniversity on irc.esper.net, unless I am testing him.
If you want to try out the dynamic plugins, just ask a bot-op to op you; they might.
Command reference: http://nechalon.com/mikhail/help/index.html
CHANGELOG:
Spoiler1.4: Added Lua plugins and some bugfixes.
1.3: Added dynamic scripting, Beanshell plugins
1.2: Bleh
1.1: Bleh
1.0: Bleh
Cranium #2
Posted 09 March 2013 - 06:13 AM
It would be nice if you can post some examples of what mikhail can do. Like a command->response grid.
superaxander #3
Posted 09 March 2013 - 09:43 AM
Awesome
Sammich Lord #4
Posted 09 March 2013 - 11:43 AM
Looks pretty cool.
lieudusty #5
Posted 09 March 2013 - 03:46 PM
Awesome looking
superaxander #6
Posted 10 March 2013 - 09:21 AM
how to install/use this?
Tiin57 #7
Posted 10 March 2013 - 11:38 AM
how to install/use this?
I'll be pushing compiled jars to the repository at some point, but right now, Javacraft is imminent. Duty calls!
Tiin57 #8
Posted 15 March 2013 - 01:09 AM
Mikhail now has a full Lua sandbox! Lochie was kind enough to mess with some functions and fix a few sandbox issues. Once he pastebins that, I'll be able to push an update to the MBIOS.
Cranium #9
Posted 15 March 2013 - 03:32 AM
Lochie was kind enough to mess with some functions and fix a few sandbox issues.
No….he totally broke your bot. It was hilarious.
Tiin57 #10
Posted 15 March 2013 - 04:45 AM
Yeah… He kind of did.
Tiin57 #11
Posted 20 March 2013 - 02:45 PM
Added a ton of stuff, including a wget command, Beanshell support, and DYNAMIC PLUGINS AT LAST!
1.3.
Tiin57 #12
Posted 22 March 2013 - 03:19 PM
Finally, I have created dynamic Lua plugins for Mikhail! Version 1.4 is now released!
Cranium #13
Posted 27 March 2013 - 05:15 PM
You need much better documentation on Mikhail. Such as what each of your functions do. Not everyone knows java.
Tiin57 #14
Posted 28 March 2013 - 12:10 AM
Yeah, just give me a bit to make a webpage for documentation.
superaxander #15
Posted 28 March 2013 - 12:21 AM
I am gonna try to recreate this myself(just a challenge for myself)
Tiin57 #16
Posted 28 March 2013 - 01:12 AM
I am gonna try to recreate this myself(just a challenge for myself)
Good luck; it took me three months to get to this point.
Sammich Lord #17
Posted 28 March 2013 - 04:14 AM
I am gonna try to recreate this myself(just a challenge for myself)
I suggest using Node.js for your bot. With the way Node.js works it is VERY easy to make IRC bots. From what I have looked at it is probably the best language to use for an IRC bot.
superaxander #18
Posted 28 March 2013 - 04:17 AM
I am gonna try to recreate this myself(just a challenge for myself)
I suggest using Node.js for your bot. With the way Node.js works it is VERY easy to make IRC bots. From what I have looked at it is probably the best language to use for an IRC bot.
I do it the same way as tiin using java with the PircBot framework thingy
Tiin57 #19
Posted 28 March 2013 - 04:25 AM
I am gonna try to recreate this myself(just a challenge for myself)
I suggest using Node.js for your bot. With the way Node.js works it is VERY easy to make IRC bots. From what I have looked at it is probably the best language to use for an IRC bot.
I do it the same way as tiin using java with the PircBot framework thingy
*"I do it the same way as tiin, using Java and the PircBotX framework."
GRAMMAR.
PROPER NOUNS.
RARGH.
superaxander #20
Posted 28 March 2013 - 04:39 AM
I am gonna try to recreate this myself(just a challenge for myself)
I suggest using Node.js for your bot. With the way Node.js works it is VERY easy to make IRC bots. From what I have looked at it is probably the best language to use for an IRC bot.
I do it the same way as tiin using java with the PircBot framework thingy
*"I do it the same way as tiin, using Java and the PircBotX framework."
GRAMMAR.
PROPER NOUNS.
RARGH.
I am sorry English is not my first language(I am however the one with the highest scores in the class) so I may have not learned everything
Cranium #21
Posted 04 April 2013 - 09:21 AM
So yeah. I have yet to see any helpful documentation. You linked to the classes in Java, but you don't have anything documented for how I can make a plugin. All I want to know is what functions return what values or actions. I can do the rest.
Tiin57 #22
Posted 04 April 2013 - 09:26 AM
So yeah. I have yet to see any helpful documentation. You linked to the classes in Java, but you don't have anything documented for how I can make a plugin. All I want to know is what functions return what values or actions. I can do the rest.
Right…
Well, I'm currently on vacation in the southwest US with unreliable Internet access, but I'll try to get something out.
Cranium #23
Posted 04 April 2013 - 09:41 AM
Okay. No probs, I just think this would be more for me getting my foot in the door for learning Java.
Smiley43210 #24
Posted 07 April 2013 - 12:39 AM
Awesome job, it's pretty cool