Naming convention

This commit is contained in:
Malcolm Roberts 2024-01-11 08:34:47 -06:00
parent dbb62c2f7b
commit c0f1f4c57b
8 changed files with 17 additions and 25 deletions

View File

@ -1,11 +0,0 @@
function main(jsonvalue params)
{
if ${params.Get[1].Equal["jk"]}
{
echo "JK JK"
}
else
{
echo "for real"
}
}

View File

@ -17,9 +17,10 @@ objectdef MRNavigation
Percision:Set[${persision}] Percision:Set[${persision}]
} }
method MoveTo(point3f point) method MoveTo(point3f point, float minDistance = 1)
{ {
This:BreakCampSpot This:BreakCampSpot
This.Percision:Set[${minDistance}]
MoveToRequested:Set[TRUE] MoveToRequested:Set[TRUE]
MoveToPoint:Set[${point.X}, ${point.Z}, ${point.Z}] MoveToPoint:Set[${point.X}, ${point.Z}, ${point.Z}]
} }

View File

@ -29,6 +29,7 @@ objectdef TestController
"method": "SetMoveSpot", "method": "SetMoveSpot",
"parameters": { "parameters": {
"ForWho": "Dasteg", "ForWho": "Dasteg",
"minDistance": 1,
"location": { "location": {
"X": ${Me.Target.Loc.X}, "X": ${Me.Target.Loc.X},
"Y": ${Me.Target.Loc.Y}, "Y": ${Me.Target.Loc.Y},

View File

@ -3,15 +3,10 @@ objectdef RelayApi
{ {
method SetMoveSpot() method SetMoveSpot()
{ {
"echo SetMoveSpot: ${Context.AsJSON~}"
if !${MRNav(exists)}
{
echo "Loading Movement"
RunScript "${LavishScript.HomeDirectory}/Scripts/mr/common/Navigation/Movement"
}
variable point3f location variable point3f location
location:Set[${Context.Get["parameters", "location", "X"]}, ${Context.Get["parameters", "location", "Y"]}, ${Context.Get["parameters", "location", "Z"]}] location:Set[${Context.Get["parameters", "location", "X"]}, ${Context.Get["parameters", "location", "Y"]}, ${Context.Get["parameters", "location", "Z"]}]
MRApi:MoveTo["${Context.Get["parameters","ForWho"]}", "${location}"] MRApi:MoveTo["${Context.Get["parameters","ForWho"]}", "${location}", ${Context.Get["parameters", "minDistance"]}]
} }
} }
@ -20,8 +15,13 @@ variable(global) RelayApi MRRelayApi
function main() function main()
{ {
if !${Script[Movement](exists)}
{
RunScript "${LavishScript.HomeDirectory}/Scripts/mr/common/Navigation/Movement"
}
while 1 while 1
{ {
wait 1 wait 100
} }
} }

View File

@ -62,7 +62,7 @@ objectdef MRApi
return ${negate} return ${negate}
} }
static method MoveTo(string forWho, point3f location) static method MoveTo(string forWho, point3f location, float minDistance = 0)
{ {
echo "Moving to ${location}" echo "Moving to ${location}"
if ${MRApi.IsForMe[${forWho}]} if ${MRApi.IsForMe[${forWho}]}

9
mr.iss
View File

@ -1,6 +1,10 @@
function main(... params) function main(... params)
{ {
if !${Script[Relay](exists)}
{
RunScript "${LavishScript.HomeDirectory}/Scripts/mr/common/Relay"
}
variable string command = ${params[1].Lower} variable string command = ${params[1].Lower}
if ${command.Equal["osa"]} if ${command.Equal["osa"]}
{ {
@ -17,10 +21,7 @@ function main(... params)
} }
elseif ${command.Equal["relay"]} elseif ${command.Equal["relay"]}
{ {
if !${MRRelayApi(exists)}
{
RunScript "${LavishScript.HomeDirectory}/Scripts/mr/common/Relay"
}
} }
elseif ${command.Equal["!c"]} elseif ${command.Equal["!c"]}
{ {