forked from Parsalin/OSFertility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfertility - Basic Relay.txt
36 lines (36 loc) · 1.04 KB
/
fertility - Basic Relay.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
default
{
state_entry()
{
llListen(1,"","","");
}
listen(integer c, string n, key id, string m)
{
if(id == llGetOwner() || llGetOwnerKey(id) == llGetOwner())//only listen to ownerand owner objects with relay
{
//do
if(llToLower(m) == "cycle")
{
llMessageLinked(LINK_SET, -1, "getcyclestage",id);
}
}
else
{
//ask permission
}
}
link_message(integer link, integer n, string m, key id)
{
list data = llParseString2List(m, ["|"],[""]);
if(llList2String(data,0) == "CycleStage")
{
string msg = "test: ";
if(llList2Integer(data,1) == -1 )msg +="Pregnant.";
if(llList2Integer(data,1) == 0 )msg +="Ovulate soon.";
if(llList2Integer(data,1) == 1 )msg +="Fertile.";
if(llList2Integer(data,1) == 2 )msg +="Period.";
if(llList2Integer(data,1) == 2 )msg +="Recovery.";
llOwnerSay(msg);
}
}
}