Paying Avatars or Objects

Provided that your bot has sufficient funds, your bot can pay out a given amount to an avatar or object by using the pay family of commands. Note that just like any command the pay command is bound to a group. Corrade is oblivious to agents: it does not care what avatars send commands but rather on behalf of which group a certain command has been executed. Even if you do not really need a group to pay an avatar, Corrade still requires that a group and group password be supplied. If you intend on using Corrade as a personal money broker, you should create a group and bind Corrade to that group via the configuration file.

The following is an example message to Corrade that pays the owner 100:

default {
    state_entry() {
        llInstantMessage(CORRADE, 
            wasKeyValueEncode(
                [
                    "command", "pay",
                    "group", GROUP,
                    "password", PASSWORD,
                    "type", "avatar",
                    "target", llGetOwner(),
                    "reason", "A gift, just for you!",
                    "amount", 100
                ]
            )
        );
    }
}

Note that any avatar that you grant access to Corrade will be allowed to make payments using Corrade via proxy. If you intend to use your bot with untrusted sources, you should not leave any outstanding balance in the bot's account. Also note that libomv that Corrade relies on is currency agnostic, meaning that the value 100 can mean L$ for Second Life, OS$ for OpenSim or any other currency that the virtual world uses. As such values passed to amount are treated as units of currency in the context that Corrade operates.

Corrade distinguishes between three types of payments:

  • payments to avatars, specified by setting type to avatar,
  • payments to objects, specified by setting type to object and
  • payments to groups, specified by setting type to group.

It is up to the user to determine what the payment key specified with target represents. In the example above, we have set target to llGetOwner() meaning that we will pay an avatar and thus we set type to avatar.

Index


secondlife/scripted_agents/corrade/tutorials/paying_avatars_or_objects.txt ยท Last modified: 2022/11/24 07:45 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.