Wings – Let’s fly with creativity
A way educators and students or simply curious people can find new tools and stimula to use creatively SL and OpenSIM-
Building your first Educational Bot.
Posted on May 10th, 2009 No commentsBots can be useful in SL for a lot of legal and productive usages, also with reference to educational and didactical needs.
Here for instance a list of tasks an edu bot can do:- Greets effectively people when arriving, giving material of the lesson (this can also be done with scripted objects obviously, but a bot is bit more “personal” and less robotic.
For instance when a person talks close to the bot she can give indications, notecards etc.- Can actually give a sort of automated lesson, acting as a tour guide in a place: you can script what she must chat at any moment, she can receive material from the students, record their IM and chat for future usage.
- Can implement sort of “extra groups”. People can tell the edubot to be enlisted in an educational list and she can give IM, Notecards, objects when instructed grid wide to alert on special events. Using this sparingly (no SPAM), can be a boost for educational places… Be sure when using a bot like that to ask esplicit permission to people enlisting and not doing the process automatically, and letting a way for them to quit..
Many other usages can be thought.. I’m still studying about this.
What IS a bot? It is just a standard avatar, but it is currently logged in with a different program than the client you are using normally. Although there are many bot companies selling their for a huge amount of L$ like Pikkubot, you can make use of free versions. If interested I can provide more help.
What I experimented recently is the libopenmetaverse library which has an interesting demo program:
http://lib.openmetaverse.org/wiki/How_to_create_a_basic_libSL_bot
The demo just enters the bot inworld, greets everyone and quits. I slightly modified it to start a full permission animation and stay inworld for a determined period of time (used in an exhibition to have an “acting” avatar). Bots can run on an external site so that it doesn’t depend on your pc being switched on. Just move the .exe file and run it under a linux server with screen and mono .exe.
Here the method I changed in the demo:
static void Network_OnConnected(object sender) { Console.WriteLine("I'm connected to the simulator, going to greet everyone around me"); client.Self.Chat("Hello World!", 0, ChatType.Normal); Console.WriteLine("Setting the animation"); //client.Self.AnimationStart(new UUID("3772d510-3510-d38e-e56c-93ecc5101122"), true); client.Self.AnimationStart(new UUID("f6aea527-dbff-94df-f42d-532cb3b45ada"), true); //client.Self.AnimationStart(new UUID(animation), true); Console.WriteLine("Now I am going to logout of SL.. Goodbye!"); minutes = 1000000; System.Threading.Thread.Sleep(minutes*60*1000); client.Network.Logout(); }Robo2: Also this interesting GPL2 program gives a bot handler quite interesting and complete: http://trac.robo2sl.org/pages/viewpage.action?pageId=425993
Robo2 allows you to have a fully programmable “agent” and you can instruct her to do a variety of tasks such as:
(here the help notecard given with the project)
These are the currently registered commands: IM | <name> | <text> -- send an instant message to someone (**) WHISPER | <text> -- whisper in public chat SAY | <text> -- speak in public chat SHOUT | <text> -- shout in public chat -- WHO -- check who's around (**) KICK | <name> -- kick a user from an estate (**) BAN | <name> -- ban a user from an estate (**) SECURE -- create a security area (**) LISTSECURE -- list all configured areas (**) DELSECURE | number -- delete a configured area (**) ARM -- activate security for all configured areas (**) DISARM -- DE-activate security for all configured areas (**) -- FOLLOW -- let the bot follow you (**) NOFOLLOW -- let the bot stop following you (**) SIT -- let the bot sit down on the object, which the master last selected (right-clicked) (**) STAND -- let the bot stand up (**) TAXI -- get a teleport offer to whereever the bot is (**) SETHOME -- set the bot's home position (where it always logs in!) (**) GOHOME -- brings the bot back home (**) -- BALANCE -- get current L$ balance (**) PAY | person | amount -- pay someone (**) PAYME | amount -- pay yourself (**) -- FINDKEY | username -- retreive the key of a named avatar (**) FINDNAME | uuid -- retreive the name of an avatar providing a key (**) AGENTINFO | username or key -- retreive info of an avatar (**) FRIENDS -- show friendslist (**) ADDFRIEND | name or key -- add agent to friendslist (**) DELFRIEND | name or key -- remove agent from friendslist (**) -- INVENTORY -- list inventory contents (**) -- ADDUSER | uuid or name | M,C,U -- add a user to the bot controllers (**) DELUSER | uuid or name -- remove a user from the bot controllers (**) -- GROUPLIST -- list groups the bot is in (**) GROUPNOTICE | part of group name or group key | subject | message -- Send a message to a named group (**) GROUPINVITE | part of group name or group key | agent name or key [| part of role name] -- Invite an agent to a named group (**) GROUPEJECT | part of group name or group key | agent name or key -- Eject and agent from a named group (**) -- BLADD | uuid or name -- add someone to the blacklist (**) BLREM | uuid or name -- remove someone from the blacklist (**) LISTBL -- show blacklist (**) WLADD | uuid or name | minutes -- add someone to the temporary whitelist (**) LISTWL -- show whitelist (**) -- STOREPARCEL -- save all settings of the parcel the bot is on (**) RESTOREPARCEL -- restore all settings of the parcel the bot is on (**) -- SPAWN | bot name | password | master name -- spawn another bot QUIT -- shutdown bot (**) Different access levels apply for commands marked (**). You may not be able to execute them. type: 'help <command>' for more details. The bot is based on the Open Source Framework Robo?? for Second Life. Please visit http://www.robo2sl.org to find out more.
-
YouTube display (with php/youtube proxy) opensource.
Posted on April 25th, 2009 No commentsYou can find this at xstreetsl.com here: https://www.xstreetsl.com/modules.php?name=Marketplace&file=item&ItemID=1415280
This tool allows you to show YouTube video in SecondLife or OpenSim.
This was relatively easy to do before April 2009, but when google changed the way mp4 downloading is done (probably to reduce the bandwith overall load on their computers),
older tools stopped working.
This solution works very similarly to previous one but caches the mp4 version temporarily for 6 hours on the php server. This is done to avoid the 3-4 minute delay in asking YouTube converting the video to mp4 and providing a fast link usable by various people for some hours.
Since the hosting space and the bandwitdth of the php server can be rapidly exhausted if all the world will use it I added a simple password that needs to be put on the description of the viewer to enable the tool to work. You can ask me the password if you want to access our community website (http://opensimita.org) or you can upload the two php scripts wherever you want. (You need to create a mp4 folder and set proper access to it).
How to use this tool if you are just using it as *normal* user:
====================================
1\ Rez it. It should give a hint:
Wings.YouTube.May2009: Listening on channel 10 for a youtube url
2\ Change the Object Description with proper password for accessing the website. This password must match that decided by the WebSite owner. You might also need to change the sURL in the internal script if you are not using our community server.
string sURL=”http://opensimita.org/lsl/youtube.php”;
3\ Write in chat
/10 http://www.youtube.com/watch?v=6jPPYrBD0To
writing *exactly* what you put in your browser
a) If you receive something like:
[3:53] Wings.YouTube.May2009: Request to convert video sent, waiting…
[3:53] Wings.YouTube.May2009: Changing mediaparcel to: Invalid password
You need to set the correct password in Object description
b) if everything is ok you should receive the following on public chat:
[3:54] Wings.YouTube.May2009: Request to convert video sent, waiting…
[3:54] Wings.YouTube.May2009: Changing mediaparcel to: http://opensimita.org/lsl/mp4/6jPPYrBD0To.mp4
It it is the first time you decode a youtube movie it can take some 2-3 minutes to decode to mp4, otherwise it should be almost immediate.
4\ if a person touches the screen will receive a load URL to open up an external browser to the same video. This might be very useful if peopel cannot set up properly the client for viewing multimedia content (last resort)
How to setup website if you are an *expert* user
===============================
1\ You must have your php enabled website www.example.com
2\ Open a ftp connection and build a folder “lsl” and a subfolder “lsl/mp4″ give the correct rights to mp4 subfolder so that the webserver can put files there (usually 775 or 777)
3\ copy the youtube.php and the rmtmpmp4.php files under lsl
4\ choose a password and put it into the youtube.php just at the beginning:
<?php
$password=”xxxx”;
5\ communicate this password to people using your website. They must change the :
string sURL=”http://www.example.org/lsl/youtube.php”;
AND the description of the screen object
If you want to change the 6 hours delay prior to deleting cached copies of mp4 you must go
into rmtmpm4.php file and modify the line
$expire_time_hours = 6;
as you prefer
Here are the opensource scripts: main lsl script
// This script is OpenSource protected by CC: by Salahzar Stenvaag, nc, sa // It listen to channel 10 and when chatting a youtube url it will // call an external website obtianing a mp4 version that is then set in media // of current parcel. // // Script is documented also on alisl.org/wings website. // // There are various issues on correctly setting tools like this for multimedia // and group owned parcels. Please have a look for instance to this page // http://wiki.secondlife.com/wiki/User:Salahzar_Stenvaag/classes/StreamingMedia // for better understanding if you have problems. // // This script and php related scripts might not work if google youtube changes // its policies of converting movies in mp4. This has already happened in // April 2009, so it can happen again
// change this to the location where you uploaded the youtube.php and rmtmpmp4.php
// scripts
string sURL="http://opensimita.org/lsl/youtube.php";
// probably you should NOT touch after this point
integer iDEBUG=0; // set this to 1 to have
string sTHEVIDEO;
key kREQ;
DEBUG(string str)
{
if(iDEBUG==1) llSay(0,str);
}
integer iSECRET=1234;
HTTP(string url, list l, integer post)
{
integer i; l+=[ "pass", llGetObjectDesc() ];
integer len=llGetListLength(l);
if(len % 2 == 1) len++;
string body;
for (i=0;i 0 ) body+="&";
body += llEscapeURL(varname) + "=" + llEscapeURL(varvalue);
}
string str;
if(post==1)
{
string hash=llMD5String(body,iSECRET);
str=url+"?hash="+hash+"&"+body;
DEBUG("url called in post: "+str);
kREQ = llHTTPRequest(url+"?hash="+hash,[HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"],body);
}
else
{
str=url+"?"+body;
DEBUG("url called in GET: "+str);
kREQ=llHTTPRequest(url+"?"+body,[],"");
}
}
default
{
on_rez(integer num)
{
llResetScript();
}
state_entry()
{
llListen(10,"",NULL_KEY,"");
llSay(0,"Listening on channel 10 for a youtube url");
}
listen(integer channel, string name, key id, string url)
{
// use the url to call HTTP
HTTP(sURL,[ "url", url ],0); sTHEVIDEO=url;
llSay(0,"Request to convert video sent, waiting...");
}
touch_start(integer num)
{
llLoadURL(llDetectedKey(0),"Go to the video",sTHEVIDEO);
}
http_response(key reqid, integer status, list metadata, string body)
{
if(reqid==kREQ)
{
if(llStringLength(body)==0)
{
llSay(0,"Refreshing request...");
HTTP(sURL,[ "url", sTHEVIDEO ],0);
return;
}
//kREQ=NULL_KEY;
llSay(0,"Changing mediaparcel to: "+body);
llParcelMediaCommandList( [ PARCEL_MEDIA_COMMAND_TYPE, "video/mp4", PARCEL_MEDIA_COMMAND_URL, body, PARCEL_MEDIA_COMMAND_STOP ]);
llParcelMediaCommandList( [ PARCEL_MEDIA_COMMAND_STOP , PARCEL_MEDIA_COMMAND_PLAY ]);
}
}
}
youtube.php script
<? $password="*****"; // this script must be called with ?url= // for instance ?url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3ddrXr82qBRyg%26pippo%3d54%0D%0A // note that url MUST be urlencoded to not confuse HTTP parser // to have enough time for getting translated file set_time_limit(0); // get url from ?url= parameter $url=$_GET["url"]; if($_GET["pass"]!=$password) die("Invalid password"); // get original file from Youtube with the token in it $token = file_get_contents($url,NULL); // define what a "word" is for us $WORD="[A-Za-z0-9_=-]*"; // get name of the video from url scanning v= preg_match_all("/v=($WORD)/",$url,$matches); $vid=$matches[1][0]; $fname="mp4/$vid.mp4"; $extname="http://opensimita.org/lsl/".$fname; if(file_exists($fname) ) die($extname); // check if we already have this file // get token value from content scanning "t": "" preg_match_all("/ \"t\"\: \"($WORD)/",$token,$matches); $token=$matches[1][0]; // ask youtube video in mp4 format $mp4file="http://www.youtube.com/get_video?fmt=18&video_id=". $vid . "&t=" . $token; //echo $mp4file." "; $fp=fopen($mp4file,"rb"); $fp1=fopen($fname,"wb"); while(!feof($fp)) { $buf=fread($fp,256000); fwrite($fp1,$buf); } fclose($fp); fclose($fp1); die($extname); ?>rmtmpm4.php : Remove every 6 hours script called by the previous
<? // Define the folder to clean // (keep trailing slashes) $captchaFolder = 'mp4/'; // Filetypes to check (you can also use *.*) $fileTypes = '*.mp4'; // Here you can define after how many // minutes the files should get deleted $expire_time_hours = 6; // Find all files of the given file type foreach (glob($captchaFolder . $fileTypes) as $Filename) { // Read file creation time $FileCreationTime = filectime($Filename); // Calculate file age in seconds $FileAge = time() - $FileCreationTime; // Is the file older than the given time span? if ($FileAge > ($expire_time_hours * 60 * 60)){ // Now do something with the olders files... print "The file $Filename is older than $expire_time_hours hours\n"; // For example deleting files: // echo "removing $Filename "; unlink($Filename); } } ?> -
Generating multitexture slides to save time and money in uploading and holding slide conferences
Posted on April 14th, 2009 2 commentsCurrently there are many systems for teaching and showing slides in SL and/or OS. Apart from the streaming solutions which are a bit difficult to handle in SL (you need to own expensive land and to set complex deeded objects), slide presenters with image caching are already a good solution. As I told many times I don’t like to spend time and L$ to upload a presentation.
A typical presentation from mine is around 20 slide for 1 hour inworld experience. This would cost 200 L$ which is almost 1 US$. It is not so much, but if I can choose I prefer to spend much less. What about using only 5 uploads i.e. 50 L$, this would be around 20 cents, and it is also much more fast to organize when you upload.
Unluckily the preparation of this smart system can be a bit difficult, but when set up the first time you can use it happily for the other yours presentations
Recipe for the presentation:
0\ The best would be using Zan Printer which offer an embedded JPG printer which automatically produces multi textures without any blank space. You need to rotate the multitextures produced by Zan since they are rotated by 90 degrees.
Video for using zan:
Unluckily Zan Printer is NOT free so here I propose an alternative solution which is free, but needs some extra steps and will have some percentage of wasted space.
1\ I normally use word to prepare my presentations this is because it is much more easy to lay out textual information. If you used Power Point you can use native “export to jpg” mechanism which can be easier. The first step is to export the sequential list of your slides. To export jpg’s from Word you can use the free gnostice printer plugin (http://www.freedownloadmanager.org/downloads/Print2eDoc_58341_p/free.htm) this will add a new printer. Remember to choose as output format jpg and the correct folder where you can find out your images.
Video for installing gnostice and producing JPGs:
2\ Now you need to merge 4 pages in one. I use the contact sheet feature from XnView. Specify all the JPG images in the correct order (order by name) and make contact sheet specifying 2048×208 2×2. And yes you have the final JPG.
Video for producing proper contact sheets:
Next post for the tool inworld opensource making use of this.
-
A script for handling a transparent cursor on slides.
Posted on April 11th, 2009 No commentsThis has been already discussed in the past: if you have some slides and want to point to a specific part of the image you now can with the new features offered from September 2008. Some people did offer some scripting solutions but everytime the software was nomodify and closed. The other interesting point is that we are using only *ONE* prim with a convenient transparent texture so that the script is really simple to write and (possibly to understand).
What I’m offering here is a free and *opensource* solution. Simple to use:
1\ rez your ordinary screen
2\ rez a “glass” i.e. a transparent thin object just in front of your screen and put inside this script:
// Creative Commons: by, nc, sa (attribution, noncommercial, share alike) // Created by Salahzar Stenvaag April 2009 SET() { vector touched=llDetectedTouchST(0); llOffsetTexture(1-touched.x+.025, 1-touched.y+.025, ALL_SIDES); } default { state_entry() { llSetTexture("2ca752b1-894c-bc78-6e49-b021238d6dbc",ALL_SIDES); } touch_start(integer total_number) { SET(); } touch(integer total_number) { SET(); } }
3\ I used a “cursor” made of an empty red circle. You can upload your own texture with your cursor in the bottom left corner. Clicking and dragging the mouse will move and drag the cursor all over so you can use this cursor for everything you need.Salahzar
-
Wings Educational group to have more developments in 2009.
Posted on April 11th, 2009 No commentsDuring this spring we will try start many activities with Wings group. The activities will be on the following points:
- Experimenting various educational tools bridging RealLife with SecondLife and OpenSim (sloodle, moodle, other local tools)
- Setting up a repository sim in SL on Solaris (and / or other sims)
- Establishing a regular schedule of trainings for educators using simple SL tools
Everybody willing to help can contact me inworld (Salahzar Stenvaag)..While waiting for the next developments, I’ve found a very interesting **free** tool for printing from Word or any other powerpoint like program on Windows. Previously the only usable method was to use Zan Printer which was a bit costing (60$). Now you can do it free!!!
These are very useful to spare 75% lindens on uploading textures to SecondLife!!!Here the instructions:
1\ Go to http://sourceforge.net/projects/imageprinter/ and download the zip version of that software.
2\ Unzip it and launch the installer. At the end it will ask you for best configuration: choose JPG and choose folder where you want to store the output (default: c:\)
3\ from word or any other wordprocessor or powerpoint, when printing you can choose a new printer “Image Printer”, tell it to print 4 pages per page and to choose the “landscape” orientation. On advanced if needed you can select a high resolution format (600×600).
4\ You now have in c:\ or wherever you choose many .jpg combined multitextures that can be used with my tools.
NB: First lesson I will give in May will be on how to use these multitexture in sl or os.
-
Welcome aboard…
Posted on March 14th, 2009 No commentsWelcome to Wings group blog. This blog is meant to help understanding the activity of this group. Currently Wings group consists of 31 people, but I want to increase this number
This blog has also been provided for people who don’t have enough groups available and cannot afford to join it inworld.
Activities done in 2009 have been mainly the proposals of 2 meetings during the Monthly Mentor Coach “Week of Learning” in Tenera in February, presenting some free opensource educational tools I made myself.
Currently the tools explained and available are the following:
- A “chalkboard” for interactive production of teaching material (available in English and also Esperanto and easily customizable in other Languages)
- A “Teacher highlighter board” that can be used to highlight part of the slides.There are two videos explaining how to use them:
*
*
Objects will be made available via XStreet and inworld and I will post here location of boots where you can find them. Or IM me Salahzar Stenvaag


