Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Basic Question - Script that says something on a chat channel?

Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
02-08-2009 04:00
I'm guessing this will either be, so easy it's stupid, or no you can't do that!

All I'm after is:

To creat a prim, then when I (and only I) click on it, it then effectivly says:


/99menu


Into local chat.

This (I'm hoping) would then trigger something else nearby that's listening on the /99 channel.

Easy?
Not possible?

Thanks :)
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
So easy :)
02-08-2009 04:23
CODE

touch_start(integer num)
{
if (llDetectedKey(0) == llGetOwner()) llSay(0,"/99 menu");
}
Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
02-08-2009 04:59
From: Ron Khondji
CODE

touch_start(integer num)
{
if (llDetectedKey(0) == llGetOwner()) llSay(0,"/99 menu");
}


Excellent, and many thanks.
Made a prim, put the code in, and got it to work (click and it says /99menu) meaning it comes up at the bottom left of my screen in green type.

However, there must be something different between what this is doing and actually typing it into local chat by hand.

As I say, there's a script that is listening on channel 99 (in this case) and when you type "/99menu" in local chat, this other script pops up a menu

However, when this script says it's "/99menu" in green. Nothing happens (the other script I guess cannot hear it?)

Any thoughts?

:)
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
02-08-2009 05:18
Why not use channel 99?
CODE

touch_start(integer num)
{
if (llDetectedKey(0) == llGetOwner()) llSay(99," menu");
}
_____________________
From Studio Dora
Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
02-08-2009 06:06
From: Dora Gustafson
Why not use channel 99?
CODE

touch_start(integer num)
{
if (llDetectedKey(0) == llGetOwner()) llSay(99," menu");
}


Thanks for this.

The 1st suggestion by Ron, did actually put the text (in green) /99menu on the screen, though it did not trigger the other local item to "hear" the word "Menu" on channel 99

I tried your suggestion of using 99 in the 1st place, but nothing at all seems to happen.
Nothing comes up on screen (I guess cos it's not on channel 0" and the other item that's listening for the "menu" work on 99 does not pick it up.

Obviously (at the moment) it seems that typing into local yourself

/99menu

Is doing something different than the suggestions so far.

Unless being new I've messed up the script layout? (It could well be !!!)

Here is the total I put in the script (based on the 2nd idea)

==========================================

default
{
touch_start(integer num)
{
if (llDetectedKey(0) == llGetOwner()) llSay(99," menu";);
}

}

==========================================
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
02-08-2009 07:05
it's probably only listening for the owner.

try this

default
{
touch_start(integer num)
{
if(llDetectedKey(0) == llGetOwner())llDialog(llDetectedKey(0),"click a button",["menu", "cancel"],99);
}
}
}

of course the cancel button isn't needed, as it doesn't really do anything
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
02-08-2009 07:09
You have a leading space in front of " menu".

However I suspect Ruthven has the correct approach.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
02-08-2009 07:18
From: Ruthven Willenov
it's probably only listening for the owner.

try this

default
{
touch_start(integer num)
{
if(llDetectedKey(0) == llGetOwner())llDialog(llDetectedKey(0),"click a button",["menu", "cancel"],99);
}
}
}

of course the cancel button isn't needed, as it doesn't really do anything



Absolutly FANTASTIC.

Works perfectly

Many many many MANY thanks :)
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
02-08-2009 07:22
hmm, Suezanne, that IE script you have linked in your signature, i just installed it, but it doesn't seem to be working
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-08-2009 07:50
From: Ruthven Willenov
hmm, Suezanne, that IE script you have linked in your signature, i just installed it, but it doesn't seem to be working

That script works with IE Pro, not IE.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
02-08-2009 08:13
From: Jesse Barnett
That script works with IE Pro, not IE.

IE7Pro is an add-on to Internet Explorer 7 that, along with a number of other functions, allows Javascript userscripts in Internet Explorer, similar to how Greasemonkey allows userscripts in Firefox. Once you've installed IE7Pro, you should then be able to install the userscript for fixing up our broken forum vBCode.

So IE7Pro works with IE, and the userscript works with IE through IE7Pro.

I have a thread started in Resident Answers on that topic, so either that thread or the BBCode Emulation sticky thread would be a better place to discuss it than this thread. Fortunately the OP's question has been answered.

The thread I started in hopes of getting some BBCode relief for Internet Explorer users is at /327/e0/306236/1.html , titled "Help with BBcode for IE7 users".

Note that I did not write the javascript, it was written by SL user Protector Cone . Since the source code is viewable Javascript, it can be modified, so if it's not working for Ruthven then perhaps it can be made to work.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
02-08-2009 17:25
i did install IE7Pro. i checked to make sure everything is enabled. i can look at the same page in firefox and it's formatted correctly, but on IE i still see the php tages and all that. i also don't like how IE7Pro opens a new tab when i type an address. maybe i didn't read into it enough to see if i could turn that off. i just installed it real quick before i headed to work. it's all good though, i'll just stick with firefox.
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-08-2009 17:32
From: Ruthven Willenov
i did install IE7Pro. i checked to make sure everything is enabled. i can look at the same page in firefox and it's formatted correctly, but on IE i still see the php tages and all that. i also don't like how IE7Pro opens a new tab when i type an address. maybe i didn't read into it enough to see if i could turn that off. i just installed it real quick before i headed to work. it's all good though, i'll just stick with firefox.

php tags and quotes are not built in to that scripts. It is barebones basic and will enable urls, images, bold, underline and italic:

CODE

// ==UserScript==
// @name Second Life Forum BBCode Parser
// @namespace http://iescripts.org
// @author Protector Cone
// @include http://forums.secondlife.com/*
// @description Parse BBCode on the Second Life fora.
// @date 6-2-2009
// @version 1.0
// ==/UserScript==


(function(){

var div, content, mat, reg;
var divs = document.getElementsByTagName('div');
for (var i=0, j=divs.length; i<j; ++i){
div = divs;
if (div && div.id && div.id.slice(0,13) == 'post_message_'){
content = div.innerHTML;
if (content){
// URL
content = content.replace(/\[url\](.+?)\[\/url\]/gi,'<a href=$1>$1</a>');
content = content.replace(/\(.+?)\[\/url\]/gim,'<a href=$1>$2</a>');
// img
content = content.replace(/\[img\](.+?)\[\/img\]/gi,'<img src=$1>');
// b
content = content.replace(/\[b\](.+?)\[\/b\]/gi,'<b>$1</b>');
// i
content = content.replace(/\[i\](.+?)\[\/i\]/gi,'<i>$1</i>');
// u
content = content.replace(/\[u\](.+?)\[\/u\]/gi,'<u>$1</u>');
div.innerHTML = content;
}
}
}
})();
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
02-08-2009 19:31
From: Ruthven Willenov
i'll just stick with firefox.
The thought of people switching from Firefox to IE never entered my head.

Ha ha ha, people switching from FF to IE, whoo hooo!!!! LOL!

The script is for people who for whatever reason don't want to switch from Internet Explorer.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
02-08-2009 20:03
sometimes it freezes up and/or takes forever to load a page, i really only switched to firefox so i could install greasemonkey.
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
02-08-2009 20:08
From: Ruthven Willenov
sometimes it freezes up and/or takes forever to load a page, i really only switched to firefox so i could install greasemonkey.

You could try chrome, if memory serves, you can install a Greasemonkey for Chrome, and Strike's script, one that works in Firefox, will work there.

I wish that Strife would give a try to working on a "BBCode in Text for IE" script, but I think he may dislike Internet Explorer enough to make that unlikely.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-