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

SockCraftIrc - Irc in minecraft, Your best choice

Started by Kilobyte, 04 October 2012 - 04:19 PM
Kilobyte #1
Posted 04 October 2012 - 06:19 PM
Hey together,

Here i'm presenting my console based irc client

Features:
  • Channels
  • Private Messages
  • Scripting API (its awesome; see below)
  • Support for additional external monitor
  • Acustic Feedback for Messages that contain your name and PMs (aka. Pings)
Commands:
/msg <receiver> <message> sends a PM
/r <message> replies to the last incoming pm
/me <text> sends an action to the active channel
/bindscript <event> <scriptfile> binds a script to an event
/join #<channel>[,#<channel>…] - Joins a channel
/part [#<channel>] - Leaves a channel. if no channel specified it parts from the current active channel
/change [#<channel>] - Makes a channel the active channel. without arguments it cycles though all avaible channels
and ofc all other irc commands

I told you the scripting API is awesome, right? you don't belive me?
well i actually wrote an lua irc bot for a cc computer that uses the scripting engine. nice, heh?
I'm usually in #ccbots (and ofc #computercraft) on irc. my nick is Kilobyte. just ask me there and i gonna start it :(/>/>

how to install:
Drop contents of zip file into computer folder (usually .minecraft/saves/<savename>/computers/<id>)
This does NOT work in rom yet

how to run:
run these commands on the ingame computer:

cd /SockCraftIrc/
irc <side> <server> <port> <Nick> #<channel> [<monitor_side>]
side = side where the webinterface is connected
server = the server to connect (ie. irc.esper.net)
port = the Port to connect on (ie 6667)
nick = your nick (ie Kilobyte)
channel = the channel to connect to (ie. #computercraft)

Download:
Version 2.1.1

Information:
This script requires my Socket peripheral in order to work. Its avaible here
Changelog:
Version 2.1.1:
Changed: A few API changes

Version 2.1:
Added: support for multiple channels
New Commands: /change, /join, /part
Added: Kick and Mode events are now displayed
Added notice support (or was that already in last version? i forgot it lol)
Fixed: The File irc has now content

Version 2.0
Initial release on computercraft.info

And now go ahead and chat.

P.S. ignore the changelog in main.lua :D/>/>
Cranium #2
Posted 04 October 2012 - 07:31 PM
Too bad Computercraft can't talk directly to IRC via HTTP…or an existing, free service. I hate having to use dependencies… I'll see if I can get this on a server I play on.
Kilobyte #3
Posted 11 October 2012 - 12:14 PM
Btw. i updated to 2.1.
It now supports multiple channels
i also fixed a few bugs
Leo Verto #4
Posted 12 October 2012 - 07:25 PM
I don't understand the tArgs returned by the API.
Figured them out:
tArgs[1] is the sender
tArgs[2] is the channel the message has been sent on
tArgs[3] to tArgs[x] is the message split into words.
Kilobyte #5
Posted 15 October 2012 - 05:09 PM
instead of tAgs use data. its a global table i added in version 2.1.1:
data[1] = Sender
data[2] = Channel or for PM triggered scripts same as data[1]
data[3] = Message
data[4] = Current nick

This list will expand.
TehTotalPwnage #6
Posted 12 November 2012 - 11:35 AM
Got an error:

bios:338: [string "main.lua"]: 245:then expected