Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

add irc or irc features to sl

StoneSelf Karuna
His Grace
Join date: 13 Jun 2004
Posts: 1,955
05-28-2005 10:12
make chat better in sl by integrating irc clients into the sl client, or by adding irc like features to the sl client.
_____________________
AIDS IS NOT OVER. people are still getting aids. people are still living with aids. people are still dying from aids. please help me raise money for hiv/aids services and research. you can help by making a donation here: http://www.aidslifecycle.org/1409 .
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-28-2005 10:34
and these mythical features you speak of would be...
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
StoneSelf Karuna
His Grace
Join date: 13 Jun 2004
Posts: 1,955
05-28-2005 13:01
From: Strife Onizuka
and these mythical features you speak of would be...

- channels
- channel moderator tools
- client settings like highlighting (irc client thing)
- channel topics, the ability to join a channel (in sl you can only leave a conference once it's been started)
- triggers (this is an irc client thing)
- listing who's on the channel
- maybe being able to talk to people in sl from outside sl
- maybe making to so channel moderators can mass teleport invite people on the channel
- maybe allowing feeds from a place in sl into a channel and vice verse
- channel nicks (with ident on the avatar)

i'll post more when i think of them
_____________________
AIDS IS NOT OVER. people are still getting aids. people are still living with aids. people are still dying from aids. please help me raise money for hiv/aids services and research. you can help by making a donation here: http://www.aidslifecycle.org/1409 .
Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
05-28-2005 13:04
I've thought that global, persistent channels you could join without fear of timing out due to inactivity in a session would be welcome. After all, the 3D world itself is persistent, so why not little chat boxes? :)
_____________________
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
05-28-2005 13:50
From: StoneSelf Karuna
- channels
- channel moderator tools
- client settings like highlighting (irc client thing)
- channel topics, the ability to join a channel (in sl you can only leave a conference once it's been started)
- triggers (this is an irc client thing)
- listing who's on the channel
- maybe being able to talk to people in sl from outside sl
- maybe making to so channel moderators can mass teleport invite people on the channel
- maybe allowing feeds from a place in sl into a channel and vice verse
- channel nicks (with ident on the avatar)

i'll post more when i think of them


Not that I don't like these features, but why have LL spend cycles implementing these features, when it would be just as easy to open an IRC client and run it in tandem with SL?

- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton
Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
05-28-2005 14:04
From: Ace Cassidy
Not that I don't like these features, but why have LL spend cycles implementing these features, when it would be just as easy to open an IRC client and run it in tandem with SL?

- Ace

because when it is build into the client, everyone would be able to use it, and come in contact with eachother more easily. Not everyone knows what IRC is.
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
05-28-2005 14:11
From: Frans Charming
because when it is build into the client, everyone would be able to use it, and come in contact with eachother more easily. Not everyone knows what IRC is.


My point is that, with all of the bugs and issues to be addressed, I'd rather have LL focus on other usability features, and not spend effort reinventing that wheel. Its easy enough to do that without SL that it doesn't need to become part of the SL client.

- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton
Toy LaFollette
I eat paintchips
Join date: 11 Feb 2004
Posts: 2,359
05-28-2005 14:43
I agree with Ace...... there's so many more things that are actually needed.
_____________________
"So you see, my loyalty lies with Second Life, not with Linden Lab. Where I perceive the actions of Linden Lab to be in conflict with the best interests of Second Life, I side with Second Life."-Jacek
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
05-28-2005 16:50
Or you could just run an IRC bot in Second Life and do all of that externally... :rolleyes:

I have one. :D
_____________________
---
StoneSelf Karuna
His Grace
Join date: 13 Jun 2004
Posts: 1,955
05-28-2005 16:51
From: Ace Cassidy
Not that I don't like these features, but why have LL spend cycles implementing these features, when it would be just as easy to open an IRC client and run it in tandem with SL?

1) it's not just as easy to open an irc client.
2) they don't have to do it now
3) it's wierd that ll doesn't use their own tools for internet conferencing.
_____________________
AIDS IS NOT OVER. people are still getting aids. people are still living with aids. people are still dying from aids. please help me raise money for hiv/aids services and research. you can help by making a donation here: http://www.aidslifecycle.org/1409 .
StoneSelf Karuna
His Grace
Join date: 13 Jun 2004
Posts: 1,955
05-28-2005 16:52
From: Ace Cassidy
My point is that, with all of the bugs and issues to be addressed, I'd rather have LL focus on other usability features, and not spend effort reinventing that wheel. Its easy enough to do that without SL that it doesn't need to become part of the SL client.
they can add it to the list of future enhancements.

it also strikes me as low hanging fruit.
after all they're doing the much more difficult thing of adding a webbrowser to the client.
_____________________
AIDS IS NOT OVER. people are still getting aids. people are still living with aids. people are still dying from aids. please help me raise money for hiv/aids services and research. you can help by making a donation here: http://www.aidslifecycle.org/1409 .
StoneSelf Karuna
His Grace
Join date: 13 Jun 2004
Posts: 1,955
05-28-2005 16:53
From: Jeffrey Gomez
Or you could just run an IRC bot in Second Life and do all of that externally... :rolleyes:

I have one. :D
got instructions for how to use it?
_____________________
AIDS IS NOT OVER. people are still getting aids. people are still living with aids. people are still dying from aids. please help me raise money for hiv/aids services and research. you can help by making a donation here: http://www.aidslifecycle.org/1409 .
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
05-28-2005 17:20
It's still in beta form, but I've considered a release.

Requires Python though. Step one is learning how to use that to run .py programs and... you're all set. :)

Example Python Code:

CODE
import socket;
import xmlrpclib;
from xmlrpclib import ServerProxy;
from xmlrpclib import Transport;
import sys;


def llRemoteData(Channel, Int, String):
print chan
client = ServerProxy("http://xmlrpc.secondlife.com/cgi-bin/xmlrpc.cgi")
return client.llRemoteData({"Channel" : Channel, "IntValue" : Int, "StringValue" : String})

def callback():
reply = llRemoteData(chan, 0, "Request: callback.")
print Transport()
stuff = '';
for name, value in reply.iteritems():
print name, value
if name == 'StringValue':
stuff = value
irc.send ( 'PRIVMSG ' + chatchan + ' :' + stuff + '\r\n' );
checkComs(stuff)

def checkComs(replied):
if replied.find( '!nuke' ) != -1:
replied = replied[replied.find( '!nuke' ) + 6:]
irc.send ( 'KICK ' + chatchan + ' ' + replied + ' :Thou shalt be nuked, ' + replied + '\r\n' )


chan = 'Add Channel Said In World Here';
chatchan = '#AddIRCChannelHere'
owner = 'Add Name Here To Use Ops Commands';
backup = 'Alternate Nick for Lower Level Commands';
network = 'irc.easynews.com';
password = '';
port = 6666;

irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM );
irc.connect ( ( network, port ) );
print irc.recv ( 4096 );
irc.send ( 'NICK SLUGBot\r\n' );
irc.send ( 'USER SLUGBot SLUGBot SLUGBot :Python IRC\r\n' );
if password != '':
irc.send ( 'PRIVMSG ' + password + '\r\n' );
irc.send ( 'JOIN ' + chatchan + '\r\n' );
irc.send ( 'PRIVMSG ' + owner + ' :SLUGBot Online! Type !help for commands\r\n' );
first = 1;
while True:
data = irc.recv ( 4096 )
print data
if data.find ( 'PING' ) != -1:
irc.send ( 'PONG ' + data.split() [ 1 ] + '\r\n' )
callback()
elif data.find ( 'PRIVMSG' ) != -1:
nick = data.split ( '!' ) [ 0 ].replace ( ':', '' )
message = ':'.join ( data.split ( ':' ) [ 2: ] )

message2 = message[0:6]
if message.find ( 'ACTION' ) != -1:
message = message[8:len(message) - 3]
message2 = message[0]
if message.find ( '/' ) != -1:
if nick == 'owner' or nick == 'backup':
message = [ 0 ].replace( '/', '' )
irc.send ( message + '\r\n' )
elif message.find ( '!op' ) != -1 and nick == owner:
irc.send ( 'MODE ' + chatchan + ' +o ' + message[3:] + '\r\n' )
elif message.find ( '!deop' ) != -1 and nick == owner:
irc.send ( 'MODE ' + chatchan + ' -o ' + message[5:] + '\r\n' )
elif message.find ( '!nuke' ) != -1 and nick == owner:
irc.send ( 'KICK ' + chatchan + ' ' + message[5:] + ' :Thou shalt be nuked, ' + message[5:] + '\r\n' )
elif message.find ( '!chan' ) != -1 and nick == owner:
chan = message[message.find( '!chan' ) + 6:len(message) - 2]
else:
destination = ''.join ( data.split ( ':' ) [ :2 ] ).split ( ' ' ) [ -2 ]
if destination == 'SLUGBot':
if nick == owner or nick == backup:
destination = 'PRIVATE'
irc.send ( 'PRIVMSG ' + chatchan + ' :' + message + '\r\n' )
reply = llRemoteData(chan, 0, "(" + chatchan + ") SLUGBot:" + message)
stuff = '';
for name, value in reply.iteritems():
print name, value
if name == 'StringValue':
stuff = value
irc.send ( 'PRIVMSG ' + chatchan + ' :' + stuff + '\r\n' );
checkComs(stuff)
print '(', destination, ')', nick + ':', message
if message.find ( '!close' ) != -1:
if nick == owner or nick == backup:
irc.send ( 'PART ' + chatchan + '\r\n' )
irc.send ( 'QUIT\r\n' )
irc.close()
elif message.find ( '!help' ) != -1:
irc.send ( 'PRIVMSG ' + nick + ' :SLUGBot v0.1 - by Thomas Robinson. All Rights Reserved. Usage \r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :Usage:\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' ******\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!shout - shouts message\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!force - force chat request from Second Life\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!scan - scan for avatars in chat range in Second Life\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!wscan - maximum distance scan for shout range in Second Life\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!close - disconnects bot\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!op <username> - ops IRC user\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!deop <username> - deops IRC user\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!nuke <username> - kicks IRC user\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!kill <residentname> - lights up a Second Life users life!\r\n' )
irc.send ( 'PRIVMSG ' + nick + ' :!dance <residentname> - dance!\r\n' )
elif message.find ( '!force' ) != -1:
callback()
callback()
elif destination != 'PRIVATE':
if first == 1:
reply = llRemoteData(chan, 0, "(" + destination + ") " + nick + ":" + message)
stuff = ''
for name, value in reply.iteritems():
print name, value
if name == 'StringValue':
stuff = value
irc.send ( 'PRIVMSG ' + chatchan + ' :' + stuff + '\r\n' );
checkComs(stuff)
#callback();
else:
first = 1


LSL Script in-world. Copy the key it says into the IRC Bot above:

CODE
string bot = ""; // Initialization for bot
list agents = []; // agent list for scan
key gChannel; // my llRemoteData channel
key mess_id; // the message id

list chat_stuff = []; // Text here

DEBUG(list out) { // output debug info
llSay(0, llList2CSV(out));
}

default
{
state_entry()
{
llOpenRemoteDataChannel(); // create an XML-RPC channel
// this will raise remote_data event REMOTE_DATA_CHANNEL when created
}
on_rez(integer total_number)
{
llOpenRemoteDataChannel();
}

remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
{
if (type == REMOTE_DATA_CHANNEL)
{ // channel created
DEBUG(["Channel opened", "REMOTE_DATA_CHANNEL", channel, message_id, sender, ival, sval]);
gChannel = channel;
llSay(0, "Ready to receive requests on channel \"" + (string)channel +"\"");
state go; // start handling requests
}
else
DEBUG(["Unexpected event type", type, channel, message_id, sender, ival, sval]);
}
}

state go
{ // handle requests
state_entry()
{
llListen(0,"","","");
}
remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
{
if (type == REMOTE_DATA_REQUEST)
{ // handle requests sent to us
string msg = llGetSubString(sval,0,llSubStringIndex(sval,":") - 1);
sval = llDeleteSubString(sval,0,llSubStringIndex(sval,":"));
sval = llGetSubString(sval,0,llStringLength(sval) - 2);
llSetObjectName(msg);
if(llSubStringIndex(sval,"!scan") != -1)
{
mess_id = message_id;
llSensor("","",AGENT,30,TWO_PI);
return;
}
else if(llSubStringIndex(sval,"!wscan") != -1)
{
mess_id = message_id;
llSensor("","",AGENT,100,TWO_PI);
return;
}
else if(llSubStringIndex(sval,"!shout") != -1)
{
llShout(0,llDeleteSubString(sval,0,llSubStringIndex(sval,"!shout") + 6));
}
else if(llSubStringIndex(sval,"!kill") != -1)
{
llRemoteDataReply(channel, message_id, "Now attempting to kill " + llDeleteSubString(sval,0,5), 0);
llMessageLinked(LINK_SET, 19000, "kill", (key)llDeleteSubString(sval,0,llSubStringIndex(sval,"!kill") + 5));
return;
}
else if(llSubStringIndex(sval,"!dance") != -1)
{
llRemoteDataReply(channel, message_id, "Dance, " + llDeleteSubString(sval,0,6) + "!", 0);

llMessageLinked(LINK_SET, 19000, "dance", (key)llDeleteSubString(sval,0,llSubStringIndex(sval,"!dance") + 6));
return;
}
else if(llGetObjectName() != "Request") llSay(0,sval);
// handle request
llRemoteDataReply(channel, message_id, llList2String(chat_stuff,0), 0);
if(chat_stuff != [])
chat_stuff = llDeleteSubList(chat_stuff,0,0);
}
else if(type == REMOTE_DATA_REPLY)
{
}
else
DEBUG(["Unexpected event type:", type, channel, message_id, sender, ival, sval]);
}
on_rez(integer total_number)
{
state default;
}

listen(integer chan, string name, key id, string msg)
{
if(llSubStringIndex(msg,"!kill") != -1)
llMessageLinked(LINK_SET, 19000, "kill", (key)llDeleteSubString(msg,0,llSubStringIndex(msg,"!kill") + 5));

else if(llSubStringIndex(msg,"!dance") != -1)
llMessageLinked(LINK_SET, 19000, "dance", (key)llDeleteSubString(msg,0,llSubStringIndex(msg,"!dance") + 6));

else
{
chat_stuff += name + ": " + msg;
if(llGetListLength(chat_stuff) >= 3)
chat_stuff = llList2List(chat_stuff,0,3);
}
}
no_sensor()
{
agents = [];
llRemoteDataReply(gChannel, mess_id, "No agents in range.", 0);
}
sensor(integer total_number)
{
list agents = [];
integer i;
for(i = 0; i < total_number; i++)
agents += llDetectedName(i);
llRemoteDataReply(gChannel, mess_id, "Agents in Range: " + llList2CSV(agents), 0);
agents = [];
}
state_exit()
{
llCloseRemoteDataChannel(gChannel); // clean up when you no longer want to handle requests
}
}


Optional Dance Script:

CODE
default
{
link_message(integer sender, integer num, string str, key id)
{
if(num == 19000 && str == "dance")
{
llSay(0,"Dance " + (string)id + "!");
llSensor((string)id, "", AGENT, 30, TWO_PI);
}
}
sensor(integer total_number)
{
llRequestPermissions(llDetectedKey(0),PERMISSION_TRIGGER_ANIMATION);
}
run_time_permissions(integer perm)
{
if(perm)
llStartAnimation("dance1");
}
}


Optional Griefer Script:

CODE
default
{
link_message(integer sender, integer num, string str, key id)
{
if(num == 19000 && str == "kill")
{
llSay(0,"Die " + (string)id + "!");
llSensor((string)id, "", AGENT, 30, TWO_PI);
}
}
sensor(integer total_number)
{
vector mypos = llGetPos();
llSetStatus(STATUS_PHANTOM, TRUE);
if(llVecMag(mypos - llGetPos()) <= 30)
{
while(llGetPos() != llDetectedPos(0))
llSetPos(llDetectedPos(0));
llPushObject(llDetectedKey(0),<llFrand(10000) - 5000,llFrand(10000) - 5000,5000>,ZERO_VECTOR,FALSE);
while(llGetPos() != mypos)
llSetPos(mypos);
}
llSetStatus(STATUS_PHANTOM, FALSE);
}
}
_____________________
---
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
05-28-2005 17:27
The only real problem with something like this is this is server-less; it uses no external server (other than your home machine) to handle requests.


As such, chat from inside of Second Life will be delayed until:

1) Someone says "!force"
2) Someone says anything in the IRC channel
3) The server pings the IRC bot


At whichpoint it spits out the desired chat.

Since we don't have outbound XML-RPC just yet and I didn't want to spam the pipeline, I wrote it something like that. :(

I'll consider writing it into a timer system eventually, though. :)
_____________________
---