Send an instant message

From libopenmetaverse - libomv - Developer Wiki

Jump to: navigation, search

Contents

Prerequisites

The following prerequisites are required in order for you to create your first bot by following this tutorial.

Real World

  • This tutorial assumes that you were able to successfully build libsecondlife! If you have not compiled libsl, please follow the instructions on the Getting Started wikipage.
  • Also, if you have no experience with the C# (c-sharp) programming language, I highly recommend that you stop now and please follow the list of links to csharp tutorials located here.

The Code

Note: We are assuming that our main "GridClient" instance is named "Client." If you have a different name for this variable, please substitute the name accordingly

 
UUID target = new UUID("243dd044-1127-11dc-8314-0800200c9a66"); 
//That key goes no where, replace it with the avatar key of the person you want to IM
Client.Self.InstantMessage(target, "Hello, World!");
 

Parameters:

  • target (UUID) The key of the avatar you want to instant message
  • message (string) The message you want to send them
  • sessionID (UUID) [OPTIONAL] The UUID of the instant message session, can be found when you recieve an instant message from someone

Notes