an idea. - SLUniverse Forums


Scripting Discuss scripting and programming for SL and other platforms

 
Reply
 
LinkBack Thread Tools Display Modes
Old 10-06-2017, 01:22 AM   #1 (permalink)
Andi
Sox
 
Join Date: Nov 2010
Location: Utah
Posts: 710
My Mood:
Business: Drew's Loose ends
Client: anything that works
an idea.

well an idea for my bot trying to figure out how to do it.

Email each time it teleports using a change teleport event.

now the real question is, since I work better with examples. can anybody point me in any general example scripts, I can typically mash things together and get them working.

Thankies
__________________


Andi is offline   Reply With Quote
Old 10-06-2017, 07:17 AM   #2 (permalink)
Senior Member
 
Sei Lisa's Avatar
My first name is Sei
 
Join Date: Aug 2013
Posts: 206
My Mood:
Here is an example:

PHP Code:
default
{
    
state_entry()
    {
        
llSay(0"Hello, Avatar!");
    }

    
touch_start(integer num_detected)
    {
        
llSay(0"Touched.");
    }

That script emits a message in chat when it starts, and another message when it is touched. It shouldn't be much of a problem for you to remove one of the events and replace the other with a changed event, adding a check for CHANGED_TELEPORT. Use the wiki's search function to find the changed event usage and examples.

Since you want to send an email instead of using local chat, you'll also have to replace the llSay command with llEmail. Use the wiki's search function to find llEmail usage and examples.
__________________
Tools for scripters that I'm the maintainer of:
LSL-PyOptimizer (NEW: Try it online!) | LSL Calculator | Unofficial LSL Reference Wiki | LSL Keywords Database
Sei Lisa is offline   Reply With Quote
1 User Said Thanks:
1 User Likes This:
Old 10-06-2017, 07:40 AM   #3 (permalink)
Andi
Sox
 
Join Date: Nov 2010
Location: Utah
Posts: 710
My Mood:
Business: Drew's Loose ends
Client: anything that works
Yes sei, I was looking for examples of how to properly make it function, and the hello world script rofl.
Andi is offline   Reply With Quote
Old 10-06-2017, 02:52 PM   #4 (permalink)
Ginger Supremacist
 
Ramen Jedburgh's Avatar
Heya ^_^
 
Join Date: Apr 2010
Location: Illinois, USA
Posts: 5,043
My Mood:
SL Join Date: 3/9/2006
Client: Firestorm
Quote:
Originally Posted by Sei Lisa View Post
Here is an example:

PHP Code:
default
{
    
state_entry()
    {
        
llSay(0"Hello, Avatar!");
    }

    
touch_start(integer num_detected)
    {
        
llSay(0"Touched.");
    }

That script emits a message in chat when it starts, and another message when it is touched. It shouldn't be much of a problem for you to remove one of the events and replace the other with a changed event, adding a check for CHANGED_TELEPORT. Use the wiki's search function to find the changed event usage and examples.

Since you want to send an email instead of using local chat, you'll also have to replace the llSay command with llEmail. Use the wiki's search function to find llEmail usage and examples.
Now make it yell to the entire sim "BAD TOUCH! NO STOP HELP ANYONE!"
__________________
--
Ramen Jedburgh

http://allaroundthegrid.blogspot.com/
Ramen Jedburgh is offline   Reply With Quote
1 User Laughed:
1 User Said Thanks:
Old 10-06-2017, 06:19 PM   #5 (permalink)
Andi
Sox
 
Join Date: Nov 2010
Location: Utah
Posts: 710
My Mood:
Business: Drew's Loose ends
Client: anything that works
I've got one that yell's it needs an adult lol.
Andi is offline   Reply With Quote
Old 10-06-2017, 07:34 PM   #6 (permalink)
SUPER BANNED

*SLU Supporter*
 
Free Xue's Avatar
I'm just a girl, with some horns
 
Join Date: May 2009
Posts: 51,899
My Mood:
SL Join Date: May 2008
Blog Entries: 10

Awards: 2
SLU Creepy Avatar Competition 2014 Participant 
Quote:
Originally Posted by Sei Lisa View Post
Here is an example:

PHP Code:
default
{
    
state_entry()
    {
        
llSay(0"Touch, I remember touch");
    }

    
touch_start(integer num_detected)
    {
        
llSay(0"I need something more");
    }

Daft Punked it for ya.
__________________
Mass starvation of virtual bunnies due to a cease and desist order. Now THAT is Second Life!
la lucha sigue...
Free Xue is online now   Reply With Quote
1 User Said Thanks:
Old 10-06-2017, 07:57 PM   #7 (permalink)
Senior Member
 
Join Date: Mar 2017
Posts: 196
sometimes things can go a bit wonky on region changes due to a race condition in resolving all the components being transferred. (agent/avatar + attachments + scripts + object the agent may be sitting on)

a way this can be ameliorated to some extent is to delay things for some time. This can be done in a number of ways. A simple example is:

PHP Code:
sendEmail()
{
   
// collate info
   // then send collation in email  
};


default
{
   
changed(integer c)
   {
      if (
CHANGED_REGION)
         
llSetTimerEvent(3.0);  // wait 3 seconds or whichever time delay
   
}

   
timer()
   {
      
llSetTimerEvent(0.0);
      
sendEmail();     
   } 

irihapeti is online now   Reply With Quote
1 User Said Thanks:
Old 10-11-2017, 05:32 AM   #8 (permalink)
Andi
Sox
 
Join Date: Nov 2010
Location: Utah
Posts: 710
My Mood:
Business: Drew's Loose ends
Client: anything that works
Thanks guys I got it working, I've got some bugs to work out of it still. but that should not be to hard to do.

edit: bugs removed (I know scary, sl is full of features)

Last edited by Andi; 10-11-2017 at 05:44 AM. Reason: because I got rid of the bugs,
Andi is offline   Reply With Quote
Old 10-11-2017, 09:14 PM   #9 (permalink)
Just call me Beth
 
Aribeth Zelin's Avatar
Singing along with old music
 
Join Date: Mar 2011
Location: Out in the mists
Posts: 8,683
My Mood:
SL Join Date: Oct 4 2009
Business: Moondrops ; Tempus Fugit; Faerycat Designs; sPunk
Client: Firestorm
Quote:
Originally Posted by Ramen Jedburgh View Post
Now make it yell to the entire sim "BAD TOUCH! NO STOP HELP ANYONE!"
When I first started learning to script in SL I got into a communications class [yeah, that and physics, because deep end]. And the very first thing was the default script. I changed it to say 'Me not that kind of cube' I think it slayed everyone, because we hadn't gotten to changing it yet.

Quote:
Originally Posted by Andi View Post
Thanks guys I got it working, I've got some bugs to work out of it still. but that should not be to hard to do.

edit: bugs removed (I know scary, sl is full of features)
Woot!
__________________

Aribeth Zelin is offline   Reply With Quote
2 Users Like This:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On




SEO by vBSEO