Projects

  • Universal Translator (Yandex Edition)

    Important note:

    As noted by sninksnoodle on Oct 27, 2020, Yandex does not provide free API keys anymore (#1). The main goal of this fork was to provide an free alternative to Google Translate, so the project is now obolete.

    However, this code also fixed a couple of bugs in the available version of Hank Hamos Universal Translator (which dates 2015), so it might be worth to catch and bring these fixes to the Google Translate version.

    Original readme

    It is based on the excellent Universal Translator by Hank Ramos. However, the initial version was using Google translation engine API and Google decided to switch to a paid license. So I rewrote some parts of the code to use Yandex engine instead.

    Get the latest version in Speculoos’ grid speculoos.world:8002:Lab or on the git repository https://git.magiiic.com/opensimulator/Universal-Translator-Yandex (and if you make improvements, please share them there)

    New features

    • It’s working! No kidding: the version available on LSL scripts wiki and on other sites like Outworldz is incomplete and not ready to work, even taking apart the Google license issue.
    • Use Yandex translation API. It is not only free (while Google isn’t anymore), but it is easy to get an API key (while it’s quite complicate with Google or Microsoft API’s).
    • The API key is not hardcoded but instead stored in a notecard. This avoids a single key being spread everywhere and causing "maximum allowed requests reached" kind of messages.

    DO NOT DISTRIBUTE THE TRANSLATOR WITH THE API KEY. It could end up being used by dozens of users, and becoming useless.

    Main (and not so new) features

    • Multiplex mode: if several translators are in the same area, one becomes the master and makes actual translation requests for the other ones. This avoid overload when lot of people are present and using it.
    • Speaker language auto detection (though users can also choose their language manually)
    • Translations sent by instant messages, no spam on the public channel
    • Can be used as an object in the parcel or as a HUD.
    • Can use both an object in the parcel and people wearing HUD, without spamming public channel, nor overloading the servers and the API key limits.

    To do

    • Get an updated list of available languages ✓ A (beautiful) texture and logo
    • Detect the most used languages and show them at beginning of the list
    • Allow to set a fixed list of preferred languages to show first (probably before the auto-detected mostly used ones).

    Notes

    We use a dedicated function json2List instead of llJson2List (not compatible with 0.8). It’s a little bit rough, but it works.

  • Scrup – LSL scripts auto-update

    An update ecosystem to allow OpenSimulator scripts to self-update. It should also work in Second Life with a small tweak (see below).

    Installation

    • ScrupServer: the lsl server script, to put inside an in-world object. The object will also contain non-running copies of the latest versions of the scripts to update.
    • ScrupClient: The portions of code to include own script. It is intended to be lightweight, we don’t want it to get bigger than the script itself.
    • Web application: the rest of this repository. It will allow both client and server to register an exchange the needed information for updates.
    • Database: scrup use a sqlite database for efficiency only. It will be created automatically in PHP tmp_dir (or upload_tmp_dir). It stores only runtime data sent by server and client, so it can get deleted or lost without real harm.

    In the client script:

    • copy the variables and the scrup() function as is in your script (also include debug() function if you don’t have one)
    • please include a credit line at the beginning, after yours
    • insert scrup(ACTIVE) at beginning of default state_entry() and on_rez() (the latter only if you don’t use llResetScript)
    • use scrup(FALSE) to stop updates at any time in your script (for example, while executing a task that should not be interrupted). The authorization pin will be revoked and a new one will be generated on scrup(ACTIVE) or scrup(TRUE)
    • use scrup(TRUE) or scrup(ACTIVE) to resume normal operations (value of scrupAllowUpdates is still honored)

    Status

    This is a work in progress and more like a proof of concept. Updates are functional, but…

    • only if the server and the object are in the same region (you can wear the object and TP to the region hosting the server, though, and even wear the server and visit the regions where objects need update)
    • only one client can be present in a prim (several can if each one is in a different prim of the same object, though)
    • there are no verifications (allowed grids, owners, creators), so it should probably not be used at a wide scale. Yet.

    Second Life

    The only OSSL function used in scripts is osGetGridLoginURI(), in , which is useless in SL. So to make the script work in SL, replace the function by a fixed value "secondlife://" (detailed explanation in the scripts comments).

    Roadmap

    • Let ScrupServer script update itself too
    • Let two ScrupServers exchange their latest versions
    • If there are no updater in the same region, send a message notification to the owner
    • Or better: send an updater box to the owner as a workaround to region limitations (wear to update)
    • Allow bundles (all scripts in an object + other inventory items), mix with updater box concept
    • Find a f* way to send updates to other regions (let’s forget other grids for now)
  • PeepingToms

    OpenSim script to let NPCs be attracted when someone sits on an object Made

    by Gudule Lapointe @ speculoos.world:8002

    This is not my best achivement, but I find it quite funny. If you use NPCs in your region, put this script in one of the animated objects, and NPCs passing by will one by one come together to watch when someone sits on it.

    You can fix the scan radius, the distance they keep from the watched avatar, the occuppied angle (360 for all around, smaller to get them more in front), adjust rotation (to get them on the side, on front or rear), and make them change dress when they watch.

    Sometimes, an NPC is too far and cancel its move right before being in place so it disappear and go back to its initial position. It’s a bug, but it adds some randomness, so it sounds fair to me.

    Requirement

    It uses only standard LSL functions, but rely on an NPC server, which means it’s only relevant in a region where OSLL NPC functions are enabled.

    Installation

    1. Have already an NPC rezzer box, "OSW NPC" or "ActiveNPCs"
    2. If you want custom dresses, add correspondig notecards in the NPC box, as
      APP_Npcname_Dressname
    1. Put the script in any object where visitor sit, alongside the original script. You can put custom settings in the object description, in the form:
      searchRadius, minRadius, maxRadius, spreading, orientation, changeDress

    The script is auto-updating (in limited conditions). So either don’t change anything in the script, either disable auto-update to avoid losing your changes.

    Foot notes

    • If you setup a custom dress, ensure that you have a matching NPC notecard for each one in your NPC rezzer, otherwise you will get annoying system errors.
    • This script is intended to work with "OSW NPC" or "ActiveNPCs" (the latter being an enhanced version of the original). I made a fix for the error messages issue mentioned above, its available on https://github.com/GuduleLapointe/active-npcs-ef-Gudz-mods
    • If you distribute this script, include this README and credits
    • If you make changes, please share with me so I can improve the original

    Have fun! (and let me know about it)

  • OpenSimMaps (standalone)

    The web map tool for OpenSimulator, for

    • standalone use
    • or integration with

    Support this project: https://magiiic.com/support/OpenSimMaps

    Features

    • show grid map with region maptiles
    • click to get a choice of teleport methods
    • supports varregions
    • supports multiple maps
    • uses Google Maps v3 API

    New

    • allow standalone use: include minimal settings, independant to other helpers or web interface
    • include settings for integration with Flexible Helper Scripts
    • separate settings file from the rest of the code: one for php (config.php), one for javascript (config.js)
    • distribution now contains only example settings file, to alow smooth update without losing config
    • added hop:// to teleport link choices

    TODO

    • remove old API key probably belonging to one of the original developers
    • … and many other things whose details would be laborious (so much to do, so little time)
    • please use issues to request new features or report bugs

    Installation

    • clone this folder inside your website documentroot, e.g /var/html/opensimmaps/, to make it accessible as https://yourgrid.org/opensimmaps/ (you can rename it)
    • Copy config.php.example as config.php and adjust settings (this helper only needs database credentials OPENSIMDB*)
    • Copy config.js.example as config.js and adjust settings (particularly xlocations, ylocations, mapcenternames, hgdomains and hgports)
    • make a soft link from the OpenSim maptile/00000000-0000-0000-0000-000000000000 folder to data/regions/, for example on linux (adjust to your setup):
      ln -s /opt/opensim-0.9.2.0/bin/maptiles/00000000-0000-0000-0000-000000000000 /var/html/opensimmaps/data/regions

    Alternatively, you can make data/regions/ folder and copy the maptiles in it, but it won’t be updated automatically.

    • Original readme specified to rather use Warp3DImageModule, but it is now the default. Your OpenSim.ini file should contain these settings:
      [Map]
        MapImageModule = "Warp3DImageModule"
        TextureOnMapTile = true
        DrawPrimOnMapTile = true

    Credits

    Based on hawddamor’s opensimmaps (optimized for OpenSim Redux web interface).

    This is a modified version of hawddamor/opensimmaps. The modifications from the original project are mainly related to file locations and some variable names.

    More information on original project and authors in README and LICENSE files.

  • opensim-debian

    OpenSim Debian Distribution

    Version: 2.0.0

    This is an framework to facilitate installation and use of OpenSim with Debian.

    https://www.speculoos.world/opensim-debian-installation-framework/

    Features

    ./install/install.sh

    • create basic directory structure, download OpenSim and other needed libraries
    • read Robust default configuration, ask a few questions and build a working configuration in etc/robust-d

    opensim start

    • Start all instances, first in etc/robust-enabled, then in etc/simulators-enabled

    opensim start instance1 [instance2] [...]

    • Start only specified instances The config will be the first match in etc/robust.d/.ini or etc/opensim.d/.ini

    opensim stop [now] [instance1] [instance2] [...]

    opensim restart [now] [instance1] [instance2] [...]

    • Stop/Restart all instances or matching instances
    • If first parameter is "now", stops the simulator immediately, otherwise send reminders to leave during 2 minutes then stop

    opensim status

    • Show active instances, per instance and global memory and cpu usage

    Installation

    git clone --recursive https://git.magiiic.com/opensimulator/opensim-debian.git
    # use --recursive to download git submodules
    # if you don't use recursive, they will be downloaded during installation
    sudo mv opensim-debian /opt/
    export PATH=$PATH:/opt/opensim-debian/bin
    cd /opt/opensim-debian
    ./install/install.sh

    Answer the common setting questions.

    Configuration should be working as is, but you will probably want to adjust

    • ./etc/opensim/opensim.conf (main database configuration)
    • ./etc/opensim/robust.d/*.ini (robust settings)
    • ./etc/opensim/opensim.d/*.ini (simulators settings)
    opensim start

    To enable bash completion:

    sudo apt update
    sudo apt install bash-completion
    sudo ln -s /opt/opensim-debian/lib/bash_completion.d/opensim /etc/bash_completion.d/

    Main motivation

    In a software application, particularly a complicate one like OpenSim, some thing should never be stored at the same place. Essentially, there is a place for static files (executables, libraries), a place for preferences, and a place for data created by the application (permanent or temporary).

    This way, you can

    • easily update the software without touching preferences and data
    • backup the data without duplicating the software
    • avoid duplicating the application if you need to run several instances…

    So, we reorganised the files and folders, matching the general Linux standards.

    • The whole thing is stored in /opt/opensim-debian (could become /usr/share/opensim if we make a package), refferred as OSDDIR below
    • Scripts and utilities are in /OSDDIR/bin/
    • The main code (latest stable OpenSim release) is located in /OSDDIR/core/opensim (no, not in bin, because they are not directly executable on all OSes, and they rely on lot of other files around them)
    • Preferences are read from /OSDDIR/etc/ /etc/ and ~/etc/, each one overriding the precedent
    • Cache is stored in /OSDDIR/var/cache
    • Logs in /OSDDIR/var/logs
    • Databases (if using sqlite) should be store in var/db (but we don’t use sqlite, so this could be added or not later)
    • Git clone and other works in progress should go in dev/

    It was important to achieve this without altering the main OpenSim code. So we created some scripts which:

    • read the preferences in etc/
    • looks for instances to start in etc/robust.d and etc/opensim.d
    • tells OpenSim where to save data, cache and logs

    We have developed and used this setup for several years in Speculoos Grid and wanted to share. Although this was working for us, we don’t push the whole thing as is, as we want to make sure the methods are as globals as they can.

  • OpenAI Chatbot for OpenSimulator Virtual World

    Version Language Requires License

    This script acts as an AI assistant, powered by OpenAI’s GPT-3.5 Turbo language model, designed to interact with users in an OpenSimulator virtual world. It listens to chat messages, processes user queries, and responds with appropriate answers.

    The script is intended for OpenSimulator and requires the following OSSL functions to be enabled:

    • osGetNotecard()
    • osIsNpc()
    • osNpcSay()

    Usage

    1. Include this script in an object in your OpenSimulator virtual world.
    2. Create a notecard named "~api_key" in the same object containing the API key to access OpenAI’s GPT-3.5 Turbo.
    3. Create a notecard named "~context" in the same object containing your world specific context for the assistant.
    4. After initialization, the assistant will listen to user messages containing its name and respond accordingly.
    5. Users can interact with the assistant by addressing it with its name and asking questions or giving commands.

    Special Commands (to be interpreted and handled by the AI)

    The script utilizes the AI to recognize certain requests and instructs the AI to include specific keywords in the answers. These keywords enable the script to process the responses differently.

    • %not_for_me% will inform the script that the message is not intended for it and the answer should not be processed.
    • %quit% will instruct the script to end the chat and respond with a farewell message.
    • %sit% or %follow% will instruct the script to answer accordingly, assuming the user typed the commands with the appropriate syntax for a third-party script ("use" and "follow me" for NPC Manager). In a future release, the script will forward the appropriate command to an external script (NPC Manager) which will handle the requested NPC actions.

    Notes

    • This script requires an API key to access OpenAI’s GPT-3.5 Turbo API. Make sure to keep the key secure and to not include it in the version you might reditribute.
    • The script keeps a log of user and assistant interactions, limited to the number of messages set by LOG_LIMIT.
    • The assistant will listen to chat messages until 180 seconds of inactivity or a request to end talking, after which it will stop listening until it is called by its name again.
    • Any message starting with a slash ("/") is ignored as it may indicate a command for other purposes.
    • The assistant’s responses are subject to the capabilities and limitations of the GPT-3.5 Turbo language model.
    • This version is an early release, and improvements or bug fixes may be needed based on user feedback.

    Feedback and Issues

    For feedback or issues, please see GitHub Repository.

  • Offline-Messages-mail-forwarding

    Offline messages (IM) mail forwarding for OpenSimulator https://github.com/GuduleLapointe/offline-mail-forwarding

    GNU AFFERO GENERAL PUBLIC LICENSE (see LICENSE file)

    Warning

    This forwarder might look easy to setup, but it is not an easy job. Mail forwarding will expose your server. So you ABSOLUTELY need to have a secured server to avoid being hacked or used by spammers.

    Among other things:

    • use SSL, disallow unencrypted access to this script
    • if you have a mail relay installed on your server, deny relay from non authenticated users;
    • avoid allowing group messages relaying if possible;
    • keep watching your OpenSimulator, mail and web server logs to detect any abuse.

    Features

    • Forward instant messages by mail when the user is offline
    • Replacement for the usual offline message script, so it also handles local delivery

    Caveats

    It is an external script. It is called where the sender stands by the region simulator, because that’s where you can call an external offline message script.

    This means:

    • if somebody sends a message from another grid, it will not be forwarded because the other grid has no access to HG users email and IM preferences
    • if it is sent from a region where the script it is not installed, the message will not be forwarded either

    This can be good, as it limits possible abuses, but a better approach would be to intercept the message on the grid level (in Robust instance), and from there allow or disallow forwarding from HG senders, but this would need changes in OpenSimulator core software.

    So this project is, and will stay, a workaround, not perfect but useful until we or somebody else develop the core module.

    Installation

    On your webserver

    You webserver needs access to the OpenSimulator database.

    • copy the content in a folder called "offline" (or whatever you like) in your webroot directory.
      git clone https://github.com/GuduleLapointe/offline-mail-forwarding.git offline
    • inside this directory, compy the example config file and adjust to your settings
      cp config.php.example config.php

    In OpenSimulator (grid or standalone)

    • In OpenSim.ini file adjust or add these setting under section [Messaging]. On a grid, this has to be set for every region.
      [Messaging]
      OfflineMessageModule = OfflineMessageModule
      ; OfflineMessageModule = "Offline Message Module V2"
      OfflineMessageURL = http://your.server/offline/offline.php
      StorageProvider = OpenSim.Data.MySQL.dll
      MuteListModule = MuteListModule
      MuteListURL = ${Const|BackOffice}/mute.php
      ForwardOfflineGroupMessages = false

      In the viewer

    Now mail forwarding is active on the server, but users wanting to enable it have to do it from viewer preferences (in Chat or Communication tab).

  • Gudule’s Teleport Board 2

    Get the latest version: https://git.magiiic.com/opensimulator/Gudz-Teleport-Board-2

    Features:

    • Single or Multi-columns teleport buttons
    • Destinations statuses are checked at start and every hour to avoid TP to inactive regions
    • Local destinations can be written as HG links and are automatically converted to local links for teleport, so the same board works inside and outside your grid
    • Destination source can be set from a notecard or from a web server
    • Immediate TP or map (change USE_MAP in config)
    • Different colors for current region (green) or offline regions (red), customizable
    • Optional background texture
    • Can be formatted with titles (text without url), spacer (|) and column jump (-)
    • Configuration in a separate notecard to allow easy upgrades
    • Long click by the owner to force a full reload

    Setup

    The destination list can be set by 3 ways

    • from an external website: put the URL in prim description (only the first 2048 bytes will be loaded)
    • from a specific notecard: put "card://CardName" in the description
    • fallback if none of the two first method: read the first notecard found.

    In previous versions, the destination list used 5 values. We accept this old format for backward compatibility but we recommend the simplified format:

    • Displayed Name|your.grid:port
    • or Displayed Name|your.grid:port:Region Name
    • or Displayed Name|your.grid:port:Region Name|x,y,z

    Comments and formatting:

    • Empty lines are ignored
    • Lines beginning wish "#" are ignored
    • Lines commented with "//" are sent as message to the owner during initializaton
    • Lines containing only a string (and no url) are drawn as simple text (section titles)
    • Lines containing only a separator ("|") are drawn as an empty line (spacer)

    Although commenting lines is useful to disable them temporarily (#) or display help messages (//), it slows down the initialization, so it is better to avoid it as much as possible.

    Required OSSL Functions:

    • osGetGridGatekeeperURI
    • osGetNotecard
    • osTeleportAgent
    • osSetDynamicTextureDataBlendFace and related (osDrawFilledRectangle, osDrawRectangle, osDrawText, osGetDrawStringSize, osMovePen, osSetFontName, osSetFontSize, osSetPenColor, osSetPenSize)
  • Gudz Free Land Rental Script

    This script is designed for managing free land rentals in OpenSimulator, ensuring tenants maintain a regular presence to prevent users from making land unavailable without actually using it.

    In the future, this script will be adjusted to also handle paid rentals.

    Features

    • Free Land Rentals: Allows users to rent land for free, requiring them to click regularly on the rental panel to keep the parcel.
    • Full Ownership: The land is technically sold to the user, giving them full ownership and control over their parcel without needing group tricks.
    • Automatic Reclaim: Expired or abandoned land is sold back to the vendor owner.

    Requirements

    The script requires these functions to be enabled for Estate Owners in OpenSimulator configuration:

    • osDrawText
    • osGetDrawStringSize
    • osGetGridGatekeeperURI
    • osGetGridLoginURI
    • osGetNotecard
    • osInviteToGroup
    • osKey2Name
    • osMovePen
    • osSetDynamicTextureDataBlendFace
    • osSetFontName
    • osSetFontSize
    • osSetParcelDetails
    • osSetPenColor

    Usage

    For Tenants

    1. Initial Rental: Click on the sign, read the rental conditions, and confirm the rental.
    2. Renewal: Before the end of each term, click on the sign to renew the rental.

    For Region Owners

    1. Estate Settings: Make sure to disable land join, split, and resell in your Estate settings.
    2. Placement: Place the terminal outside the rented land, around 1 meter from the parcel border and adjust until the positioning beacon is inside the parcel and appears green.
    3. Confirmation: A confirmation message appears. Check the rental conditions (see configuration below) and start renting.

    Configuration

    Do not modify the script directly, any change would be overriden on next update. Use the notecard or a web URL config file instead.

    Using a Notecard

    Create a notecard named .config including these settings:

    
    configURL = https://yourgrid.org/rental/example.txt
    // If set, the config will be read from the URL and the rest of the notecard will be ignored.

    // Base config (required)

    duration = 30 // number of days, can be decimal for shorter periods maxDuration = 365 // number of days, can be decimal for shorter periods renewable = TRUE maxDuration = 3650 expireReminder = 7 expireGrace = 7

    // Optional

    fontname = fontSize = lineHeight = margin = textColor = textBackgroundColor = position = cropToFit = textureWidth = textureHeight = textureSides =

    Using Object Description (deprecated)

    Put these values, in this order, in the main prim description, separated by commas. Duration, max duration, expire reminder, and expire grace are in number of days.

    DURATION,MAX_DURATION,,RENEWABLE,EXPIRE_REMINDER,EXPIRE_GRACE

    The empty third field used to be set to MAX_PRIMS, but it is now calculated from the parcel data. It can be left empty to save space (keeping two commas for backwards compatibility).

    To Do

    1. Fix current functionalities:
      • √ Fix rental not restored after updates (fixed in 1.6.5)
      • √ Fix messages not sent to HG avatars when offline (added notification queue)
      • √ Fix position not saved in rent data, causing new check triggered on reset
      • Keep notification queue after script reset
      • Clear rent data (object desc) if owner changed
      • Clear rental status if parcel changed
      • Shorter rental data format (only save in object desc the live rental data, not settings that are now handled by config file)
      • Also notify owner to clean terrain when abandoned (currently only on rental expiration)
    1. Add new functionalities:
      • √ New feature: restore rental, based on prims found in the parcel (1.6.6)
      • Use different prims for sign and renter name, hide and show accordingly, to avoid resizing single prim and allow more creative designs
      • allow setting times in years, months, days, hours
      • Option to limit to local grid avatars
      • Option for maximum number of parcels per user, or maximum area
      • Check that the owner has estate rights before activating
      • Centralized management
        • List available terrains
        • Centralized rental via in-world board
        • Centralized rental via web page
      • Advanced features (requires grid-side API)
        • Option to update terrain for sale status
        • Option to set objects auto return after rental end
    1. Add payment system:
      • With local currency
      • On website (via w4os or WooCommerce)

    License

    This script is provided under the GNU Affero General Public License version 3. See the LICENSE file for more details.

  • 2do HYPEvents (meta project)

    2do is an ecosystem of tools allowing to manage events in an OpenSimulator. It is composed of several elements, depending of the way you want to implement it.

    This repository contains no code, only the information about the related projects.

    1. 2do-board

    This is were it all began. A scripted object in-world, displaying ongoing and upcoming events, allowing teleport. By default, it is set to use 2do.directory service, but it can be customize with the tools below. It can be used on any region, regardless of the implementation of search or not on the grid, but requires OSSL draw functions to be function.

    2. 2do.directory

    The easiest way to enable in-world search (including events) is to configure the simulators to use 2do.directory services. It only requires the addition of OpenSimSearch.dll in OpenSimulator bin folder and a few configuration lines in OpenSim.ini. Search is provided by 2do.directory website and allow sharing of hypergrid destinations. It avoids the need to install helpers.

    3. OpenSim Helpers

    Installing your own helpers allow to use your own databases for search and events. It is relevant for private or associated grids, or to setup and alternate shared directory. Currently, due to OpenSimulator and/or viewer limitations, searching classifieds require a direct access to the Robust database, so to enable them, installing helpers specific to the grid is necessary.

    A local installation of OpenSimulator helpers can be combined with the use of an external events provider like 2do.directory.

    4. 2do-aggregator

    To providde your own events server. Collects events from different sources and made them available to the search engine and in-world boards. It is usually not necessary to install your own implementation, the service is offered by 2do.directory.

    Deprecated

    • 2do-server: the previous aggregator, written in python 2.7 and forked from Tom Frost’s HypEvents abandonned project, replaced by 2do-aggreagator
    • 2do-search: another implementation of search engine, focused on events. Replaced by opensim-helpers