IDEA: Payphones Someone calling the script would need to be able to complete SIC triangulation and have a progia that could somehow get the results of that triangulation. This would be used to cause the payphone(s) closest to the triangulated ID to ring and open a connection to the progia being used. Alternatively (easier) the script would just give the caller some payphone numbers to try manually dialing.
- payphones in the MOO would need to have a .phone_number property for this script to work. - sorting assumes %payphones can be arranged by proximity. If additional distance-check logic is needed, we can implement it. - The script will use $SIC_triangulator_result to get the rough location (%location) of a payphone. Find nearby payphones ($object) in proximity to %location. Obtain the phone numbers (%phone_numbers) of the closest payphones. Send the results to the %player's Progia device.
uses $default_script
// Retrieve the triangulated location
set "%location" $SIC_triangulator_result
// Find payphones in the triangulated location
find $object "payphone" "%payphones"
// Check if any payphones were found
if equals %payphones 0
tell %player "You couldn't locate any nearby payphones."
stop
endif
// Sort payphones by proximity to the triangulated location
sort "%payphones"
// Retrieve phone numbers of the closest payphones
set "%phone_numbers" ""
foreach %phone in %payphones
getprop %phone ".phone_number" "%number"
set "%phone_numbers" "%phone_numbers,%number"
endfor
// Remove the leading comma
math "%phone_numbers" = substr(%phone_numbers 2 len(%phone_numbers))
// Send the phone numbers to the player's Progia
notify %player "Your device displays the phone numbers of nearby payphones: %phone_numbers."