From b195f0ec6e45dbd1be3f2a83c0ed026109fe0e3c Mon Sep 17 00:00:00 2001 From: Matt Holland Date: Tue, 5 May 2026 13:07:55 -0400 Subject: [PATCH] Added Assistant Droid Script --- README.md | 5 +++- assistant-droid.lsp | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 assistant-droid.lsp diff --git a/README.md b/README.md index 0d481cd..8d9264c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # SWC-Scripts -Collection of my SWC LISP scripts. New ones added as I make them \ No newline at end of file +Collection of my SWC LISP scripts. New ones added as I make them + +- Assistant Droid +> A "friendly" droid companion for your ship. It can provide information about ETAs and destinations to friendly players. It will refuse to answer any questions from enemies. \ No newline at end of file diff --git a/assistant-droid.lsp b/assistant-droid.lsp new file mode 100644 index 0000000..c147acd --- /dev/null +++ b/assistant-droid.lsp @@ -0,0 +1,71 @@ +(defvar ship (get-entity 7315656 2)) + +(defun start + (cond + [ + (is-owner? character) + (say (concat "Welcome back, Master." )) + ] + [ + (is-ally? character) + (say (concat "Hello, " (get-race character) "! Welcome to " ship "!")) + (add-response "Who is in charge?" pilot) + ] + ) + (if (is-ally? character) + (add-response "I need assistance from your master." contact-owner) + (add-response "Where are we?" location) + (add-response "Where are we going?" destination) + ) + (if (is-enemy? character) + (describe "The droid doesn't react as you approach. It stands staring into the void.") + (add-response "Hello?" enemy-info) + ) + +) + +(defun pilot + (cond + [ + (is-owner? character) + (say (concat "You are, Master " (get-name character) ".")) + ] + [#t + (say (concat "I am owned by " (get-owner self) ".")) + ] + ) +) + +(defun location + (describe "The droid pauses a moment. Reading data from the ship's computer.") + (cond + [ + (is-traveling? self) + (say "We are currently traveling. Allow me to retrieve our travel information...") + (destination) + ] + [#t (say (concat "We are currently " (get-current-system)))] + ) +) + +(defun destination + (cond + [ + (is-traveling? self) + (say (concat "We are currently " (get-destination self))) + (say (concat "Our expected travel time is " (get-eta self))) + ] + [#t (say "We aren't currently traveling") ] + ) +) +(defun enemy-info + (say (concat "You are entitled to the following information per IFF policy:")) + (say (concat "You are aboard the " ship ".")) + (say "You may find your access to the ship restricted. I am unable to assist you with access.") +) + +(defun contact-owner + (send-message self (get-owner self) (concat "Master, " (get-name character) " has requested your assistance aboard " ship ". Location follows: " (get-location self))) + (say (concat "I have contacted Master " (get-owner self)" requesting their assistance. Coordinates have been sent along with your information.")) + +) \ No newline at end of file