Skip to content

OnEvents ‐ Service docs

Madpeter edited this page Jul 4, 2024 · 4 revisions

The onevents system allows automation of the bot without any scripts based on a number of triggers. not as flexable as if you are controling it directly but sill powerfull.

Sources

source Passed values from event About
GuestJoins avataruuid Triggered when the bot sees a new avatar
GuestLeaves avataruuid Triggered when the bot can no longer see an avatar
Clock / Attempts to trigger every 60 secs (please have some good where checks to avoid spam)
AvatarIm avataruuid, avatarname Triggered when the bot gets a IM
GroupMemberJoin avataruuid, groupuuid, groupname Triggered when an avatar joins a group
GroupMemberLeave avataruuid, groupuuid, groupname Triggered when an avatar joins a group
ChangeSim oldsimname, newsimname Triggered when the bot changes sim
BalanceUpdate funds Triggered when the bots balance gets a update
SimAlert alertmessage Triggered when the bot gets a sim alert message

Monitor

these filter events before getting to the where checks.

source Required Monitor value Example
GroupMemberJoin GroupUUID 861e110b-f3a5-1869-f652-a722bc86fb1b
GroupMemberLeave GroupUUID 861e110b-f3a5-1869-f652-a722bc86fb1b
GuestJoins SimName=#=ParcelName Japan=#=No.26
GuestLeaves SimName=#=ParcelName Tentacles=#=EmptyList
AvatarIm Text "Any" or "AvatarUUID"

if a source is not listed set the monitor to "Any"

  • GroupMemberJoin/GroupMemberLeave events will never be triggered for groups without an attached monitor

  • GuestJoins/GuestLeaves requires the bot to currently be in the matching monitor, it will also enforce the guests parcel to be what is monitored.

  • AvatarIm requires the monitor to be set to a selected AvatarUUID or Any to accept from anyone

checkable values

  • Normal checkable values
Key About Notes
botsim the name of the sim for the bot Secondbot Example
botparcel the name of the parcel for the bot can be "-" if the parcels are not loaded yet
botx the X location as a number for the bot can be -1 if not fully loaded into a parcel yet
boty the X location as a number for the bot can be -1 if not fully loaded into a parcel yet
botz the X location as a number for the bot can be -1 if not fully loaded into a parcel yet
eventype the type of event triggered (see sources)
clockhour the hour time on the clock (24 hour format) with leading zeros 06 or 22
clockmin the min time on the clock with leading zeros 31 or 09
dayofweek the day of the week [0=sunday,1=Monday ect]
  • Requires pass in from events
Key About Notes
message the message sent from a groupIM, localchat, avatarIM will be "none" if not from any of these events
avataruuid the UUID of the avatar can be "none" if not loaded by the source
groupuuid the UUID of the group that triggered the event will be set to "none" if not from a group event
groupname the name of the group that triggered the event will be set to "none" if not from a group event
oldsimname the old sim name the bot was in before it moved will be "none" if this is the first connect, will be "none" if not ChangeSim event source
newsimname the new sim name the bot has moved to will be "none" if not ChangeSim event source
funds the balance the bot holds will be -1 if not passed in
alertmessage the message of the alert will be "none" if not SimAlert event source
  • Requires avataruuid to be passed in from the event
Key About Notes
avatarname the name of the avatar can be "lookup" if avatar has not been loaded by the data system yet or the avataruuid is "none"
avatarparcel the name of the parcel the avatar is in can be "?" if the parcels are not loaded yet or avataruuid is "none" or unable to see the avatar
avatarx the X location as a number for the avatar can be -1 if avataruuid is "none" or unable to see the avatar
avatary the Y location as a number for the avatar can be -1 if avataruuid is "none" or unable to see the avatar
avatarz the Z location as a number for the avatar can be -1 if avataruuid is "none" or unable to see the avatar
avatardistance how far away the avatar is from the bot in meters if avatarx/y/z values are -1 this will also be -1

Where check types

Key About Example
{IS} the left and right values are the same [botsim] {IS} homesimname
{NOT} the left and right values do not match [avatardistance] {NOT} -1
{IS_UUID} the left value checked to see if formatted as a UUID [avataruuid] {IS_UUID} true
{MISSING} the left value does not contain the right value [avatarname] {MISSING} lookup
{CONTAINS} the left value contains the right value [message] {CONTAINS} magic thing
{IN_GROUP} checks if left avatar is in the right side group, note if unable to check the group/avatar this check will fail [avataruuid] {IN_GROUP} groupuuidhere
{NOT_IN_GROUP} checks if left avatar is not in the right side group, note if unable to check the group/avatar this check will fail [avataruuid] {NOT_IN_GROUP} groupuuidhere
{LESSTHAN} converts the left value to a number and checks to see if its less than the right value as a number [avatardistance] {LESSTHAN} 5
{MORETHAN} converts the left value to a number and checks to see if its more than the right value as a number [avatarz] {MORETHAN} 100
{LOCKOUT} gives true for the left value if in the lockout table, check with the right value [avataruuid] {LOCKOUT} false
{IS_EVEN} checks if the left value as a number is even [clockhour] {IS_EVEN} true
{DIVISIBLE} checks if the left value as a number is divisible by the right value as a number [clockmin] {DIVISIBLE} 5

Actions

you can use any built in command, there is also these custom actions

  • lockout=Key+mins

example lockout=[avataruuid]+60 adds the avatar uuid to the lockout table for 60 mins and this would be checked as follows [avataruuid] {LOCKOUT} false

lockout=magic+20 adds the magic to the lockout table for 20 mins and this would be checked as follows magic {LOCKOUT} false

Examples

Talking clock

"Event1Enabled":"True",
"Event1Source":"Clock",
"Event1Monitor":"Any",
"Event1ActionCount":"1",
"Event1Action1":"Say|||0~#~it is [clockhour]:[clockmin]"

AutoReply

"Event1Enabled":"True",
"Event1Source":"AvatarIm",
"Event1Monitor":"Any",
"Event1ActionCount":"1",
"Event1WhereCount":"1",
"Event1Where1":"[avatarname] {MISSING} lookup",
"Event1Action1":"IM|||[avataruuid]~#~Hi there [avatarname] I ama  bot",

Balance updater

"Event1Source":"BalanceUpdate",
"Event1Monitor":"Any",
"Event1ActionCount":"1",
"Event1Action1":"Say|||0~#~My Balance is [funds]",

Basic greeter with 30min cooldown

"Event1Enabled":"True",
"Event1Source":"GuestJoins",
"Event1Monitor":"SimName=#=ParcelName",
"Event1WhereCount":"1",
"Event1Where1":"[avataruuid] {LOCKOUT} false",
"Event1ActionCount":"2",
"Event1Action1":"Say|||0~#~hi there [avatarname]",
"Event1Action2":"lockout=[avataruuid]+30"