<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://guide.swcombine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ruben+Wan</id>
	<title>Star Wars Combine :: Game Guide - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://guide.swcombine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ruben+Wan"/>
	<link rel="alternate" type="text/html" href="http://guide.swcombine.com/wiki/Special:Contributions/Ruben_Wan"/>
	<updated>2026-09-24T04:21:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Cloning_Creatures&amp;diff=3936</id>
		<title>Cloning Creatures</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Cloning_Creatures&amp;diff=3936"/>
		<updated>2026-09-18T22:22:11Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* How does it work? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Who can clone?==&lt;br /&gt;
The ability to clone can be acquired by anyone who completes a specific quest. In order to start the quest, you must enter any research station that is set to open-to-all, or any research centre that is powered and open-to-all.&lt;br /&gt;
&lt;br /&gt;
The quest involves some fights, therefore it is suggested to have a squad of well-equipped military NPCs to help you. It is also possible to fight together with other characters.&lt;br /&gt;
&lt;br /&gt;
Your character&#039;s skills are not required. The only skill that is taken into account during cloning is Medical Treatment, and it affects the number of concurrent clonings. If you have 0, you can still clone one creature, and if you have 5 you can clone 6 creatures simultaneously.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
You must start by cloning Tiny creatures before unlocking the cloning for Small creatures. The order of cloning is the same as the order of size: Tiny, Small, Medium, Large, Huge, Colossal.&lt;br /&gt;
&lt;br /&gt;
Improving your Research Level unlocks bigger sizes. For example, after cloning *successfully* 12 tiny creatures you can start cloning Small creatures as well.&lt;br /&gt;
&lt;br /&gt;
To start the actual cloning, you must have two creatures of the same type. The DNA synthesis can fail or be successful, and it lasts 5 (five) days. Cloning costs credits, with discounts for higher Research Levels, and time is dependent upon the creature&#039;s size.&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Cloning_Creatures&amp;diff=3935</id>
		<title>Cloning Creatures</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Cloning_Creatures&amp;diff=3935"/>
		<updated>2026-09-18T22:18:17Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: Created page with &amp;quot;==Who can clone?== The ability to clone can be acquired by anyone who completes a specific quest. In order to start the quest, you must enter any research station that is set to open-to-all, or any research centre that is powered and open-to-all.  The quest involves some fights, therefore it is suggested to have a squad of well-equipped military NPCs to help you. It is also possible to fight together with other characters.  Your character&amp;#039;s skills are not required. The o...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Who can clone?==&lt;br /&gt;
The ability to clone can be acquired by anyone who completes a specific quest. In order to start the quest, you must enter any research station that is set to open-to-all, or any research centre that is powered and open-to-all.&lt;br /&gt;
&lt;br /&gt;
The quest involves some fights, therefore it is suggested to have a squad of well-equipped military NPCs to help you. It is also possible to fight together with other characters.&lt;br /&gt;
&lt;br /&gt;
Your character&#039;s skills are not required. The only skill that is taken into account during cloning is Medical Treatment, and it affects the number of concurrent clonings. If you have 0, you can still clone one creature, and if you have 5 you can clone 6 creatures simultaneously.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
You must start by cloning Tiny creatures before unlocking the cloning for Small creatures. The order of cloning is the same as the order of size: Tiny, Small, Medium, Large, Huge, Colossal.&lt;br /&gt;
&lt;br /&gt;
Improving your Research Level unlocks bigger sizes. For example, after cloning *successfully* 12 tiny creatures you can start cloning Small creatures as well.&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Main_Page&amp;diff=3934</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Main_Page&amp;diff=3934"/>
		<updated>2026-09-18T22:03:23Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: added link Cloning Creatures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;padding: 0px; margin: 5px 0px; width: 100%; border: 1px solid #000033&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 100%; text-align: center;&amp;quot; | &lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size: 1.5em;&amp;quot;&amp;gt; Welcome to the [[Star Wars Combine]] - Guide &amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
It should serve you as a help in [[:Category:Getting Started|getting started]] in the browser-based [[Glossary#M|MMORPG]] in its own [http://holocron.swcombine.com/wiki/Main_Page Star Wars Universe] &amp;lt;br /&amp;gt;&lt;br /&gt;
Check the [[FAQ|Frequently Asked Questions]] - for further help, try [[IRC|#swc-help]]&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;width: 100%; background-color: inherit; height: 100%; vertical-align: top;&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 55%;&amp;quot; | &lt;br /&gt;
  {| style=&amp;quot;width: 100%; height: 100%; border: 1px solid #000033; background-color: ##003366; vertical-align: top;&amp;quot; &lt;br /&gt;
   | &lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; padding: 1%; border: 1px solid black; background-color: #000f19;&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 100%;&amp;quot; | &amp;lt;span style=&amp;quot;font-size: 1.2em; font-weight: bold;&amp;quot;&amp;gt;First time?&lt;br /&gt;
      |}&lt;br /&gt;
   |-&lt;br /&gt;
   |&lt;br /&gt;
   {| style=&amp;quot;width: 80%; height: 100%; margin-left: 5%; vertical-align: top; border: 1px solid #111111; background-color: #003750;&amp;quot;&lt;br /&gt;
    | style=&amp;quot;width: 80%;&amp;quot; | If this is your first time playing [[SWC]], it will be beneficial to look through the [[:Category: Getting Started|Getting Started]] and [[Tutorial Quests|Tutorial Quest Guide]] sections to get a broad understanding of some of the basic principles of the game. Once you have understood these, you should check out the [[Golden Rule]] and [[Glossary|Our Languages]] before moving to the Basic Activities and then Advanced Activities listed.&lt;br /&gt;
    |}&lt;br /&gt;
   |-&lt;br /&gt;
   | &lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; padding: 1%; border: 1px solid black; background-color: #000f19;&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 100%;&amp;quot; | &amp;lt;span style=&amp;quot;font-size: 1.2em; font-weight: bold;&amp;quot;&amp;gt;Basic activities in the Combine&amp;lt;/span&amp;gt;&lt;br /&gt;
      |}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; background-color: inherit;&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 50%;&amp;quot; | &lt;br /&gt;
* &#039;&#039;&#039;[[:Category:Getting Started|Getting Started]]&#039;&#039;&#039;&lt;br /&gt;
* [[Tutorial Quests]]&lt;br /&gt;
* [[The Interface]]&lt;br /&gt;
* [[Travel]]&lt;br /&gt;
* [[NPC Transport]]&lt;br /&gt;
* [[Messages|Sending a Message]]&lt;br /&gt;
* [[Forums|Using the Forums]]&lt;br /&gt;
* [[Equipping Items]]&lt;br /&gt;
* [[Party|Managing a Party]]&lt;br /&gt;
* [[Inventory]]&lt;br /&gt;
* [[Search Profiles]]&lt;br /&gt;
* [[Drop your Character]]&lt;br /&gt;
|}&lt;br /&gt;
   |}&lt;br /&gt;
| style=&amp;quot;width: 45%;&amp;quot; | &lt;br /&gt;
  {| style=&amp;quot;width: 100%; height: 100%; border: 1px solid #000033; background-color: ##003366&amp;quot;&lt;br /&gt;
   | &lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; padding: 1%; border: 1px solid #000033; background-color: #000f19; vertical-align: top&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 100%;&amp;quot; | &amp;lt;span style=&amp;quot;font-size: 1.2em; font-weight: bold;&amp;quot;&amp;gt;Help&amp;lt;/span&amp;gt;&lt;br /&gt;
      |}&lt;br /&gt;
   |-&lt;br /&gt;
   | &lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; padding: 1%; background-color: inherit;&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 50%;&amp;quot; | &lt;br /&gt;
* [[Combine Points]]&lt;br /&gt;
* [[IRC]]&lt;br /&gt;
* [[Wiki Guide Editing]]&lt;br /&gt;
* [[:Category:OOC|OOC]]&lt;br /&gt;
*[[Glossary]]&lt;br /&gt;
|}&lt;br /&gt;
   |-&lt;br /&gt;
   | &lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; margin-top 2%; padding: 1%; border: 1px solid #000033; background-color: #000f19&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 100%;&amp;quot; | &amp;lt;span style=&amp;quot;font-size: 1.2em; font-weight: bold;&amp;quot;&amp;gt;Advanced Activities&amp;lt;/span&amp;gt;&lt;br /&gt;
      |}&lt;br /&gt;
   |-&lt;br /&gt;
   | &lt;br /&gt;
     {| style=&amp;quot;width: 98%; margin-left: 1%; padding: 1%; background-color: inherit;&amp;quot; &lt;br /&gt;
      | style=&amp;quot;width: 50%;&amp;quot; | &lt;br /&gt;
* [[Cloning Creatures]]&lt;br /&gt;
* [[Combat]]&lt;br /&gt;
* [[Construction]]&lt;br /&gt;
* [[Crafting]]&lt;br /&gt;
* [[Doors and Locks]]&lt;br /&gt;
* [[Medicine|Healing]]&lt;br /&gt;
* [[Hunting]]&lt;br /&gt;
* [[Eggs|Hatching eggs]]&lt;br /&gt;
* [[GNS|Publishing Galactic News]]&lt;br /&gt;
* [[Medicine]]&lt;br /&gt;
* [[Microjumping]]&lt;br /&gt;
* [[Mining]]&lt;br /&gt;
* [[Production]]&lt;br /&gt;
* [[Prospecting]]&lt;br /&gt;
* [[Recycling]]&lt;br /&gt;
* [[Repairing]]&lt;br /&gt;
* [[Scripting]]&lt;br /&gt;
* [[Squadrons]]&lt;br /&gt;
* [[The Force]]&lt;br /&gt;
* [[Trading]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      |}&lt;br /&gt;
   |}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrative pages]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Travel&amp;diff=3922</id>
		<title>Travel</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Travel&amp;diff=3922"/>
		<updated>2025-11-02T23:06:16Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Hyper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Travel is the group of actions you can perform that make your character move around the game world. There is a wide variety of different travel methods, and these are listed below.&lt;br /&gt;
&lt;br /&gt;
==Set Travel==&lt;br /&gt;
This type of travel uses a set time or distance that does not vary whenever you use this method of travel. It also requires less knowledge (generally) of your destination than for Variable Travel.&lt;br /&gt;
&lt;br /&gt;
===Cross Terrain===&lt;br /&gt;
This type of travel involves moving between different city or terrain squares on a planets surface. This is performed by the following set of instructions:&lt;br /&gt;
&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit] or [Position], depending on whether you are in a ship/vehicle or on foot.&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Choose [Cross-Terrain] button to the left side, under the main map view.&lt;br /&gt;
* Choose the terrain/city square that is next to your current one that you wish to travel to.&lt;br /&gt;
* Click [Accept] and your travel will begin.&lt;br /&gt;
&lt;br /&gt;
You can only initiate this type of travel when you are on the very edge of the city/terrain square (ie at (0,0), or (21,4) etc). You will not have the [Cross-Terrain] option if you are not. Also, planet terrains do no &#039;wrap-around&#039; so if you are on the northern most terrain square on a planet (say, (0,0)), you will not be able to move north and appear at the terrain square at the bottom of the column, and nor does that work horizontally.&lt;br /&gt;
&lt;br /&gt;
The distance is fixed at 200km between city/terrain squares, so travel time will vary depending on how fast you/your ship/your vehicle can travel at.&lt;br /&gt;
&lt;br /&gt;
===Ascend/Descend===&lt;br /&gt;
This type of travel is used when moving to and from a planets surface. There are 2 steps, where you move from the planet&#039;s surface to the atmosphere level, and then a further jump from there to orbit, which is in the system layer where you can move around the rest of the system (see later). This is performed by the following set of instructions:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Planet Surface -&amp;gt; Atmosphere&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Choose [Ascend] button next to the ETA counter and [Accept] button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atmosphere -&amp;gt; Orbit&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Click the [Planet] button to the left, under the map view.&lt;br /&gt;
* Click the [Orbit] button roughly in the center of the screen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Orbit -&amp;gt; Atmosphere&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Click the [Descend] button to the left, under the map view.&lt;br /&gt;
* Click the map to the right where you would like to land.&lt;br /&gt;
* Click the [Accept] button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atmosphere -&amp;gt; Planet Surface&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Click the [Descend] button to the left, under the map view.&lt;br /&gt;
* Click the map to the right where you would like to land.&lt;br /&gt;
* Click the [Accept] button.&lt;br /&gt;
&lt;br /&gt;
All four modes of transport can be performed by any ship that has Flight-Grade Repulsorlifts equipped. Vehicles that have Flight-Grade Repulsorlifts equipped can only ascend to the Atmosphere and descend from there to the Planet&#039;s Surface. Travel time for all four modes is fixed at 1 hour, regardless of the speed of your ship/vehicle.&lt;br /&gt;
&lt;br /&gt;
==Variable Travel==&lt;br /&gt;
Travel time for these modes of travel differ depending on what vehicle/ship you have, the distance that you are travelling and your skill in piloting (for that specific vehicle type).&lt;br /&gt;
&lt;br /&gt;
===Room Travel===&lt;br /&gt;
&lt;br /&gt;
Room travel is travelling within a facility or ship. Travel between rooms is instantaneous and can be achieved by clicking on the room which you wish to travel to. You can only travel to rooms which are connected to the room you are in with a doorway.&lt;br /&gt;
&lt;br /&gt;
Travel can be impeded by doors, which can be installed by a toolkit. If a door is installed within a doorway, you will need either a password, a keycard containing the password, or an electronic lock breaker in order to bypass it.&lt;br /&gt;
&lt;br /&gt;
Passwords can be reset at any time by the owner of entity the door is within.&lt;br /&gt;
&lt;br /&gt;
There are 6 different room types:&lt;br /&gt;
&lt;br /&gt;
{| Border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Normal.gif|Normal Room]] || Normal Room - No special features.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Hangar.gif|Hangar Bay]] || Hangar Bay - Can board Vehicles stored within the entity here.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Docking.gif|Docking Bay]] || Docking Bay - Can board Ships stored within the entity here.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Entrance.gif|Entrance/Exit]] || Entrance/Exit Room - Can leave the entity/board nearby entities from here.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Cockpit.gif|Cockpit]] || Cockpit - Can enter the cockpit/building management page (If piloting the entity).&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Medical.gif|Medical Room]] || Medical Room - Bacta tanks can be deployed here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Ground Travel===&lt;br /&gt;
&lt;br /&gt;
Ground travel is travelling within a city or on a terrain square. It can be accessed through both the position screen whilst on foot, or through the cockpit if at ground level in a ship or vehicle. Ground Travel allows you to travel through the streets of a city, or across terrain. Each &#039;Block&#039; is 1km&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; making terrain squares approximately 22km&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; and facilities within cities enormous sprawling complexes many kilometres wide.&lt;br /&gt;
&lt;br /&gt;
If on foot, travelling to another block can be achieved by clicking that block and clicking the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button. Travelling on foot is very slow, due to the scale of the cities, and can often take hours to reach your destination.&lt;br /&gt;
&lt;br /&gt;
If in a ship or a vehicle, travelling to another block can be achieved by selecting &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;City/Terrain&#039;&#039;&#039; &amp;gt;&amp;gt; Selecting the block from the lower map then clicking the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button. Ships and Vehicles are restricted to 200km/h within cities, however, can travel at their full speed in open terrain.&lt;br /&gt;
&lt;br /&gt;
===Atmospheric Travel===&lt;br /&gt;
&lt;br /&gt;
Atmospheric travel is travelling within the atmosphere of a planet. It allows you to travel to other cities without cross terrain or ascending to orbit.&lt;br /&gt;
&lt;br /&gt;
Certain vehicles can ascend to atmosphere, if they have the &amp;quot;Flight-Grade Repulsorlifts&amp;quot; trait.&lt;br /&gt;
&lt;br /&gt;
To travel in atmosphere, you need to be in the atmosphere level of a planet, then &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;Atmosphere&#039;&#039;&#039; &amp;gt;&amp;gt; Select the terrain from the lower map, then click the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
===Sublight Travel===&lt;br /&gt;
&lt;br /&gt;
Sublight travel allows you to travel within a system. It can only be achieved by ships within the Space layer (orbit of a planet).&lt;br /&gt;
&lt;br /&gt;
To travel within a system, you need to be in a system, in the cockpit of a ship, and click &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;Sublight&#039;&#039;&#039; &amp;gt;&amp;gt; Select the space or planet from the lower map, then click the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CAUTION&#039;&#039;&#039; Flying into suns can seriously harm your health, your ship and all occupants. Flying into suns, or &#039;Sunning&#039;, will kill your character and heavily damage the ship you are flying.&lt;br /&gt;
&lt;br /&gt;
===Hyper===&lt;br /&gt;
&lt;br /&gt;
Used by ships with hyperdrive to move from one system to another (or deep space). &lt;br /&gt;
Ships traveling in hyperspace do not appear on any map or scanners, nor will the scanners of the ship in hyperspace detect anything. Docking to or undocking from any ship in hyperspace is not possible.&lt;br /&gt;
&lt;br /&gt;
To activate the hyperdrive you must be out of any planet gravity well. A gravity well is represented by a red area on a system map and is generated by planets, stars, black holes or Gravity Generators such as those found upon Interdictor Capital Class ships. From the ship cockpit click &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;Hyper&#039;&#039;&#039; &amp;gt;&amp;gt; select the destination (sector and system or coordinates), then click &#039;&#039;&#039;Go&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:travel.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CAUTION!&#039;&#039;&#039; Aborting hyperspace travel is very risky and should only be used in an emergency!&lt;br /&gt;
&lt;br /&gt;
Expert pilots use the [[microjumping]] method to shorten their travel times, planning their routes in advance. &lt;br /&gt;
&lt;br /&gt;
===Astromech Droids===&lt;br /&gt;
Also, to avoid an hypertravel being aborted because the pilot boards another entity (e.g., vehicle or ship in the docking bay), Astromech droids can be used. The R2 type is a good one to assist piloting for freighters and smaller. The R3 is good for Corvettes and bigger.&lt;br /&gt;
&amp;lt;/ br&amp;gt;&lt;br /&gt;
The Astromech must be left in the cockpit, and if you need to board a vehicle or ship that&#039;s docked onboard, you can board it without the ship dropping from hyper travel.&lt;br /&gt;
[[Category: Game Features]]&lt;br /&gt;
[[Category: Basic Activities]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Travel&amp;diff=3921</id>
		<title>Travel</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Travel&amp;diff=3921"/>
		<updated>2025-11-02T23:05:29Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Hyper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Travel is the group of actions you can perform that make your character move around the game world. There is a wide variety of different travel methods, and these are listed below.&lt;br /&gt;
&lt;br /&gt;
==Set Travel==&lt;br /&gt;
This type of travel uses a set time or distance that does not vary whenever you use this method of travel. It also requires less knowledge (generally) of your destination than for Variable Travel.&lt;br /&gt;
&lt;br /&gt;
===Cross Terrain===&lt;br /&gt;
This type of travel involves moving between different city or terrain squares on a planets surface. This is performed by the following set of instructions:&lt;br /&gt;
&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit] or [Position], depending on whether you are in a ship/vehicle or on foot.&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Choose [Cross-Terrain] button to the left side, under the main map view.&lt;br /&gt;
* Choose the terrain/city square that is next to your current one that you wish to travel to.&lt;br /&gt;
* Click [Accept] and your travel will begin.&lt;br /&gt;
&lt;br /&gt;
You can only initiate this type of travel when you are on the very edge of the city/terrain square (ie at (0,0), or (21,4) etc). You will not have the [Cross-Terrain] option if you are not. Also, planet terrains do no &#039;wrap-around&#039; so if you are on the northern most terrain square on a planet (say, (0,0)), you will not be able to move north and appear at the terrain square at the bottom of the column, and nor does that work horizontally.&lt;br /&gt;
&lt;br /&gt;
The distance is fixed at 200km between city/terrain squares, so travel time will vary depending on how fast you/your ship/your vehicle can travel at.&lt;br /&gt;
&lt;br /&gt;
===Ascend/Descend===&lt;br /&gt;
This type of travel is used when moving to and from a planets surface. There are 2 steps, where you move from the planet&#039;s surface to the atmosphere level, and then a further jump from there to orbit, which is in the system layer where you can move around the rest of the system (see later). This is performed by the following set of instructions:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Planet Surface -&amp;gt; Atmosphere&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Choose [Ascend] button next to the ETA counter and [Accept] button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atmosphere -&amp;gt; Orbit&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Click the [Planet] button to the left, under the map view.&lt;br /&gt;
* Click the [Orbit] button roughly in the center of the screen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Orbit -&amp;gt; Atmosphere&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Click the [Descend] button to the left, under the map view.&lt;br /&gt;
* Click the map to the right where you would like to land.&lt;br /&gt;
* Click the [Accept] button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atmosphere -&amp;gt; Planet Surface&#039;&#039;&#039;&lt;br /&gt;
* ::Controls::&lt;br /&gt;
* Click [Enter Cockpit].&lt;br /&gt;
* Choose the [Travel] option in the center tool bar.&lt;br /&gt;
* Click the [Descend] button to the left, under the map view.&lt;br /&gt;
* Click the map to the right where you would like to land.&lt;br /&gt;
* Click the [Accept] button.&lt;br /&gt;
&lt;br /&gt;
All four modes of transport can be performed by any ship that has Flight-Grade Repulsorlifts equipped. Vehicles that have Flight-Grade Repulsorlifts equipped can only ascend to the Atmosphere and descend from there to the Planet&#039;s Surface. Travel time for all four modes is fixed at 1 hour, regardless of the speed of your ship/vehicle.&lt;br /&gt;
&lt;br /&gt;
==Variable Travel==&lt;br /&gt;
Travel time for these modes of travel differ depending on what vehicle/ship you have, the distance that you are travelling and your skill in piloting (for that specific vehicle type).&lt;br /&gt;
&lt;br /&gt;
===Room Travel===&lt;br /&gt;
&lt;br /&gt;
Room travel is travelling within a facility or ship. Travel between rooms is instantaneous and can be achieved by clicking on the room which you wish to travel to. You can only travel to rooms which are connected to the room you are in with a doorway.&lt;br /&gt;
&lt;br /&gt;
Travel can be impeded by doors, which can be installed by a toolkit. If a door is installed within a doorway, you will need either a password, a keycard containing the password, or an electronic lock breaker in order to bypass it.&lt;br /&gt;
&lt;br /&gt;
Passwords can be reset at any time by the owner of entity the door is within.&lt;br /&gt;
&lt;br /&gt;
There are 6 different room types:&lt;br /&gt;
&lt;br /&gt;
{| Border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Normal.gif|Normal Room]] || Normal Room - No special features.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Hangar.gif|Hangar Bay]] || Hangar Bay - Can board Vehicles stored within the entity here.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Docking.gif|Docking Bay]] || Docking Bay - Can board Ships stored within the entity here.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Entrance.gif|Entrance/Exit]] || Entrance/Exit Room - Can leave the entity/board nearby entities from here.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Cockpit.gif|Cockpit]] || Cockpit - Can enter the cockpit/building management page (If piloting the entity).&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Medical.gif|Medical Room]] || Medical Room - Bacta tanks can be deployed here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Ground Travel===&lt;br /&gt;
&lt;br /&gt;
Ground travel is travelling within a city or on a terrain square. It can be accessed through both the position screen whilst on foot, or through the cockpit if at ground level in a ship or vehicle. Ground Travel allows you to travel through the streets of a city, or across terrain. Each &#039;Block&#039; is 1km&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; making terrain squares approximately 22km&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; and facilities within cities enormous sprawling complexes many kilometres wide.&lt;br /&gt;
&lt;br /&gt;
If on foot, travelling to another block can be achieved by clicking that block and clicking the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button. Travelling on foot is very slow, due to the scale of the cities, and can often take hours to reach your destination.&lt;br /&gt;
&lt;br /&gt;
If in a ship or a vehicle, travelling to another block can be achieved by selecting &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;City/Terrain&#039;&#039;&#039; &amp;gt;&amp;gt; Selecting the block from the lower map then clicking the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button. Ships and Vehicles are restricted to 200km/h within cities, however, can travel at their full speed in open terrain.&lt;br /&gt;
&lt;br /&gt;
===Atmospheric Travel===&lt;br /&gt;
&lt;br /&gt;
Atmospheric travel is travelling within the atmosphere of a planet. It allows you to travel to other cities without cross terrain or ascending to orbit.&lt;br /&gt;
&lt;br /&gt;
Certain vehicles can ascend to atmosphere, if they have the &amp;quot;Flight-Grade Repulsorlifts&amp;quot; trait.&lt;br /&gt;
&lt;br /&gt;
To travel in atmosphere, you need to be in the atmosphere level of a planet, then &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;Atmosphere&#039;&#039;&#039; &amp;gt;&amp;gt; Select the terrain from the lower map, then click the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
===Sublight Travel===&lt;br /&gt;
&lt;br /&gt;
Sublight travel allows you to travel within a system. It can only be achieved by ships within the Space layer (orbit of a planet).&lt;br /&gt;
&lt;br /&gt;
To travel within a system, you need to be in a system, in the cockpit of a ship, and click &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;Sublight&#039;&#039;&#039; &amp;gt;&amp;gt; Select the space or planet from the lower map, then click the &amp;quot;&#039;&#039;&#039;Go&#039;&#039;&#039;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CAUTION&#039;&#039;&#039; Flying into suns can seriously harm your health, your ship and all occupants. Flying into suns, or &#039;Sunning&#039;, will kill your character and heavily damage the ship you are flying.&lt;br /&gt;
&lt;br /&gt;
===Hyper===&lt;br /&gt;
&lt;br /&gt;
Used by ships with hyperdrive to move from one system to another (or deep space). &lt;br /&gt;
Ships traveling in hyperspace do not appear on any map or scanners, nor will the scanners of the ship in hyperspace detect anything. Docking to or undocking from any ship in hyperspace is not possible.&lt;br /&gt;
&lt;br /&gt;
To activate the hyperdrive you must be out of any planet gravity well. A gravity well is represented by a red area on a system map and is generated by planets, stars, black holes or Gravity Generators such as those found upon Interdictor Capital Class ships. From the ship cockpit click &#039;&#039;&#039;Travel&#039;&#039;&#039; &amp;gt;&amp;gt; &#039;&#039;&#039;Hyper&#039;&#039;&#039; &amp;gt;&amp;gt; select the destination (sector and system or coordinates), then click &#039;&#039;&#039;Go&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:travel.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CAUTION!&#039;&#039;&#039; Aborting hyperspace travel is very risky and should only be used in an emergency!&lt;br /&gt;
&lt;br /&gt;
Expert pilots use the [[microjumping]] method to shorten their travel times, planning their routes in advance. &lt;br /&gt;
&lt;br /&gt;
Also, to avoid an hypertravel being aborted because the pilot boards another entity (e.g., vehicle or ship in the docking bay), Astromech droids can be used. The R2 type is a good one to assist piloting for freighters and smaller. The R3 is good for Corvettes and bigger.&lt;br /&gt;
&amp;lt;/ br&amp;gt;&lt;br /&gt;
The Astromech must be left in the cockpit, and if you need to board a vehicle or ship that&#039;s docked onboard, you can board it without the ship dropping from hyper travel.&lt;br /&gt;
[[Category: Game Features]]&lt;br /&gt;
[[Category: Basic Activities]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3920</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3920"/>
		<updated>2025-10-31T22:00:15Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Can I kill another character? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General Questions==&lt;br /&gt;
&lt;br /&gt;
====What is the Star Wars Combine?==== &lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine is an interactive online Star Wars simulation. People play the sim from diverse nations around the globe. The Star Wars Combine is 100% free of charge, and is a non-profit game. &lt;br /&gt;
&lt;br /&gt;
In the Combine you will be allowed to create a character of your own with several different races to choose from. Upon character creation, you will have the option to join a group from a hefty list of candidates. Life in the Combine galaxy is just like stepping into George Lucas&#039;s epic Star Wars universe with the primary difference being that, in the Combine, there are none of the original Star Wars characters. No Luke Skywalker, no Leia Organa, no Mon Mothma, etc. However, the setting and general plot are the same, there is an ongoing war between the Galactic Empire and New Republic as well as plenty of other player-driven conflicts.&lt;br /&gt;
&lt;br /&gt;
====What time period is the game set in? ====&lt;br /&gt;
&lt;br /&gt;
Though it is difficult to assess the time in comparison to the movies (since events and people are different between the two), it has been generally agreed upon that this game is set within the area of Episode IV: A New Hope and Episode V: The Empire Strikes Back. However, with the new movies and new ideas, we will be incorporating ships and systems from them as well.&lt;br /&gt;
&lt;br /&gt;
====What would make me choose to play this game? ====&lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine provides a unique gaming experience compared to other games in this modern era. Being that it is primarily a role playing (RP) game, much of the in-game history is written and dictated by the actions of our players. With just a few thousand active players, our community is relatively small but it provides ample opportunities for interaction and fun among players.&lt;br /&gt;
&lt;br /&gt;
====What are CPs (Combine Points)? ====&lt;br /&gt;
&lt;br /&gt;
The Combine Points are given to you by the admins for out of character (OOC) efforts you do to support and help the Star Wars Combine. Additionally, CPs are awarded each day that you log into SWC. You can exchange them for ships, vehicles and other inventory items (as they come available), some of which are only available through the CP exchange system.&lt;br /&gt;
&lt;br /&gt;
====What does NPC mean?==== &lt;br /&gt;
&lt;br /&gt;
NPC = Non-Playing Characters. You can hire them to work for you, build ships, fight alongside you, etc.&lt;br /&gt;
&lt;br /&gt;
====Can I kill another character? ====&lt;br /&gt;
&lt;br /&gt;
Right now there is no direct way to kill a character. You can kill your character yourself by flying voluntarily into a sun or black hole, which also kills any other passengers located on that ship if the ship class is a Fighter, or Gunboat. For any other ship class, only the pilot is killed.&lt;br /&gt;
&amp;lt;/ br&amp;gt;&lt;br /&gt;
For more information you can read the Rules page: https://www.swcombine.com/rules/?Life_and_Death#How_can_you_die?&lt;br /&gt;
&lt;br /&gt;
====Why are the prices of the ships higher than those shown in the rules area? ====&lt;br /&gt;
&lt;br /&gt;
The prices shown in the rules area are the prices of production. The real prices depend on the traders and the in-game demand for ships.&lt;br /&gt;
&lt;br /&gt;
====Can I have more than one character? ====&lt;br /&gt;
&lt;br /&gt;
No, you are only allowed to have one character in the Combine. If your character dies you may create a new one after a period of time. Even if you leave your character for long periods of time, it is still best to try and log back in as that character or check with one of the administrators to see if your old character still exists before creating a new one. &lt;br /&gt;
&lt;br /&gt;
====Can more than one player use the same computer? ====&lt;br /&gt;
&lt;br /&gt;
Yes, but you must link the accounts via the Multi Self-Registration system. For more information check out https://www.swcombine.com/rules/?Character_Creation&lt;br /&gt;
&lt;br /&gt;
====How can I remake my character? ====&lt;br /&gt;
&lt;br /&gt;
Once a character is made in the Combine, it cannot be altered. The only ways a new character can be made is if your character dies or if you &amp;quot;drop&amp;quot; your character (you can find a link to &amp;quot;drop&amp;quot; your character by clicking the &amp;quot;Character&amp;quot; link on the side of the page). If stats are your concern, you are allowed a single re-roll prior to hitting level 3. Additionally, your skills may be upgraded as you progress in the game.&lt;br /&gt;
&lt;br /&gt;
====Why must I wait a period of time to create a new character?==== &lt;br /&gt;
&lt;br /&gt;
This delay was set in order to keep Combine players from creating, killing, and then recreating characters in hopes of getting a Force-sensitive one.&lt;br /&gt;
&lt;br /&gt;
====Who developed/is developing the Combine? ====&lt;br /&gt;
&lt;br /&gt;
The current and former staff of Combine can be found on the Contacts page under the link &amp;quot;The SWC Team&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Is the Combine affiliated with LucasArts/Disney?==== &lt;br /&gt;
&lt;br /&gt;
The Combine is an independent game created by a group of people that love Star Wars. They are not part of LucasArts/Disney.&lt;br /&gt;
&lt;br /&gt;
====What are White Scenarios? ====&lt;br /&gt;
&lt;br /&gt;
White scenarios are in-character (IC) role-playing scenarios that have members of the combine performing actions through the forums. GM&#039;s monitor the scenarios and perform actions with NPC&#039;s. In White Scenarios there are no repercussions for being involved. If you die in one, you will still be alive in the Combine. Depending on how well you role-play in the scenarios you will be given experience points (XPs). You can find scenarios through the community links RPG Centre under Portals. &lt;br /&gt;
&lt;br /&gt;
====What Messaging System do most members use? ====&lt;br /&gt;
&lt;br /&gt;
Most members use either the Combine messaging system (often referred to as &amp;quot;Darkness Message&amp;quot;), Discord, or SWC&#039;s IRC server. Currently, a directory of active Discord channels is maintained in the &amp;quot;General Talk&amp;quot; forum.&lt;br /&gt;
&lt;br /&gt;
====What is IRC? ====&lt;br /&gt;
&lt;br /&gt;
IRC is a instant messaging server. Some combine players use IRC as a primary form of communication to their factions.&lt;br /&gt;
&lt;br /&gt;
====How do I register on IRC and what does it do? ====&lt;br /&gt;
&lt;br /&gt;
Registering on IRC secures your user name to help make sure no one else can use it. To register you will need to type /msg NickServ REGISTER password e-mail (change e-mail and password to what you would like for them both [example /msg NickServ REGISTER 123456 example@hotmail.com) After this you’ll receive a conformation e-mail and every time you log in you will need to type in /msg NickServ IDENTIFY password&lt;br /&gt;
&lt;br /&gt;
====What server do I go to on IRC? ====&lt;br /&gt;
&lt;br /&gt;
irc.swc-irc.com&lt;br /&gt;
&lt;br /&gt;
====How can I be in more than one IRC channel at once? ====&lt;br /&gt;
&lt;br /&gt;
You will need to download an IRC chat client (e.g., mIRC from http://www.mirc.com ). Download and install this and you can be in as many channels as you want! It also has other handy features to make chatting easier.&lt;br /&gt;
&lt;br /&gt;
====Can I also create a city?==== &lt;br /&gt;
&lt;br /&gt;
Anyone can create a city, yes. However, there are some requirements to construct a city. The terrain square you selected must be non-volcanic. Also, either you or your faction must posses the required amount of credits to build a city. It costs a minimum of 1,500,000 credits to build a city.&lt;br /&gt;
&lt;br /&gt;
====I must travel to a system but I don&#039;t know where it is. ====&lt;br /&gt;
&lt;br /&gt;
If you want to find out where a system, sector, planet or city you have to travel to is then you can look at the galaxy map. It is easy to navigate and can be found here: http://www.swcombine.com/rules/?Galaxy_Map&lt;br /&gt;
&lt;br /&gt;
====How do I increase my skill points? ====&lt;br /&gt;
&lt;br /&gt;
Every time you level, you receive a new skill point to use. These skill points can be allocated to your skills via the Character link on your right menu. However, such increases cannot be undone, and the definitions for skills which are not yet implemented may change in the future.&lt;br /&gt;
&lt;br /&gt;
====How long does my character stay in combine if I am not active anymore? ====&lt;br /&gt;
&lt;br /&gt;
Characters with XP Level 1 are wiped after 9 months of inactivity, all characters above Level 1 are retrievable at any time. Dead characters, however, can never be retrieved.&lt;br /&gt;
&lt;br /&gt;
====This stat doesn&#039;t seem to do anything yet, why is it there? ====&lt;br /&gt;
&lt;br /&gt;
Not all of the stats in the game have a use yet, but when the game is fully operational they will all have a use. You can view what your stats will be used for by reading through the various rules in the technical section.&lt;br /&gt;
&lt;br /&gt;
====How much experience do I need to raise up my Experience Level?==== &lt;br /&gt;
&lt;br /&gt;
The needed experience is not the same for every level. To achieve level 2 you need 1000 experience, for level 3 - 3000. For level n you will need 1000 x (n-1) x n / 2. You can find a table with the experience points needed up to level 9 in the rules section.&lt;br /&gt;
&lt;br /&gt;
====Can I create a new faction?==== &lt;br /&gt;
&lt;br /&gt;
Yes you can. To do so you will need to satisfy the conditions found on the Faction Creation rules.&lt;br /&gt;
&lt;br /&gt;
==Technical Questions== &lt;br /&gt;
&lt;br /&gt;
====What do I need to play the Combine in the terms of hardware, software, etc?==== &lt;br /&gt;
&lt;br /&gt;
A computer or smartphone capable of connecting to the Internet and a web browser.&lt;br /&gt;
&lt;br /&gt;
====Do I have to download any software to play?==== &lt;br /&gt;
&lt;br /&gt;
No, all that you need is a browser.&lt;br /&gt;
 &lt;br /&gt;
==Rules Questions==&lt;br /&gt;
&lt;br /&gt;
====Where can I find SWC&#039;s rules?==== &lt;br /&gt;
&lt;br /&gt;
You can find them and other information about the SWC at: https://www.swcombine.com/rules/&lt;br /&gt;
&lt;br /&gt;
====What happens if I die?==== &lt;br /&gt;
&lt;br /&gt;
You lose all of your characters experience points, inventory and money. You will keep only your Combine Points and in three weeks you will be able to create a new character.&lt;br /&gt;
&lt;br /&gt;
====Is theft allowed in the Combine? ====&lt;br /&gt;
&lt;br /&gt;
Theft occurs in the Combine. How your character reacts or performs it is up to you.&lt;br /&gt;
&lt;br /&gt;
====Why can I not change the details (like ownership) of a ship owned by a faction?==== &lt;br /&gt;
&lt;br /&gt;
You can only change a ship&#039;s information if you own it. Ships given by a faction for your use are a privilege, and being such are not owned by you. This action was implemented in order to prevent theft of a faction&#039;s property&lt;br /&gt;
&lt;br /&gt;
====Is the Combine played in real time? ====&lt;br /&gt;
&lt;br /&gt;
The Combine is played in delayed real time. For more information read https://www.swcombine.com/rules/?Timeframe&lt;br /&gt;
&lt;br /&gt;
====What is spying and is it allowed?==== &lt;br /&gt;
&lt;br /&gt;
Spying is when you infiltrate a faction in order to gain information for another faction or person. Currently it is permitted under the rules. Full details on what you may and may not do in regards to spying can be found at http://www.swcombine.com/rules/?Spying .&lt;br /&gt;
&lt;br /&gt;
====What are raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials are the materials required to produce a certain piece of technology (ship, vehicle, weapon, etc.).&lt;br /&gt;
&lt;br /&gt;
====How can I die?==== &lt;br /&gt;
&lt;br /&gt;
Currently, there are only a few ways to die: running a ship into a sun or black hole, aborting hyper travel and crashing into a celestial body, or getting your faction, or someone else, to execute you. Players may also &amp;quot;drop&amp;quot; their character to start a new one (the three week respawn timer still applies).&lt;br /&gt;
&lt;br /&gt;
====How do I get raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials can be mined or recovered via recycling. For mining, prospecting vehicles must be used to scan planets for deposits, and then a mining faction must construct a mine at the deposit location in order to mine the deposit for materials. For recycling, specific recycling entities must be used to break apart entities or wrecks into their basic materials.&lt;br /&gt;
 &lt;br /&gt;
==Getting Started Questions== &lt;br /&gt;
&lt;br /&gt;
====Can I be a jedi?==== &lt;br /&gt;
&lt;br /&gt;
Every race has its own force probability, giving you a chance to be born force sensitive. But if you are not, then you can still become one later by gaining experience and levels.&lt;br /&gt;
&lt;br /&gt;
====Why is the handle I selected declined?==== &lt;br /&gt;
&lt;br /&gt;
1: It has to sound like a word (Ex: &amp;quot;bgfive&amp;quot; or &amp;quot;imlame&amp;quot; would not be accepted, while &amp;quot;John doe&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
2: It can not be the name of an star wars character, although using the first or last names is allowed (Ex: &amp;quot;Luke skywalker is not a legal handle, but &amp;quot;Luke deacon&amp;quot; or &amp;quot;Mike skywalker&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
3: No titles in your handle are allowed (Ex: no &amp;quot;Sir&amp;quot; &amp;quot;Darth&amp;quot; &amp;quot;Princess&amp;quot; &amp;quot;Dr.&amp;quot; etc...)&lt;br /&gt;
&lt;br /&gt;
4: All handles must have a capital for the first letter of the name (Ex: &amp;quot;john doe&amp;quot; is not legit, but &amp;quot;John doe&amp;quot; is)&lt;br /&gt;
&lt;br /&gt;
5: No special chars in it other then spaces, -, or ` (Ex: &amp;quot;John5 doe&amp;quot; would be illegal, but &amp;quot;John&#039;ell doe&amp;quot; would work)&lt;br /&gt;
&lt;br /&gt;
Each handle is unique; if it&#039;s too close to the name of another character it will be declined. (Ex: if you try to set your handle as &amp;quot;Jennifer Dreighton&amp;quot; it will automatically fail, since there already is a &amp;quot;Jennifer Dreighton&amp;quot;). You may have the same last name as another character, but you require their permission first. (Ex: There is a &amp;quot;Wilhelm von Ismay&amp;quot; and a &amp;quot;Victor von Ismay&amp;quot;, but Wilhelm got Victor&#039;s permission before setting his last name to that).&lt;br /&gt;
&lt;br /&gt;
====How do I log in? It keeps refreshing the page.==== &lt;br /&gt;
&lt;br /&gt;
First, use Lost Password to request a new password and log in with that. Be sure to paste or type it in exactly, as it is case sensitive.&lt;br /&gt;
&lt;br /&gt;
If that fails, check to ensure that you are using the up to date version of your web browser. Clear your cache and make sure cookies are enabled.&lt;br /&gt;
&lt;br /&gt;
If you are still having no luck, consider temporarily trying an alternate browser such as Opera (www.opera.com) or Mozilla (www.mozilla.org).&lt;br /&gt;
&lt;br /&gt;
====How can I earn credits?==== &lt;br /&gt;
&lt;br /&gt;
1. You can join a faction that pays its members a salary and/or bonuses.&lt;br /&gt;
&lt;br /&gt;
2. You can buy items and sell it for more.&lt;br /&gt;
&lt;br /&gt;
3. You can collect CPs and exchange them for entities that can be sold for credits.&lt;br /&gt;
&lt;br /&gt;
For more information, see the article on [[Credits]].&lt;br /&gt;
&lt;br /&gt;
====How can I get a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
In the beginning of your character&#039;s life, you will have the option of purchasing 3 ships for a very steep discount at the end of the tutorial, besides that, the easiest way of getting a ship or vehicle is by joining a faction and be assigned one. Later on when you have enough money you can buy another one for yourself. Another possibility is to exchange your CPs for some of the available ships and vehicles in the CP exchange.&lt;br /&gt;
&lt;br /&gt;
====Which faction should I join?==== &lt;br /&gt;
&lt;br /&gt;
That depends on who you want your character to be - a rebel or an empire supporter, a bounty hunter, a trader, a pirate, a researcher, etc. If you want to fly an X-Wing or a Mon Calamari cruiser, then you should join the Rebel Alliance or one of its allies. If you prefer the Tie Fighters and the Star Destroyers then you should definitely join the Galactic Empire. Of course you can join any other faction as well, depending on your interests. And who says you have to join any at all?&lt;br /&gt;
&lt;br /&gt;
====How do I get more Credits? ====&lt;br /&gt;
&lt;br /&gt;
The easiest way is to join a faction and receive a salary. You can also exchange CPs for entities that can be sold for credits. Alternately, you can start your own business like transporting ships and passengers for credits. Another possibility is to get a loan from a Bank faction or from another player, if you find somebody willing to loan you money.&lt;br /&gt;
&lt;br /&gt;
====How can I get off my starting planet?==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Make your way through the tutorial and purchase a ship.&lt;br /&gt;
&lt;br /&gt;
2. Join a faction, most offer transport to the planet you&#039;ll be working on, or supply a ship to fly around in.&lt;br /&gt;
&lt;br /&gt;
3. Buy a ride from another player or a transport faction, or rent a ship from another player/faction.&lt;br /&gt;
&lt;br /&gt;
4. Save up CPs and exchange them for a ship. &lt;br /&gt;
&lt;br /&gt;
5. Purchase a ship and have it moved to your location, to do this you&#039;ll need to earn some money first.&lt;br /&gt;
&lt;br /&gt;
====How to change my location (travel)? ====&lt;br /&gt;
&lt;br /&gt;
If you want to move from one position to another you have to go to position =&amp;gt; travel =&amp;gt; city =&amp;gt; you can enter some coordinates. If you give coordinates from (0,0) to (21,21) when you are on foot (walking), you will travel only inside the city. If you want to go to another city, first move to the edge of your current city in the direction you would like to go. Then go to position =&amp;gt; travel =&amp;gt; cross terrain =&amp;gt; then you can pick a position to where you want to go to.&lt;br /&gt;
&lt;br /&gt;
====I just created my character and assigned skill points. Where do I go and what do I do?==== &lt;br /&gt;
&lt;br /&gt;
It&#039;s up to you. You can work alone and be a freelancer or you can join a faction. While being an independent freelancer may sound fun, it doesn&#039;t provide the benefits a faction does such as paychecks every month, a neat duty like piloting a ship or vehicle, and a place to call home. Visit http://www.swcombine.com/community/factions.php for more details on the various factions. If you are interested in a faction, it would not be a bad idea to check out that faction’s website, as well as contacting a member from the faction&#039;s recruiting office to get more information on that faction’s services and benefits.&lt;br /&gt;
 &lt;br /&gt;
==How to Questions== &lt;br /&gt;
&lt;br /&gt;
====How can I gain CPs?==== &lt;br /&gt;
&lt;br /&gt;
The easiest way is to simply log in and play! You are awarded CPs every day that you log in. Suggesting planet descriptions, reporting bugs and typos, working on admin assignments or other ways of helping the development of the Combine can also be awarded.&lt;br /&gt;
&lt;br /&gt;
====How can I improve my skills? ====&lt;br /&gt;
&lt;br /&gt;
For every Experience Level you achieve, 1 skill point is added to your skill pool, which you can use to improve your skills, using the Character link on your right menu. However, skill increases cannot be undone, and it is possible that skill definitions for features not yet implemented may be changed in the future.&lt;br /&gt;
&lt;br /&gt;
====How can I get more experience? ====&lt;br /&gt;
&lt;br /&gt;
Experience points can be gained in many ways. Flying ships or piloting vehicles is a common method, it is also possible to gain them by mining or prospecting. Constructing buildings or stations gains an amount of experience. Small amounts are also awarded for certain achievements such as sending your first message or joining your first faction. Other ways may be added as the game develops.&lt;br /&gt;
&lt;br /&gt;
====How can I send a message to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the Send message link in your menu (it looks like an envelope) then Send Message. Enter the handle of the recipient and enter the message itself.&lt;br /&gt;
&lt;br /&gt;
====How can I send credits to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the display of your current credits total in the right hand menu. This should bring up the Transfer Credits screen. Enter the handle of the character or the name of the faction to receive the credits, then enter the amount and add a comment if you want. Finally click Transfer.&lt;br /&gt;
&lt;br /&gt;
====How do I join a faction? ====&lt;br /&gt;
&lt;br /&gt;
Click the Faction link on the right hand menu and then on Join Faction. Select the one you would want to join, add a message if you want, click submit and await further instructions. Generally allow up to 24-48 hours for a reply from the faction to see if you have been accepted or not.&lt;br /&gt;
&lt;br /&gt;
====How do I launch a missile, fire my blaster or beat up a Wookiee? ====&lt;br /&gt;
&lt;br /&gt;
Full-scale Player vs. Player (PvP) Combat is not yet implemented. It is possible to brawl with Brawler NPCs for experience points and factions have the ability to arrest and execute. Ground combat is currently in beta - there are a couple systems that allow PvP ground combat while Player vs. Environment (PvE) is implemented in every system - while space combat is in alpha - one may find space bandits hiding in asteroid fields in deep space.&lt;br /&gt;
&lt;br /&gt;
====How do I report a bug? ====&lt;br /&gt;
&lt;br /&gt;
If you encounter a bug, click on the &amp;quot;Report Bug&amp;quot; link at the bottom of the right side menu. Please browse though the list of bugs to make sure that the bug you are reporting is a new one. If you find that your bug is already listed, add a comment to it stating your problem as well.&lt;br /&gt;
&lt;br /&gt;
====How can I support the Combine?==== &lt;br /&gt;
&lt;br /&gt;
There are many ways to support the Combine. You can join one of the many volunteer teams (Art, Descriptions, Development, QA) to help improve the game. You can report bugs and typos.&lt;br /&gt;
&lt;br /&gt;
====How do I buy weapons/droids/items? ====&lt;br /&gt;
&lt;br /&gt;
A few minor items can already be bought in Shop and Commerce Centre facilities. Shops can be found in most starting cities and are NPC-owned, while Commerce Centres are faction/player owned.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the majority of weapons, droids, and items can be purchased from the faction that produces them, which is displayed on the rules page for the item in question, or from players who already own them.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s demonstrate a trade between two players. The person who buys the ship (Luke) has to contact the person who sells the ship (Han). Next, Luke has to pay for the ship by clicking on transaction sheet/credits transaction/transfer credits. Afterward, Luke must write the name of receiver, amount and communication and then choose the receiver type. When all this has been done, Luke solidifies the credit transfer by clicking on the &amp;quot;transfer&amp;quot; button. To give Luke his ship after receiving payment, Han has to click on &amp;quot;ships&amp;quot; in his personal inventory and choose who he wants to give the ship to (faction or person). Han must then select the ship Luke paid for and click on &amp;quot;Make Over.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Be warned that there are no guarantees for trading in the Combine and theft is an ever-present factor in the game.&lt;br /&gt;
&lt;br /&gt;
====How do I enter a ship or vehicle?==== &lt;br /&gt;
&lt;br /&gt;
First, you have to be assigned to the crewlist or set as owner/commander/pilot of the ship or vehicle to be able to board it. Once that is taken care of, click on &amp;quot;Position&amp;quot;, then &amp;quot;Enter&amp;quot;. If the above parameters are met, you should be able to see the ship. Click &amp;quot;Board&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====How do I pilot a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
After you have entered the ship or vehicle there will be a room map representing the layout of the entity in which you now reside. Find your way to the cockpit and a new button will appear on the side of the screen titled &amp;quot;Ship Controls&amp;quot; (or &amp;quot;Vehicle Controls&amp;quot;). Click that button and you will be taken to a new screen that will allow you to pilot your ship/vehicle.&lt;br /&gt;
&lt;br /&gt;
====How do I travel in a ship?==== &lt;br /&gt;
&lt;br /&gt;
To move around within a ship, your status in the Control panel must be set to Position (as opposed to Cockpit -- see below).&lt;br /&gt;
&lt;br /&gt;
To operate a ship, you first travel from the entrance room to the cockpit room. Once in the cockpit room, click &amp;quot;Ship Controls&amp;quot; (this option will only appear if you have been assigned as the pilot of the ship).&lt;br /&gt;
&lt;br /&gt;
To lift off, hit the Travel button then Ascend. It takes an hour to reach (upper) atmosphere.&lt;br /&gt;
&lt;br /&gt;
Once in the upper atmosphere, you need to reach orbit; this takes another hour. You do this from the Travel section by hitting Travel, then Orbit.&lt;br /&gt;
&lt;br /&gt;
Once in orbit, you have to escape the gravity well of the planet you&#039;re orbiting; this is the section shaded in red on the display under Travel. Hit the Sublight button and click on some square that is not in the red. This should take roughly half an hour of travel.&lt;br /&gt;
&lt;br /&gt;
Once out of the gravity well, you&#039;re free to go Hyper. Hit the Hyper button, then select from the menu of sectors (or choose a sector from the map of the galaxy), then select the desired system and Go.&lt;br /&gt;
&lt;br /&gt;
NOTE: Don&#039;t try to abort once in Hyper. You can lose the ship and be killed that way, should you come out near a celestial body.&lt;br /&gt;
&lt;br /&gt;
Upon entering a system, you&#039;ll be still a bit out from your destination planet; you&#039;ll have to hit Sublight and indicate which planet you want to go to.&lt;br /&gt;
&lt;br /&gt;
Upon arrival at the planet, you&#039;re in orbit. You can, at that point, change over to any other ship also in orbit for which you are listed as a Crewmember. To do this, Travel to that room in the ship which has the exit, hit Board, and select from among ships to which you have entree.&lt;br /&gt;
&lt;br /&gt;
To land a ship on the ground, you must reverse the lift-off procedure: First hit Travel, then Descend (and you can select your destination square on the planet); that takes an hour to put you in atmosphere. Once in atmosphere, you land by hitting Descend in the Travel section (and you can select your destination square in the city). Once landed, you can leave the ship by travelling to an exit room and hitting Board.&lt;br /&gt;
&lt;br /&gt;
NOTE: Some planets are protected by shields and will require access to descend to the ground.&lt;br /&gt;
&lt;br /&gt;
When you have been assigned as Pilot to a ship, you can then manage the crewlist. You do this with the Crewlist button on the bottom of the panel.&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
&lt;br /&gt;
Travel: Board&lt;br /&gt;
Control: Position: Travel to cockpit room&lt;br /&gt;
Control: Enter Cockpit&lt;br /&gt;
&lt;br /&gt;
Travel: Ascend to atmosphere&lt;br /&gt;
Travel: Ascend to orbit&lt;br /&gt;
Travel: Sublight out of gravity well&lt;br /&gt;
Travel: Hyper to new system&lt;br /&gt;
Travel: Sublight to planet&lt;br /&gt;
Travel: Descend to atmosphere&lt;br /&gt;
Travel: Descend to ground&lt;br /&gt;
&lt;br /&gt;
Control: Position: Travel to exit room&lt;br /&gt;
Travel: Board&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3919</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3919"/>
		<updated>2025-10-31T16:53:31Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Can I kill another character? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General Questions==&lt;br /&gt;
&lt;br /&gt;
====What is the Star Wars Combine?==== &lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine is an interactive online Star Wars simulation. People play the sim from diverse nations around the globe. The Star Wars Combine is 100% free of charge, and is a non-profit game. &lt;br /&gt;
&lt;br /&gt;
In the Combine you will be allowed to create a character of your own with several different races to choose from. Upon character creation, you will have the option to join a group from a hefty list of candidates. Life in the Combine galaxy is just like stepping into George Lucas&#039;s epic Star Wars universe with the primary difference being that, in the Combine, there are none of the original Star Wars characters. No Luke Skywalker, no Leia Organa, no Mon Mothma, etc. However, the setting and general plot are the same, there is an ongoing war between the Galactic Empire and New Republic as well as plenty of other player-driven conflicts.&lt;br /&gt;
&lt;br /&gt;
====What time period is the game set in? ====&lt;br /&gt;
&lt;br /&gt;
Though it is difficult to assess the time in comparison to the movies (since events and people are different between the two), it has been generally agreed upon that this game is set within the area of Episode IV: A New Hope and Episode V: The Empire Strikes Back. However, with the new movies and new ideas, we will be incorporating ships and systems from them as well.&lt;br /&gt;
&lt;br /&gt;
====What would make me choose to play this game? ====&lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine provides a unique gaming experience compared to other games in this modern era. Being that it is primarily a role playing (RP) game, much of the in-game history is written and dictated by the actions of our players. With just a few thousand active players, our community is relatively small but it provides ample opportunities for interaction and fun among players.&lt;br /&gt;
&lt;br /&gt;
====What are CPs (Combine Points)? ====&lt;br /&gt;
&lt;br /&gt;
The Combine Points are given to you by the admins for out of character (OOC) efforts you do to support and help the Star Wars Combine. Additionally, CPs are awarded each day that you log into SWC. You can exchange them for ships, vehicles and other inventory items (as they come available), some of which are only available through the CP exchange system.&lt;br /&gt;
&lt;br /&gt;
====What does NPC mean?==== &lt;br /&gt;
&lt;br /&gt;
NPC = Non-Playing Characters. You can hire them to work for you, build ships, fight alongside you, etc.&lt;br /&gt;
&lt;br /&gt;
====Can I kill another character? ====&lt;br /&gt;
&lt;br /&gt;
Right now there is no direct way to kill a character. You can kill your character yourself by flying voluntarily into a sun or black hole, which also kills any other passengers located on that ship if the ship class is a Fighter, or Gunboat. For any other ship class, only the pilot is killed.&lt;br /&gt;
&lt;br /&gt;
====Why are the prices of the ships higher than those shown in the rules area? ====&lt;br /&gt;
&lt;br /&gt;
The prices shown in the rules area are the prices of production. The real prices depend on the traders and the in-game demand for ships.&lt;br /&gt;
&lt;br /&gt;
====Can I have more than one character? ====&lt;br /&gt;
&lt;br /&gt;
No, you are only allowed to have one character in the Combine. If your character dies you may create a new one after a period of time. Even if you leave your character for long periods of time, it is still best to try and log back in as that character or check with one of the administrators to see if your old character still exists before creating a new one. &lt;br /&gt;
&lt;br /&gt;
====Can more than one player use the same computer? ====&lt;br /&gt;
&lt;br /&gt;
Yes, but you must link the accounts via the Multi Self-Registration system. For more information check out https://www.swcombine.com/rules/?Character_Creation&lt;br /&gt;
&lt;br /&gt;
====How can I remake my character? ====&lt;br /&gt;
&lt;br /&gt;
Once a character is made in the Combine, it cannot be altered. The only ways a new character can be made is if your character dies or if you &amp;quot;drop&amp;quot; your character (you can find a link to &amp;quot;drop&amp;quot; your character by clicking the &amp;quot;Character&amp;quot; link on the side of the page). If stats are your concern, you are allowed a single re-roll prior to hitting level 3. Additionally, your skills may be upgraded as you progress in the game.&lt;br /&gt;
&lt;br /&gt;
====Why must I wait a period of time to create a new character?==== &lt;br /&gt;
&lt;br /&gt;
This delay was set in order to keep Combine players from creating, killing, and then recreating characters in hopes of getting a Force-sensitive one.&lt;br /&gt;
&lt;br /&gt;
====Who developed/is developing the Combine? ====&lt;br /&gt;
&lt;br /&gt;
The current and former staff of Combine can be found on the Contacts page under the link &amp;quot;The SWC Team&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Is the Combine affiliated with LucasArts/Disney?==== &lt;br /&gt;
&lt;br /&gt;
The Combine is an independent game created by a group of people that love Star Wars. They are not part of LucasArts/Disney.&lt;br /&gt;
&lt;br /&gt;
====What are White Scenarios? ====&lt;br /&gt;
&lt;br /&gt;
White scenarios are in-character (IC) role-playing scenarios that have members of the combine performing actions through the forums. GM&#039;s monitor the scenarios and perform actions with NPC&#039;s. In White Scenarios there are no repercussions for being involved. If you die in one, you will still be alive in the Combine. Depending on how well you role-play in the scenarios you will be given experience points (XPs). You can find scenarios through the community links RPG Centre under Portals. &lt;br /&gt;
&lt;br /&gt;
====What Messaging System do most members use? ====&lt;br /&gt;
&lt;br /&gt;
Most members use either the Combine messaging system (often referred to as &amp;quot;Darkness Message&amp;quot;), Discord, or SWC&#039;s IRC server. Currently, a directory of active Discord channels is maintained in the &amp;quot;General Talk&amp;quot; forum.&lt;br /&gt;
&lt;br /&gt;
====What is IRC? ====&lt;br /&gt;
&lt;br /&gt;
IRC is a instant messaging server. Some combine players use IRC as a primary form of communication to their factions.&lt;br /&gt;
&lt;br /&gt;
====How do I register on IRC and what does it do? ====&lt;br /&gt;
&lt;br /&gt;
Registering on IRC secures your user name to help make sure no one else can use it. To register you will need to type /msg NickServ REGISTER password e-mail (change e-mail and password to what you would like for them both [example /msg NickServ REGISTER 123456 example@hotmail.com) After this you’ll receive a conformation e-mail and every time you log in you will need to type in /msg NickServ IDENTIFY password&lt;br /&gt;
&lt;br /&gt;
====What server do I go to on IRC? ====&lt;br /&gt;
&lt;br /&gt;
irc.swc-irc.com&lt;br /&gt;
&lt;br /&gt;
====How can I be in more than one IRC channel at once? ====&lt;br /&gt;
&lt;br /&gt;
You will need to download an IRC chat client (e.g., mIRC from http://www.mirc.com ). Download and install this and you can be in as many channels as you want! It also has other handy features to make chatting easier.&lt;br /&gt;
&lt;br /&gt;
====Can I also create a city?==== &lt;br /&gt;
&lt;br /&gt;
Anyone can create a city, yes. However, there are some requirements to construct a city. The terrain square you selected must be non-volcanic. Also, either you or your faction must posses the required amount of credits to build a city. It costs a minimum of 1,500,000 credits to build a city.&lt;br /&gt;
&lt;br /&gt;
====I must travel to a system but I don&#039;t know where it is. ====&lt;br /&gt;
&lt;br /&gt;
If you want to find out where a system, sector, planet or city you have to travel to is then you can look at the galaxy map. It is easy to navigate and can be found here: http://www.swcombine.com/rules/?Galaxy_Map&lt;br /&gt;
&lt;br /&gt;
====How do I increase my skill points? ====&lt;br /&gt;
&lt;br /&gt;
Every time you level, you receive a new skill point to use. These skill points can be allocated to your skills via the Character link on your right menu. However, such increases cannot be undone, and the definitions for skills which are not yet implemented may change in the future.&lt;br /&gt;
&lt;br /&gt;
====How long does my character stay in combine if I am not active anymore? ====&lt;br /&gt;
&lt;br /&gt;
Characters with XP Level 1 are wiped after 9 months of inactivity, all characters above Level 1 are retrievable at any time. Dead characters, however, can never be retrieved.&lt;br /&gt;
&lt;br /&gt;
====This stat doesn&#039;t seem to do anything yet, why is it there? ====&lt;br /&gt;
&lt;br /&gt;
Not all of the stats in the game have a use yet, but when the game is fully operational they will all have a use. You can view what your stats will be used for by reading through the various rules in the technical section.&lt;br /&gt;
&lt;br /&gt;
====How much experience do I need to raise up my Experience Level?==== &lt;br /&gt;
&lt;br /&gt;
The needed experience is not the same for every level. To achieve level 2 you need 1000 experience, for level 3 - 3000. For level n you will need 1000 x (n-1) x n / 2. You can find a table with the experience points needed up to level 9 in the rules section.&lt;br /&gt;
&lt;br /&gt;
====Can I create a new faction?==== &lt;br /&gt;
&lt;br /&gt;
Yes you can. To do so you will need to satisfy the conditions found on the Faction Creation rules.&lt;br /&gt;
&lt;br /&gt;
==Technical Questions== &lt;br /&gt;
&lt;br /&gt;
====What do I need to play the Combine in the terms of hardware, software, etc?==== &lt;br /&gt;
&lt;br /&gt;
A computer or smartphone capable of connecting to the Internet and a web browser.&lt;br /&gt;
&lt;br /&gt;
====Do I have to download any software to play?==== &lt;br /&gt;
&lt;br /&gt;
No, all that you need is a browser.&lt;br /&gt;
 &lt;br /&gt;
==Rules Questions==&lt;br /&gt;
&lt;br /&gt;
====Where can I find SWC&#039;s rules?==== &lt;br /&gt;
&lt;br /&gt;
You can find them and other information about the SWC at: https://www.swcombine.com/rules/&lt;br /&gt;
&lt;br /&gt;
====What happens if I die?==== &lt;br /&gt;
&lt;br /&gt;
You lose all of your characters experience points, inventory and money. You will keep only your Combine Points and in three weeks you will be able to create a new character.&lt;br /&gt;
&lt;br /&gt;
====Is theft allowed in the Combine? ====&lt;br /&gt;
&lt;br /&gt;
Theft occurs in the Combine. How your character reacts or performs it is up to you.&lt;br /&gt;
&lt;br /&gt;
====Why can I not change the details (like ownership) of a ship owned by a faction?==== &lt;br /&gt;
&lt;br /&gt;
You can only change a ship&#039;s information if you own it. Ships given by a faction for your use are a privilege, and being such are not owned by you. This action was implemented in order to prevent theft of a faction&#039;s property&lt;br /&gt;
&lt;br /&gt;
====Is the Combine played in real time? ====&lt;br /&gt;
&lt;br /&gt;
The Combine is played in delayed real time. For more information read https://www.swcombine.com/rules/?Timeframe&lt;br /&gt;
&lt;br /&gt;
====What is spying and is it allowed?==== &lt;br /&gt;
&lt;br /&gt;
Spying is when you infiltrate a faction in order to gain information for another faction or person. Currently it is permitted under the rules. Full details on what you may and may not do in regards to spying can be found at http://www.swcombine.com/rules/?Spying .&lt;br /&gt;
&lt;br /&gt;
====What are raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials are the materials required to produce a certain piece of technology (ship, vehicle, weapon, etc.).&lt;br /&gt;
&lt;br /&gt;
====How can I die?==== &lt;br /&gt;
&lt;br /&gt;
Currently, there are only a few ways to die: running a ship into a sun or black hole, aborting hyper travel and crashing into a celestial body, or getting your faction, or someone else, to execute you. Players may also &amp;quot;drop&amp;quot; their character to start a new one (the three week respawn timer still applies).&lt;br /&gt;
&lt;br /&gt;
====How do I get raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials can be mined or recovered via recycling. For mining, prospecting vehicles must be used to scan planets for deposits, and then a mining faction must construct a mine at the deposit location in order to mine the deposit for materials. For recycling, specific recycling entities must be used to break apart entities or wrecks into their basic materials.&lt;br /&gt;
 &lt;br /&gt;
==Getting Started Questions== &lt;br /&gt;
&lt;br /&gt;
====Can I be a jedi?==== &lt;br /&gt;
&lt;br /&gt;
Every race has its own force probability, giving you a chance to be born force sensitive. But if you are not, then you can still become one later by gaining experience and levels.&lt;br /&gt;
&lt;br /&gt;
====Why is the handle I selected declined?==== &lt;br /&gt;
&lt;br /&gt;
1: It has to sound like a word (Ex: &amp;quot;bgfive&amp;quot; or &amp;quot;imlame&amp;quot; would not be accepted, while &amp;quot;John doe&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
2: It can not be the name of an star wars character, although using the first or last names is allowed (Ex: &amp;quot;Luke skywalker is not a legal handle, but &amp;quot;Luke deacon&amp;quot; or &amp;quot;Mike skywalker&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
3: No titles in your handle are allowed (Ex: no &amp;quot;Sir&amp;quot; &amp;quot;Darth&amp;quot; &amp;quot;Princess&amp;quot; &amp;quot;Dr.&amp;quot; etc...)&lt;br /&gt;
&lt;br /&gt;
4: All handles must have a capital for the first letter of the name (Ex: &amp;quot;john doe&amp;quot; is not legit, but &amp;quot;John doe&amp;quot; is)&lt;br /&gt;
&lt;br /&gt;
5: No special chars in it other then spaces, -, or ` (Ex: &amp;quot;John5 doe&amp;quot; would be illegal, but &amp;quot;John&#039;ell doe&amp;quot; would work)&lt;br /&gt;
&lt;br /&gt;
Each handle is unique; if it&#039;s too close to the name of another character it will be declined. (Ex: if you try to set your handle as &amp;quot;Jennifer Dreighton&amp;quot; it will automatically fail, since there already is a &amp;quot;Jennifer Dreighton&amp;quot;). You may have the same last name as another character, but you require their permission first. (Ex: There is a &amp;quot;Wilhelm von Ismay&amp;quot; and a &amp;quot;Victor von Ismay&amp;quot;, but Wilhelm got Victor&#039;s permission before setting his last name to that).&lt;br /&gt;
&lt;br /&gt;
====How do I log in? It keeps refreshing the page.==== &lt;br /&gt;
&lt;br /&gt;
First, use Lost Password to request a new password and log in with that. Be sure to paste or type it in exactly, as it is case sensitive.&lt;br /&gt;
&lt;br /&gt;
If that fails, check to ensure that you are using the up to date version of your web browser. Clear your cache and make sure cookies are enabled.&lt;br /&gt;
&lt;br /&gt;
If you are still having no luck, consider temporarily trying an alternate browser such as Opera (www.opera.com) or Mozilla (www.mozilla.org).&lt;br /&gt;
&lt;br /&gt;
====How can I earn credits?==== &lt;br /&gt;
&lt;br /&gt;
1. You can join a faction that pays its members a salary and/or bonuses.&lt;br /&gt;
&lt;br /&gt;
2. You can buy items and sell it for more.&lt;br /&gt;
&lt;br /&gt;
3. You can collect CPs and exchange them for entities that can be sold for credits.&lt;br /&gt;
&lt;br /&gt;
For more information, see the article on [[Credits]].&lt;br /&gt;
&lt;br /&gt;
====How can I get a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
In the beginning of your character&#039;s life, you will have the option of purchasing 3 ships for a very steep discount at the end of the tutorial, besides that, the easiest way of getting a ship or vehicle is by joining a faction and be assigned one. Later on when you have enough money you can buy another one for yourself. Another possibility is to exchange your CPs for some of the available ships and vehicles in the CP exchange.&lt;br /&gt;
&lt;br /&gt;
====Which faction should I join?==== &lt;br /&gt;
&lt;br /&gt;
That depends on who you want your character to be - a rebel or an empire supporter, a bounty hunter, a trader, a pirate, a researcher, etc. If you want to fly an X-Wing or a Mon Calamari cruiser, then you should join the Rebel Alliance or one of its allies. If you prefer the Tie Fighters and the Star Destroyers then you should definitely join the Galactic Empire. Of course you can join any other faction as well, depending on your interests. And who says you have to join any at all?&lt;br /&gt;
&lt;br /&gt;
====How do I get more Credits? ====&lt;br /&gt;
&lt;br /&gt;
The easiest way is to join a faction and receive a salary. You can also exchange CPs for entities that can be sold for credits. Alternately, you can start your own business like transporting ships and passengers for credits. Another possibility is to get a loan from a Bank faction or from another player, if you find somebody willing to loan you money.&lt;br /&gt;
&lt;br /&gt;
====How can I get off my starting planet?==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Make your way through the tutorial and purchase a ship.&lt;br /&gt;
&lt;br /&gt;
2. Join a faction, most offer transport to the planet you&#039;ll be working on, or supply a ship to fly around in.&lt;br /&gt;
&lt;br /&gt;
3. Buy a ride from another player or a transport faction, or rent a ship from another player/faction.&lt;br /&gt;
&lt;br /&gt;
4. Save up CPs and exchange them for a ship. &lt;br /&gt;
&lt;br /&gt;
5. Purchase a ship and have it moved to your location, to do this you&#039;ll need to earn some money first.&lt;br /&gt;
&lt;br /&gt;
====How to change my location (travel)? ====&lt;br /&gt;
&lt;br /&gt;
If you want to move from one position to another you have to go to position =&amp;gt; travel =&amp;gt; city =&amp;gt; you can enter some coordinates. If you give coordinates from (0,0) to (21,21) when you are on foot (walking), you will travel only inside the city. If you want to go to another city, first move to the edge of your current city in the direction you would like to go. Then go to position =&amp;gt; travel =&amp;gt; cross terrain =&amp;gt; then you can pick a position to where you want to go to.&lt;br /&gt;
&lt;br /&gt;
====I just created my character and assigned skill points. Where do I go and what do I do?==== &lt;br /&gt;
&lt;br /&gt;
It&#039;s up to you. You can work alone and be a freelancer or you can join a faction. While being an independent freelancer may sound fun, it doesn&#039;t provide the benefits a faction does such as paychecks every month, a neat duty like piloting a ship or vehicle, and a place to call home. Visit http://www.swcombine.com/community/factions.php for more details on the various factions. If you are interested in a faction, it would not be a bad idea to check out that faction’s website, as well as contacting a member from the faction&#039;s recruiting office to get more information on that faction’s services and benefits.&lt;br /&gt;
 &lt;br /&gt;
==How to Questions== &lt;br /&gt;
&lt;br /&gt;
====How can I gain CPs?==== &lt;br /&gt;
&lt;br /&gt;
The easiest way is to simply log in and play! You are awarded CPs every day that you log in. Suggesting planet descriptions, reporting bugs and typos, working on admin assignments or other ways of helping the development of the Combine can also be awarded.&lt;br /&gt;
&lt;br /&gt;
====How can I improve my skills? ====&lt;br /&gt;
&lt;br /&gt;
For every Experience Level you achieve, 1 skill point is added to your skill pool, which you can use to improve your skills, using the Character link on your right menu. However, skill increases cannot be undone, and it is possible that skill definitions for features not yet implemented may be changed in the future.&lt;br /&gt;
&lt;br /&gt;
====How can I get more experience? ====&lt;br /&gt;
&lt;br /&gt;
Experience points can be gained in many ways. Flying ships or piloting vehicles is a common method, it is also possible to gain them by mining or prospecting. Constructing buildings or stations gains an amount of experience. Small amounts are also awarded for certain achievements such as sending your first message or joining your first faction. Other ways may be added as the game develops.&lt;br /&gt;
&lt;br /&gt;
====How can I send a message to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the Send message link in your menu (it looks like an envelope) then Send Message. Enter the handle of the recipient and enter the message itself.&lt;br /&gt;
&lt;br /&gt;
====How can I send credits to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the display of your current credits total in the right hand menu. This should bring up the Transfer Credits screen. Enter the handle of the character or the name of the faction to receive the credits, then enter the amount and add a comment if you want. Finally click Transfer.&lt;br /&gt;
&lt;br /&gt;
====How do I join a faction? ====&lt;br /&gt;
&lt;br /&gt;
Click the Faction link on the right hand menu and then on Join Faction. Select the one you would want to join, add a message if you want, click submit and await further instructions. Generally allow up to 24-48 hours for a reply from the faction to see if you have been accepted or not.&lt;br /&gt;
&lt;br /&gt;
====How do I launch a missile, fire my blaster or beat up a Wookiee? ====&lt;br /&gt;
&lt;br /&gt;
Full-scale Player vs. Player (PvP) Combat is not yet implemented. It is possible to brawl with Brawler NPCs for experience points and factions have the ability to arrest and execute. Ground combat is currently in beta - there are a couple systems that allow PvP ground combat while Player vs. Environment (PvE) is implemented in every system - while space combat is in alpha - one may find space bandits hiding in asteroid fields in deep space.&lt;br /&gt;
&lt;br /&gt;
====How do I report a bug? ====&lt;br /&gt;
&lt;br /&gt;
If you encounter a bug, click on the &amp;quot;Report Bug&amp;quot; link at the bottom of the right side menu. Please browse though the list of bugs to make sure that the bug you are reporting is a new one. If you find that your bug is already listed, add a comment to it stating your problem as well.&lt;br /&gt;
&lt;br /&gt;
====How can I support the Combine?==== &lt;br /&gt;
&lt;br /&gt;
There are many ways to support the Combine. You can join one of the many volunteer teams (Art, Descriptions, Development, QA) to help improve the game. You can report bugs and typos.&lt;br /&gt;
&lt;br /&gt;
====How do I buy weapons/droids/items? ====&lt;br /&gt;
&lt;br /&gt;
A few minor items can already be bought in Shop and Commerce Centre facilities. Shops can be found in most starting cities and are NPC-owned, while Commerce Centres are faction/player owned.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the majority of weapons, droids, and items can be purchased from the faction that produces them, which is displayed on the rules page for the item in question, or from players who already own them.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s demonstrate a trade between two players. The person who buys the ship (Luke) has to contact the person who sells the ship (Han). Next, Luke has to pay for the ship by clicking on transaction sheet/credits transaction/transfer credits. Afterward, Luke must write the name of receiver, amount and communication and then choose the receiver type. When all this has been done, Luke solidifies the credit transfer by clicking on the &amp;quot;transfer&amp;quot; button. To give Luke his ship after receiving payment, Han has to click on &amp;quot;ships&amp;quot; in his personal inventory and choose who he wants to give the ship to (faction or person). Han must then select the ship Luke paid for and click on &amp;quot;Make Over.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Be warned that there are no guarantees for trading in the Combine and theft is an ever-present factor in the game.&lt;br /&gt;
&lt;br /&gt;
====How do I enter a ship or vehicle?==== &lt;br /&gt;
&lt;br /&gt;
First, you have to be assigned to the crewlist or set as owner/commander/pilot of the ship or vehicle to be able to board it. Once that is taken care of, click on &amp;quot;Position&amp;quot;, then &amp;quot;Enter&amp;quot;. If the above parameters are met, you should be able to see the ship. Click &amp;quot;Board&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====How do I pilot a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
After you have entered the ship or vehicle there will be a room map representing the layout of the entity in which you now reside. Find your way to the cockpit and a new button will appear on the side of the screen titled &amp;quot;Ship Controls&amp;quot; (or &amp;quot;Vehicle Controls&amp;quot;). Click that button and you will be taken to a new screen that will allow you to pilot your ship/vehicle.&lt;br /&gt;
&lt;br /&gt;
====How do I travel in a ship?==== &lt;br /&gt;
&lt;br /&gt;
To move around within a ship, your status in the Control panel must be set to Position (as opposed to Cockpit -- see below).&lt;br /&gt;
&lt;br /&gt;
To operate a ship, you first travel from the entrance room to the cockpit room. Once in the cockpit room, click &amp;quot;Ship Controls&amp;quot; (this option will only appear if you have been assigned as the pilot of the ship).&lt;br /&gt;
&lt;br /&gt;
To lift off, hit the Travel button then Ascend. It takes an hour to reach (upper) atmosphere.&lt;br /&gt;
&lt;br /&gt;
Once in the upper atmosphere, you need to reach orbit; this takes another hour. You do this from the Travel section by hitting Travel, then Orbit.&lt;br /&gt;
&lt;br /&gt;
Once in orbit, you have to escape the gravity well of the planet you&#039;re orbiting; this is the section shaded in red on the display under Travel. Hit the Sublight button and click on some square that is not in the red. This should take roughly half an hour of travel.&lt;br /&gt;
&lt;br /&gt;
Once out of the gravity well, you&#039;re free to go Hyper. Hit the Hyper button, then select from the menu of sectors (or choose a sector from the map of the galaxy), then select the desired system and Go.&lt;br /&gt;
&lt;br /&gt;
NOTE: Don&#039;t try to abort once in Hyper. You can lose the ship and be killed that way, should you come out near a celestial body.&lt;br /&gt;
&lt;br /&gt;
Upon entering a system, you&#039;ll be still a bit out from your destination planet; you&#039;ll have to hit Sublight and indicate which planet you want to go to.&lt;br /&gt;
&lt;br /&gt;
Upon arrival at the planet, you&#039;re in orbit. You can, at that point, change over to any other ship also in orbit for which you are listed as a Crewmember. To do this, Travel to that room in the ship which has the exit, hit Board, and select from among ships to which you have entree.&lt;br /&gt;
&lt;br /&gt;
To land a ship on the ground, you must reverse the lift-off procedure: First hit Travel, then Descend (and you can select your destination square on the planet); that takes an hour to put you in atmosphere. Once in atmosphere, you land by hitting Descend in the Travel section (and you can select your destination square in the city). Once landed, you can leave the ship by travelling to an exit room and hitting Board.&lt;br /&gt;
&lt;br /&gt;
NOTE: Some planets are protected by shields and will require access to descend to the ground.&lt;br /&gt;
&lt;br /&gt;
When you have been assigned as Pilot to a ship, you can then manage the crewlist. You do this with the Crewlist button on the bottom of the panel.&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
&lt;br /&gt;
Travel: Board&lt;br /&gt;
Control: Position: Travel to cockpit room&lt;br /&gt;
Control: Enter Cockpit&lt;br /&gt;
&lt;br /&gt;
Travel: Ascend to atmosphere&lt;br /&gt;
Travel: Ascend to orbit&lt;br /&gt;
Travel: Sublight out of gravity well&lt;br /&gt;
Travel: Hyper to new system&lt;br /&gt;
Travel: Sublight to planet&lt;br /&gt;
Travel: Descend to atmosphere&lt;br /&gt;
Travel: Descend to ground&lt;br /&gt;
&lt;br /&gt;
Control: Position: Travel to exit room&lt;br /&gt;
Travel: Board&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Fitouts&amp;diff=3918</id>
		<title>Fitouts</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Fitouts&amp;diff=3918"/>
		<updated>2025-10-31T15:00:58Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: adding manual equipment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Automatic NPC Equipment==&lt;br /&gt;
In order to equip many NPCs at a time, it is possible to use fitouts intead of equipping each NPC individually.&lt;br /&gt;
&lt;br /&gt;
# Go to your Personal Inventory menu on the right hand side under your avatar and click the NPCs link.&lt;br /&gt;
# On the top left area of the screen there are several buttons: Sort by, Filter by, Export, Manage Tags, and Manage Fitouts. Click on the &#039;Manage Fitouts&#039; button.&lt;br /&gt;
# The first time you will get the warning: &amp;quot;You have no NPC fitouts available. In order to create a fitout you must first create an NPC inventory tag.&amp;quot; Therefore, click on the link &amp;quot;create an NPC inventory tag&amp;quot;&lt;br /&gt;
# The Tag Overview page will open up. At the bottom of that page click &amp;quot;Create&amp;quot;&lt;br /&gt;
# Name your tag as the NPC who will use the tag, or give a meaningful name to be used with squads.&amp;lt;br /&amp;gt; Example: If your NPC is named Bob Hope, then name the tag &#039;Bob Hope Fitout&#039;. If you are equipping a Riflemen squad, then name the tag &#039;Riflemen Fitout&#039;.&lt;br /&gt;
# Now click &amp;quot;personal NPC fitouts&amp;quot; at the top of the page.&lt;br /&gt;
# It will take you to a page with a box on the left of an equipment layout. Click the title of the box.&lt;br /&gt;
# You will be at the page with your equipment box on the left and listings of items on the right. Click the items and drag and drop them onto the equipment box as you wish to equip your NPCs. By adding different items to the same slots you create an order of preference for your NPCs to pickup for that slot.&lt;br /&gt;
# Now click the &#039;NPCs&#039; link under your Personal Inventory again to be directed back to the NPC page. Click on the box for the NPC(s) you just made a tag for. A check should appear in the box. Scroll all the way down to the bottom of the page. Click &#039;Select Action&#039;. Choose &#039;Assign Tag&#039; from the drop-down menu. Copy/Paste the NPC&#039;s name in the box. Click &#039;Process&#039;.&lt;br /&gt;
# When complete, go to your &amp;quot;Party&amp;quot; page. Place a check in the box of your NPC(s) and under &#039;Actions&#039; scroll down to the desired action of your NPC(s) under one of the three fitout options: Drop All, Drop and Pickup, or Pickup Only. If the items you assigned to the NPC slots are in the same room of the NPCs, the NPCs will perform the desired action and equip themselves.&lt;br /&gt;
&lt;br /&gt;
==Manual NPC Equipment==&lt;br /&gt;
It is possible to override an automatic fitout and equip a NPC manually, without the need to use inventory tags nor to create a new fitout.&lt;br /&gt;
To do so, you must Party with the NPC of your choice and click on &amp;quot;NPC Control&amp;quot;. This option is listed in the menu &amp;quot;Control&amp;quot;, between &amp;quot;Room Travel&amp;quot; and &amp;quot;Equipment&amp;quot;. You can then equip the selected NPC as you do for yourself.&lt;br /&gt;
&lt;br /&gt;
==Removing an Item from a Fitout==&lt;br /&gt;
This can be done by clicking the name of the item in the list below the silhouette that tells you which items are equipped where. This takes a while for it to load and remove it.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
* Custom items cannot be equipped as fitouts.&lt;br /&gt;
* Every type of NPC can be equipped with fitouts, also the custom ones.&lt;br /&gt;
* If you cannot see the Manage Fitouts button then check your inventory view. The button is only visible in the Graphic Inventory view, not in the Tree view.&lt;br /&gt;
* click and drag --two times-- the icon for the item that you want to &#039;assign&#039; onto the large &#039;slot&#039; area&lt;br /&gt;
* there may be a delay of up to maybe 20 seconds or so for the &#039;system&#039; to recognize the new item assigned, and for it to display on the slot area&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3916</id>
		<title>Combine Points</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3916"/>
		<updated>2025-08-08T12:17:13Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Activity */  corrected values of CPs in day 1 and 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Combine Points (or CPs) are an OOC reward to players for helping the combine. There are a variety of ways of obtaining them, as well as uses for them. The number you currently have is shown on the sidebar, underneath your avatar and can be exchanged for a variety of [[ships]], [[vehicles]], [[droids]] and various other things.&lt;br /&gt;
&lt;br /&gt;
==Getting CPs==&lt;br /&gt;
CPs are obtained from supporting the Combine in some way. Most players will get them from being active, while others will get them for helping with art, or descriptions etc.&lt;br /&gt;
&lt;br /&gt;
===Activity===&lt;br /&gt;
This is the main method with which players will gain CPs, once per 24 hours, just for logging in/playing the game. The system currently works based on a window, where you must access the website between 24-48 hours after a reward to receive the next one, rather than using the calendar day to define the boundaries. The goal here is to help people who may only be able to play the game briefly on certain days, where that activity window may also overlap with the end of a calendar day according to the server, which could result in missed rewards. Continued activity over the course of multiple days will result in larger bonuses, capping at the maximum bonus on the 7th day without failure and every day after. &lt;br /&gt;
&lt;br /&gt;
You do not need to actually &amp;quot;log in&amp;quot; with your username+password; the normal activity checker for counting online players will trigger the check for you when you access the game in your browser.  &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Activity Streak&#039;&#039;&#039; || &#039;&#039;&#039;CPs&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|1 Day || 320&lt;br /&gt;
|-&lt;br /&gt;
|2 Days || 370&lt;br /&gt;
|-&lt;br /&gt;
|3 Days || 420&lt;br /&gt;
|-&lt;br /&gt;
|4 Days || 470&lt;br /&gt;
|-&lt;br /&gt;
|5 Days || 520&lt;br /&gt;
|-&lt;br /&gt;
|6 Days || 570&lt;br /&gt;
|-&lt;br /&gt;
|7+ Days || 620&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Helping===&lt;br /&gt;
You can get CPs for helping enhance the Combine in many different ways. Helping to update descriptions for entities, creating new art for SWC to use can all get you more CP&#039;s.&lt;br /&gt;
&lt;br /&gt;
==Rewards==&lt;br /&gt;
There are many things you can exchange CPs for including:&lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Ships CP Ships] - Ships with landing capacity must be spawned from inside a powered Starport or Landing Pad, whereas ships without landing capacity can only be purchased inside the following Space Stations: Trading I and Trading II, Shipyard I to IV, R&amp;amp;D I to IV. &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Vehicles CP Vehicles] - these must be spawned from inside a powered Garage, Hangar or Starport &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Droids CP Droids] - these must be spawned from inside a powered Tavern, Hangar, Shop, Commerce Center or Factory.&lt;br /&gt;
*Custom Items and [http://www.swcombine.com/rules/?NPCs#Custom_NPCs NPCs] (which exist solely for RP, and you can create your own [http://www.swcombine.com/rules/?Scripts script] for Custom NPCs)&lt;br /&gt;
*[[Custom_Images|Custom images]] for your entities, this is your chance to make your ship, speeder, item or anything else that you would like to look different to the norm, if you are no good at photoshopping there are multiple people in the game that you can hire for credits to create your customised paint job for you.&lt;br /&gt;
To exchange your points, find the [http://www.swcombine.com/members/cp/index.php?mode=exchange Exchange CPs] menu under the CP section on your sidebar in-game.&lt;br /&gt;
&lt;br /&gt;
[[Category:OOC]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3915</id>
		<title>Combine Points</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3915"/>
		<updated>2025-07-30T16:14:38Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Rewards */  added text in CP Ships paragraph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Combine Points (or CPs) are an OOC reward to players for helping the combine. There are a variety of ways of obtaining them, as well as uses for them. The number you currently have is shown on the sidebar, underneath your avatar and can be exchanged for a variety of [[ships]], [[vehicles]], [[droids]] and various other things.&lt;br /&gt;
&lt;br /&gt;
==Getting CPs==&lt;br /&gt;
CPs are obtained from supporting the Combine in some way. Most players will get them from being active, while others will get them for helping with art, or descriptions etc.&lt;br /&gt;
&lt;br /&gt;
===Activity===&lt;br /&gt;
This is the main method with which players will gain CPs, once per 24 hours, just for logging in/playing the game. The system currently works based on a window, where you must access the website between 24-48 hours after a reward to receive the next one, rather than using the calendar day to define the boundaries. The goal here is to help people who may only be able to play the game briefly on certain days, where that activity window may also overlap with the end of a calendar day according to the server, which could result in missed rewards. Continued activity over the course of multiple days will result in larger bonuses, capping at the maximum bonus on the 7th day without failure and every day after. &lt;br /&gt;
&lt;br /&gt;
You do not need to actually &amp;quot;log in&amp;quot; with your username+password; the normal activity checker for counting online players will trigger the check for you when you access the game in your browser.  &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Activity Streak&#039;&#039;&#039; || &#039;&#039;&#039;CPs&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|1 Day || 300&lt;br /&gt;
|-&lt;br /&gt;
|2 Days || 350&lt;br /&gt;
|-&lt;br /&gt;
|3 Days || 420&lt;br /&gt;
|-&lt;br /&gt;
|4 Days || 470&lt;br /&gt;
|-&lt;br /&gt;
|5 Days || 520&lt;br /&gt;
|-&lt;br /&gt;
|6 Days || 570&lt;br /&gt;
|-&lt;br /&gt;
|7+ Days || 620&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Helping===&lt;br /&gt;
You can get CPs for helping enhance the Combine in many different ways. Helping to update descriptions for entities, creating new art for SWC to use can all get you more CP&#039;s.&lt;br /&gt;
&lt;br /&gt;
==Rewards==&lt;br /&gt;
There are many things you can exchange CPs for including:&lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Ships CP Ships] - Ships with landing capacity must be spawned from inside a powered Starport or Landing Pad, whereas ships without landing capacity can only be purchased inside the following Space Stations: Trading I and Trading II, Shipyard I to IV, R&amp;amp;D I to IV. &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Vehicles CP Vehicles] - these must be spawned from inside a powered Garage, Hangar or Starport &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Droids CP Droids] - these must be spawned from inside a powered Tavern, Hangar, Shop, Commerce Center or Factory.&lt;br /&gt;
*Custom Items and [http://www.swcombine.com/rules/?NPCs#Custom_NPCs NPCs] (which exist solely for RP, and you can create your own [http://www.swcombine.com/rules/?Scripts script] for Custom NPCs)&lt;br /&gt;
*[[Custom_Images|Custom images]] for your entities, this is your chance to make your ship, speeder, item or anything else that you would like to look different to the norm, if you are no good at photoshopping there are multiple people in the game that you can hire for credits to create your customised paint job for you.&lt;br /&gt;
To exchange your points, find the [http://www.swcombine.com/members/cp/index.php?mode=exchange Exchange CPs] menu under the CP section on your sidebar in-game.&lt;br /&gt;
&lt;br /&gt;
[[Category:OOC]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3914</id>
		<title>Combine Points</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3914"/>
		<updated>2025-07-29T17:48:15Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Activity */  changed amount of CPs in streak&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Combine Points (or CPs) are an OOC reward to players for helping the combine. There are a variety of ways of obtaining them, as well as uses for them. The number you currently have is shown on the sidebar, underneath your avatar and can be exchanged for a variety of [[ships]], [[vehicles]], [[droids]] and various other things.&lt;br /&gt;
&lt;br /&gt;
==Getting CPs==&lt;br /&gt;
CPs are obtained from supporting the Combine in some way. Most players will get them from being active, while others will get them for helping with art, or descriptions etc.&lt;br /&gt;
&lt;br /&gt;
===Activity===&lt;br /&gt;
This is the main method with which players will gain CPs, once per 24 hours, just for logging in/playing the game. The system currently works based on a window, where you must access the website between 24-48 hours after a reward to receive the next one, rather than using the calendar day to define the boundaries. The goal here is to help people who may only be able to play the game briefly on certain days, where that activity window may also overlap with the end of a calendar day according to the server, which could result in missed rewards. Continued activity over the course of multiple days will result in larger bonuses, capping at the maximum bonus on the 7th day without failure and every day after. &lt;br /&gt;
&lt;br /&gt;
You do not need to actually &amp;quot;log in&amp;quot; with your username+password; the normal activity checker for counting online players will trigger the check for you when you access the game in your browser.  &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Activity Streak&#039;&#039;&#039; || &#039;&#039;&#039;CPs&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|1 Day || 300&lt;br /&gt;
|-&lt;br /&gt;
|2 Days || 350&lt;br /&gt;
|-&lt;br /&gt;
|3 Days || 420&lt;br /&gt;
|-&lt;br /&gt;
|4 Days || 470&lt;br /&gt;
|-&lt;br /&gt;
|5 Days || 520&lt;br /&gt;
|-&lt;br /&gt;
|6 Days || 570&lt;br /&gt;
|-&lt;br /&gt;
|7+ Days || 620&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Helping===&lt;br /&gt;
You can get CPs for helping enhance the Combine in many different ways. Helping to update descriptions for entities, creating new art for SWC to use can all get you more CP&#039;s.&lt;br /&gt;
&lt;br /&gt;
==Rewards==&lt;br /&gt;
There are many things you can exchange CPs for including:&lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Ships CP Ships] - these must be spawned from inside a powered Starport or Landing Pad. &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Vehicles CP Vehicles] - these must be spawned from inside a powered Garage, Hangar or Starport &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Droids CP Droids] - these must be spawned from inside a powered Tavern, Hangar, Shop, Commerce Center or Factory.&lt;br /&gt;
*Custom Items and [http://www.swcombine.com/rules/?NPCs#Custom_NPCs NPCs] (which exist solely for RP, and you can create your own [http://www.swcombine.com/rules/?Scripts script] for Custom NPCs)&lt;br /&gt;
*[[Custom_Images|Custom images]] for your entities, this is your chance to make your ship, speeder, item or anything else that you would like to look different to the norm, if you are no good at photoshopping there are multiple people in the game that you can hire for credits to create your customised paint job for you.&lt;br /&gt;
To exchange your points, find the [http://www.swcombine.com/members/cp/index.php?mode=exchange Exchange CPs] menu under the CP section on your sidebar in-game.&lt;br /&gt;
&lt;br /&gt;
[[Category:OOC]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3913</id>
		<title>Combine Points</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Combine_Points&amp;diff=3913"/>
		<updated>2025-07-29T10:16:13Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Rewards */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Combine Points (or CPs) are an OOC reward to players for helping the combine. There are a variety of ways of obtaining them, as well as uses for them. The number you currently have is shown on the sidebar, underneath your avatar and can be exchanged for a variety of [[ships]], [[vehicles]], [[droids]] and various other things.&lt;br /&gt;
&lt;br /&gt;
==Getting CPs==&lt;br /&gt;
CPs are obtained from supporting the Combine in some way. Most players will get them from being active, while others will get them for helping with art, or descriptions etc.&lt;br /&gt;
&lt;br /&gt;
===Activity===&lt;br /&gt;
This is the main method with which players will gain CPs, once per 24 hours, just for logging in/playing the game. The system currently works based on a window, where you must access the website between 24-48 hours after a reward to receive the next one, rather than using the calendar day to define the boundaries. The goal here is to help people who may only be able to play the game briefly on certain days, where that activity window may also overlap with the end of a calendar day according to the server, which could result in missed rewards. Continued activity over the course of multiple days will result in larger bonuses, capping at the maximum bonus on the 7th day without failure and every day after. &lt;br /&gt;
&lt;br /&gt;
You do not need to actually &amp;quot;log in&amp;quot; with your username+password; the normal activity checker for counting online players will trigger the check for you when you access the game in your browser.  &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Activity Streak&#039;&#039;&#039; || &#039;&#039;&#039;CPs&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|1 Day || 150&lt;br /&gt;
|-&lt;br /&gt;
|2 Days || 175&lt;br /&gt;
|-&lt;br /&gt;
|3 Days || 210&lt;br /&gt;
|-&lt;br /&gt;
|4 Days || 235&lt;br /&gt;
|-&lt;br /&gt;
|5 Days || 260&lt;br /&gt;
|-&lt;br /&gt;
|6 Days || 285&lt;br /&gt;
|-&lt;br /&gt;
|7+ Days || 310&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Helping===&lt;br /&gt;
You can get CPs for helping enhance the Combine in many different ways. Helping to update descriptions for entities, creating new art for SWC to use can all get you more CP&#039;s.&lt;br /&gt;
&lt;br /&gt;
==Rewards==&lt;br /&gt;
There are many things you can exchange CPs for including:&lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Ships CP Ships] - these must be spawned from inside a powered Starport or Landing Pad. &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Vehicles CP Vehicles] - these must be spawned from inside a powered Garage, Hangar or Starport &lt;br /&gt;
*[http://www.swcombine.com/rules/?CP_Bonus_Droids CP Droids] - these must be spawned from inside a powered Tavern, Hangar, Shop, Commerce Center or Factory.&lt;br /&gt;
*Custom Items and [http://www.swcombine.com/rules/?NPCs#Custom_NPCs NPCs] (which exist solely for RP, and you can create your own [http://www.swcombine.com/rules/?Scripts script] for Custom NPCs)&lt;br /&gt;
*[[Custom_Images|Custom images]] for your entities, this is your chance to make your ship, speeder, item or anything else that you would like to look different to the norm, if you are no good at photoshopping there are multiple people in the game that you can hire for credits to create your customised paint job for you.&lt;br /&gt;
To exchange your points, find the [http://www.swcombine.com/members/cp/index.php?mode=exchange Exchange CPs] menu under the CP section on your sidebar in-game.&lt;br /&gt;
&lt;br /&gt;
[[Category:OOC]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3912</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3912"/>
		<updated>2025-07-29T10:08:00Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* How can I support the Combine? */  removed accepting donations for running servers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General Questions==&lt;br /&gt;
&lt;br /&gt;
====What is the Star Wars Combine?==== &lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine is an interactive online Star Wars simulation. People play the sim from diverse nations around the globe. The Star Wars Combine is 100% free of charge, and is a non-profit game. &lt;br /&gt;
&lt;br /&gt;
In the Combine you will be allowed to create a character of your own with several different races to choose from. Upon character creation, you will have the option to join a group from a hefty list of candidates. Life in the Combine galaxy is just like stepping into George Lucas&#039;s epic Star Wars universe with the primary difference being that, in the Combine, there are none of the original Star Wars characters. No Luke Skywalker, no Leia Organa, no Mon Mothma, etc. However, the setting and general plot are the same, there is an ongoing war between the Galactic Empire and New Republic as well as plenty of other player-driven conflicts.&lt;br /&gt;
&lt;br /&gt;
====What time period is the game set in? ====&lt;br /&gt;
&lt;br /&gt;
Though it is difficult to assess the time in comparison to the movies (since events and people are different between the two), it has been generally agreed upon that this game is set within the area of Episode IV: A New Hope and Episode V: The Empire Strikes Back. However, with the new movies and new ideas, we will be incorporating ships and systems from them as well.&lt;br /&gt;
&lt;br /&gt;
====What would make me choose to play this game? ====&lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine provides a unique gaming experience compared to other games in this modern era. Being that it is primarily a role playing (RP) game, much of the in-game history is written and dictated by the actions of our players. With just a few thousand active players, our community is relatively small but it provides ample opportunities for interaction and fun among players.&lt;br /&gt;
&lt;br /&gt;
====What are CPs (Combine Points)? ====&lt;br /&gt;
&lt;br /&gt;
The Combine Points are given to you by the admins for out of character (OOC) efforts you do to support and help the Star Wars Combine. Additionally, CPs are awarded each day that you log into SWC. You can exchange them for ships, vehicles and other inventory items (as they come available), some of which are only available through the CP exchange system.&lt;br /&gt;
&lt;br /&gt;
====What does NPC mean?==== &lt;br /&gt;
&lt;br /&gt;
NPC = Non-Playing Characters. You can hire them to work for you, build ships, fight alongside you, etc.&lt;br /&gt;
&lt;br /&gt;
====Can I kill another character? ====&lt;br /&gt;
&lt;br /&gt;
Right now there are very few options to kill a character. A character can be executed, if they have had an arrest warrant issued on them and are currently under arrest. You can also kill yourself by flying into a sun, which also kills any other passengers located on that ship if the ship class is a Fighter, or Gunboat; For any other ship class, only the pilot is killed.&lt;br /&gt;
&lt;br /&gt;
====Why are the prices of the ships higher than those shown in the rules area? ====&lt;br /&gt;
&lt;br /&gt;
The prices shown in the rules area are the prices of production. The real prices depend on the traders and the in-game demand for ships.&lt;br /&gt;
&lt;br /&gt;
====Can I have more than one character? ====&lt;br /&gt;
&lt;br /&gt;
No, you are only allowed to have one character in the Combine. If your character dies you may create a new one after a period of time. Even if you leave your character for long periods of time, it is still best to try and log back in as that character or check with one of the administrators to see if your old character still exists before creating a new one. &lt;br /&gt;
&lt;br /&gt;
====Can more than one player use the same computer? ====&lt;br /&gt;
&lt;br /&gt;
Yes, but you must link the accounts via the Multi Self-Registration system. For more information check out https://www.swcombine.com/rules/?Character_Creation&lt;br /&gt;
&lt;br /&gt;
====How can I remake my character? ====&lt;br /&gt;
&lt;br /&gt;
Once a character is made in the Combine, it cannot be altered. The only ways a new character can be made is if your character dies or if you &amp;quot;drop&amp;quot; your character (you can find a link to &amp;quot;drop&amp;quot; your character by clicking the &amp;quot;Character&amp;quot; link on the side of the page). If stats are your concern, you are allowed a single re-roll prior to hitting level 3. Additionally, your skills may be upgraded as you progress in the game.&lt;br /&gt;
&lt;br /&gt;
====Why must I wait a period of time to create a new character?==== &lt;br /&gt;
&lt;br /&gt;
This delay was set in order to keep Combine players from creating, killing, and then recreating characters in hopes of getting a Force-sensitive one.&lt;br /&gt;
&lt;br /&gt;
====Who developed/is developing the Combine? ====&lt;br /&gt;
&lt;br /&gt;
The current and former staff of Combine can be found on the Contacts page under the link &amp;quot;The SWC Team&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Is the Combine affiliated with LucasArts/Disney?==== &lt;br /&gt;
&lt;br /&gt;
The Combine is an independent game created by a group of people that love Star Wars. They are not part of LucasArts/Disney.&lt;br /&gt;
&lt;br /&gt;
====What are White Scenarios? ====&lt;br /&gt;
&lt;br /&gt;
White scenarios are in-character (IC) role-playing scenarios that have members of the combine performing actions through the forums. GM&#039;s monitor the scenarios and perform actions with NPC&#039;s. In White Scenarios there are no repercussions for being involved. If you die in one, you will still be alive in the Combine. Depending on how well you role-play in the scenarios you will be given experience points (XPs). You can find scenarios through the community links RPG Centre under Portals. &lt;br /&gt;
&lt;br /&gt;
====What Messaging System do most members use? ====&lt;br /&gt;
&lt;br /&gt;
Most members use either the Combine messaging system (often referred to as &amp;quot;Darkness Message&amp;quot;), Discord, or SWC&#039;s IRC server. Currently, a directory of active Discord channels is maintained in the &amp;quot;General Talk&amp;quot; forum.&lt;br /&gt;
&lt;br /&gt;
====What is IRC? ====&lt;br /&gt;
&lt;br /&gt;
IRC is a instant messaging server. Some combine players use IRC as a primary form of communication to their factions.&lt;br /&gt;
&lt;br /&gt;
====How do I register on IRC and what does it do? ====&lt;br /&gt;
&lt;br /&gt;
Registering on IRC secures your user name to help make sure no one else can use it. To register you will need to type /msg NickServ REGISTER password e-mail (change e-mail and password to what you would like for them both [example /msg NickServ REGISTER 123456 example@hotmail.com) After this you’ll receive a conformation e-mail and every time you log in you will need to type in /msg NickServ IDENTIFY password&lt;br /&gt;
&lt;br /&gt;
====What server do I go to on IRC? ====&lt;br /&gt;
&lt;br /&gt;
irc.swc-irc.com&lt;br /&gt;
&lt;br /&gt;
====How can I be in more than one IRC channel at once? ====&lt;br /&gt;
&lt;br /&gt;
You will need to download an IRC chat client (e.g., mIRC from http://www.mirc.com ). Download and install this and you can be in as many channels as you want! It also has other handy features to make chatting easier.&lt;br /&gt;
&lt;br /&gt;
====Can I also create a city?==== &lt;br /&gt;
&lt;br /&gt;
Anyone can create a city, yes. However, there are some requirements to construct a city. The terrain square you selected must be non-volcanic. Also, either you or your faction must posses the required amount of credits to build a city. It costs a minimum of 1,500,000 credits to build a city.&lt;br /&gt;
&lt;br /&gt;
====I must travel to a system but I don&#039;t know where it is. ====&lt;br /&gt;
&lt;br /&gt;
If you want to find out where a system, sector, planet or city you have to travel to is then you can look at the galaxy map. It is easy to navigate and can be found here: http://www.swcombine.com/rules/?Galaxy_Map&lt;br /&gt;
&lt;br /&gt;
====How do I increase my skill points? ====&lt;br /&gt;
&lt;br /&gt;
Every time you level, you receive a new skill point to use. These skill points can be allocated to your skills via the Character link on your right menu. However, such increases cannot be undone, and the definitions for skills which are not yet implemented may change in the future.&lt;br /&gt;
&lt;br /&gt;
====How long does my character stay in combine if I am not active anymore? ====&lt;br /&gt;
&lt;br /&gt;
Characters with XP Level 1 are wiped after 9 months of inactivity, all characters above Level 1 are retrievable at any time. Dead characters, however, can never be retrieved.&lt;br /&gt;
&lt;br /&gt;
====This stat doesn&#039;t seem to do anything yet, why is it there? ====&lt;br /&gt;
&lt;br /&gt;
Not all of the stats in the game have a use yet, but when the game is fully operational they will all have a use. You can view what your stats will be used for by reading through the various rules in the technical section.&lt;br /&gt;
&lt;br /&gt;
====How much experience do I need to raise up my Experience Level?==== &lt;br /&gt;
&lt;br /&gt;
The needed experience is not the same for every level. To achieve level 2 you need 1000 experience, for level 3 - 3000. For level n you will need 1000 x (n-1) x n / 2. You can find a table with the experience points needed up to level 9 in the rules section.&lt;br /&gt;
&lt;br /&gt;
====Can I create a new faction?==== &lt;br /&gt;
&lt;br /&gt;
Yes you can. To do so you will need to satisfy the conditions found on the Faction Creation rules.&lt;br /&gt;
&lt;br /&gt;
==Technical Questions== &lt;br /&gt;
&lt;br /&gt;
====What do I need to play the Combine in the terms of hardware, software, etc?==== &lt;br /&gt;
&lt;br /&gt;
A computer or smartphone capable of connecting to the Internet and a web browser.&lt;br /&gt;
&lt;br /&gt;
====Do I have to download any software to play?==== &lt;br /&gt;
&lt;br /&gt;
No, all that you need is a browser.&lt;br /&gt;
 &lt;br /&gt;
==Rules Questions==&lt;br /&gt;
&lt;br /&gt;
====Where can I find SWC&#039;s rules?==== &lt;br /&gt;
&lt;br /&gt;
You can find them and other information about the SWC at: https://www.swcombine.com/rules/&lt;br /&gt;
&lt;br /&gt;
====What happens if I die?==== &lt;br /&gt;
&lt;br /&gt;
You lose all of your characters experience points, inventory and money. You will keep only your Combine Points and in three weeks you will be able to create a new character.&lt;br /&gt;
&lt;br /&gt;
====Is theft allowed in the Combine? ====&lt;br /&gt;
&lt;br /&gt;
Theft occurs in the Combine. How your character reacts or performs it is up to you.&lt;br /&gt;
&lt;br /&gt;
====Why can I not change the details (like ownership) of a ship owned by a faction?==== &lt;br /&gt;
&lt;br /&gt;
You can only change a ship&#039;s information if you own it. Ships given by a faction for your use are a privilege, and being such are not owned by you. This action was implemented in order to prevent theft of a faction&#039;s property&lt;br /&gt;
&lt;br /&gt;
====Is the Combine played in real time? ====&lt;br /&gt;
&lt;br /&gt;
The Combine is played in delayed real time. For more information read https://www.swcombine.com/rules/?Timeframe&lt;br /&gt;
&lt;br /&gt;
====What is spying and is it allowed?==== &lt;br /&gt;
&lt;br /&gt;
Spying is when you infiltrate a faction in order to gain information for another faction or person. Currently it is permitted under the rules. Full details on what you may and may not do in regards to spying can be found at http://www.swcombine.com/rules/?Spying .&lt;br /&gt;
&lt;br /&gt;
====What are raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials are the materials required to produce a certain piece of technology (ship, vehicle, weapon, etc.).&lt;br /&gt;
&lt;br /&gt;
====How can I die?==== &lt;br /&gt;
&lt;br /&gt;
Currently, there are only a few ways to die: running a ship into a sun or black hole, aborting hyper travel and crashing into a celestial body, or getting your faction, or someone else, to execute you. Players may also &amp;quot;drop&amp;quot; their character to start a new one (the three week respawn timer still applies).&lt;br /&gt;
&lt;br /&gt;
====How do I get raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials can be mined or recovered via recycling. For mining, prospecting vehicles must be used to scan planets for deposits, and then a mining faction must construct a mine at the deposit location in order to mine the deposit for materials. For recycling, specific recycling entities must be used to break apart entities or wrecks into their basic materials.&lt;br /&gt;
 &lt;br /&gt;
==Getting Started Questions== &lt;br /&gt;
&lt;br /&gt;
====Can I be a jedi?==== &lt;br /&gt;
&lt;br /&gt;
Every race has its own force probability, giving you a chance to be born force sensitive. But if you are not, then you can still become one later by gaining experience and levels.&lt;br /&gt;
&lt;br /&gt;
====Why is the handle I selected declined?==== &lt;br /&gt;
&lt;br /&gt;
1: It has to sound like a word (Ex: &amp;quot;bgfive&amp;quot; or &amp;quot;imlame&amp;quot; would not be accepted, while &amp;quot;John doe&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
2: It can not be the name of an star wars character, although using the first or last names is allowed (Ex: &amp;quot;Luke skywalker is not a legal handle, but &amp;quot;Luke deacon&amp;quot; or &amp;quot;Mike skywalker&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
3: No titles in your handle are allowed (Ex: no &amp;quot;Sir&amp;quot; &amp;quot;Darth&amp;quot; &amp;quot;Princess&amp;quot; &amp;quot;Dr.&amp;quot; etc...)&lt;br /&gt;
&lt;br /&gt;
4: All handles must have a capital for the first letter of the name (Ex: &amp;quot;john doe&amp;quot; is not legit, but &amp;quot;John doe&amp;quot; is)&lt;br /&gt;
&lt;br /&gt;
5: No special chars in it other then spaces, -, or ` (Ex: &amp;quot;John5 doe&amp;quot; would be illegal, but &amp;quot;John&#039;ell doe&amp;quot; would work)&lt;br /&gt;
&lt;br /&gt;
Each handle is unique; if it&#039;s too close to the name of another character it will be declined. (Ex: if you try to set your handle as &amp;quot;Jennifer Dreighton&amp;quot; it will automatically fail, since there already is a &amp;quot;Jennifer Dreighton&amp;quot;). You may have the same last name as another character, but you require their permission first. (Ex: There is a &amp;quot;Wilhelm von Ismay&amp;quot; and a &amp;quot;Victor von Ismay&amp;quot;, but Wilhelm got Victor&#039;s permission before setting his last name to that).&lt;br /&gt;
&lt;br /&gt;
====How do I log in? It keeps refreshing the page.==== &lt;br /&gt;
&lt;br /&gt;
First, use Lost Password to request a new password and log in with that. Be sure to paste or type it in exactly, as it is case sensitive.&lt;br /&gt;
&lt;br /&gt;
If that fails, check to ensure that you are using the up to date version of your web browser. Clear your cache and make sure cookies are enabled.&lt;br /&gt;
&lt;br /&gt;
If you are still having no luck, consider temporarily trying an alternate browser such as Opera (www.opera.com) or Mozilla (www.mozilla.org).&lt;br /&gt;
&lt;br /&gt;
====How can I earn credits?==== &lt;br /&gt;
&lt;br /&gt;
1. You can join a faction that pays its members a salary and/or bonuses.&lt;br /&gt;
&lt;br /&gt;
2. You can buy items and sell it for more.&lt;br /&gt;
&lt;br /&gt;
3. You can collect CPs and exchange them for entities that can be sold for credits.&lt;br /&gt;
&lt;br /&gt;
For more information, see the article on [[Credits]].&lt;br /&gt;
&lt;br /&gt;
====How can I get a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
In the beginning of your character&#039;s life, you will have the option of purchasing 3 ships for a very steep discount at the end of the tutorial, besides that, the easiest way of getting a ship or vehicle is by joining a faction and be assigned one. Later on when you have enough money you can buy another one for yourself. Another possibility is to exchange your CPs for some of the available ships and vehicles in the CP exchange.&lt;br /&gt;
&lt;br /&gt;
====Which faction should I join?==== &lt;br /&gt;
&lt;br /&gt;
That depends on who you want your character to be - a rebel or an empire supporter, a bounty hunter, a trader, a pirate, a researcher, etc. If you want to fly an X-Wing or a Mon Calamari cruiser, then you should join the Rebel Alliance or one of its allies. If you prefer the Tie Fighters and the Star Destroyers then you should definitely join the Galactic Empire. Of course you can join any other faction as well, depending on your interests. And who says you have to join any at all?&lt;br /&gt;
&lt;br /&gt;
====How do I get more Credits? ====&lt;br /&gt;
&lt;br /&gt;
The easiest way is to join a faction and receive a salary. You can also exchange CPs for entities that can be sold for credits. Alternately, you can start your own business like transporting ships and passengers for credits. Another possibility is to get a loan from a Bank faction or from another player, if you find somebody willing to loan you money.&lt;br /&gt;
&lt;br /&gt;
====How can I get off my starting planet?==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Make your way through the tutorial and purchase a ship.&lt;br /&gt;
&lt;br /&gt;
2. Join a faction, most offer transport to the planet you&#039;ll be working on, or supply a ship to fly around in.&lt;br /&gt;
&lt;br /&gt;
3. Buy a ride from another player or a transport faction, or rent a ship from another player/faction.&lt;br /&gt;
&lt;br /&gt;
4. Save up CPs and exchange them for a ship. &lt;br /&gt;
&lt;br /&gt;
5. Purchase a ship and have it moved to your location, to do this you&#039;ll need to earn some money first.&lt;br /&gt;
&lt;br /&gt;
====How to change my location (travel)? ====&lt;br /&gt;
&lt;br /&gt;
If you want to move from one position to another you have to go to position =&amp;gt; travel =&amp;gt; city =&amp;gt; you can enter some coordinates. If you give coordinates from (0,0) to (21,21) when you are on foot (walking), you will travel only inside the city. If you want to go to another city, first move to the edge of your current city in the direction you would like to go. Then go to position =&amp;gt; travel =&amp;gt; cross terrain =&amp;gt; then you can pick a position to where you want to go to.&lt;br /&gt;
&lt;br /&gt;
====I just created my character and assigned skill points. Where do I go and what do I do?==== &lt;br /&gt;
&lt;br /&gt;
It&#039;s up to you. You can work alone and be a freelancer or you can join a faction. While being an independent freelancer may sound fun, it doesn&#039;t provide the benefits a faction does such as paychecks every month, a neat duty like piloting a ship or vehicle, and a place to call home. Visit http://www.swcombine.com/community/factions.php for more details on the various factions. If you are interested in a faction, it would not be a bad idea to check out that faction’s website, as well as contacting a member from the faction&#039;s recruiting office to get more information on that faction’s services and benefits.&lt;br /&gt;
 &lt;br /&gt;
==How to Questions== &lt;br /&gt;
&lt;br /&gt;
====How can I gain CPs?==== &lt;br /&gt;
&lt;br /&gt;
The easiest way is to simply log in and play! You are awarded CPs every day that you log in. Suggesting planet descriptions, reporting bugs and typos, working on admin assignments or other ways of helping the development of the Combine can also be awarded.&lt;br /&gt;
&lt;br /&gt;
====How can I improve my skills? ====&lt;br /&gt;
&lt;br /&gt;
For every Experience Level you achieve, 1 skill point is added to your skill pool, which you can use to improve your skills, using the Character link on your right menu. However, skill increases cannot be undone, and it is possible that skill definitions for features not yet implemented may be changed in the future.&lt;br /&gt;
&lt;br /&gt;
====How can I get more experience? ====&lt;br /&gt;
&lt;br /&gt;
Experience points can be gained in many ways. Flying ships or piloting vehicles is a common method, it is also possible to gain them by mining or prospecting. Constructing buildings or stations gains an amount of experience. Small amounts are also awarded for certain achievements such as sending your first message or joining your first faction. Other ways may be added as the game develops.&lt;br /&gt;
&lt;br /&gt;
====How can I send a message to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the Send message link in your menu (it looks like an envelope) then Send Message. Enter the handle of the recipient and enter the message itself.&lt;br /&gt;
&lt;br /&gt;
====How can I send credits to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the display of your current credits total in the right hand menu. This should bring up the Transfer Credits screen. Enter the handle of the character or the name of the faction to receive the credits, then enter the amount and add a comment if you want. Finally click Transfer.&lt;br /&gt;
&lt;br /&gt;
====How do I join a faction? ====&lt;br /&gt;
&lt;br /&gt;
Click the Faction link on the right hand menu and then on Join Faction. Select the one you would want to join, add a message if you want, click submit and await further instructions. Generally allow up to 24-48 hours for a reply from the faction to see if you have been accepted or not.&lt;br /&gt;
&lt;br /&gt;
====How do I launch a missile, fire my blaster or beat up a Wookiee? ====&lt;br /&gt;
&lt;br /&gt;
Full-scale Player vs. Player (PvP) Combat is not yet implemented. It is possible to brawl with Brawler NPCs for experience points and factions have the ability to arrest and execute. Ground combat is currently in beta - there are a couple systems that allow PvP ground combat while Player vs. Environment (PvE) is implemented in every system - while space combat is in alpha - one may find space bandits hiding in asteroid fields in deep space.&lt;br /&gt;
&lt;br /&gt;
====How do I report a bug? ====&lt;br /&gt;
&lt;br /&gt;
If you encounter a bug, click on the &amp;quot;Report Bug&amp;quot; link at the bottom of the right side menu. Please browse though the list of bugs to make sure that the bug you are reporting is a new one. If you find that your bug is already listed, add a comment to it stating your problem as well.&lt;br /&gt;
&lt;br /&gt;
====How can I support the Combine?==== &lt;br /&gt;
&lt;br /&gt;
There are many ways to support the Combine. You can join one of the many volunteer teams (Art, Descriptions, Development, QA) to help improve the game. You can report bugs and typos.&lt;br /&gt;
&lt;br /&gt;
====How do I buy weapons/droids/items? ====&lt;br /&gt;
&lt;br /&gt;
A few minor items can already be bought in Shop and Commerce Centre facilities. Shops can be found in most starting cities and are NPC-owned, while Commerce Centres are faction/player owned.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the majority of weapons, droids, and items can be purchased from the faction that produces them, which is displayed on the rules page for the item in question, or from players who already own them.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s demonstrate a trade between two players. The person who buys the ship (Luke) has to contact the person who sells the ship (Han). Next, Luke has to pay for the ship by clicking on transaction sheet/credits transaction/transfer credits. Afterward, Luke must write the name of receiver, amount and communication and then choose the receiver type. When all this has been done, Luke solidifies the credit transfer by clicking on the &amp;quot;transfer&amp;quot; button. To give Luke his ship after receiving payment, Han has to click on &amp;quot;ships&amp;quot; in his personal inventory and choose who he wants to give the ship to (faction or person). Han must then select the ship Luke paid for and click on &amp;quot;Make Over.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Be warned that there are no guarantees for trading in the Combine and theft is an ever-present factor in the game.&lt;br /&gt;
&lt;br /&gt;
====How do I enter a ship or vehicle?==== &lt;br /&gt;
&lt;br /&gt;
First, you have to be assigned to the crewlist or set as owner/commander/pilot of the ship or vehicle to be able to board it. Once that is taken care of, click on &amp;quot;Position&amp;quot;, then &amp;quot;Enter&amp;quot;. If the above parameters are met, you should be able to see the ship. Click &amp;quot;Board&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====How do I pilot a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
After you have entered the ship or vehicle there will be a room map representing the layout of the entity in which you now reside. Find your way to the cockpit and a new button will appear on the side of the screen titled &amp;quot;Ship Controls&amp;quot; (or &amp;quot;Vehicle Controls&amp;quot;). Click that button and you will be taken to a new screen that will allow you to pilot your ship/vehicle.&lt;br /&gt;
&lt;br /&gt;
====How do I travel in a ship?==== &lt;br /&gt;
&lt;br /&gt;
To move around within a ship, your status in the Control panel must be set to Position (as opposed to Cockpit -- see below).&lt;br /&gt;
&lt;br /&gt;
To operate a ship, you first travel from the entrance room to the cockpit room. Once in the cockpit room, click &amp;quot;Ship Controls&amp;quot; (this option will only appear if you have been assigned as the pilot of the ship).&lt;br /&gt;
&lt;br /&gt;
To lift off, hit the Travel button then Ascend. It takes an hour to reach (upper) atmosphere.&lt;br /&gt;
&lt;br /&gt;
Once in the upper atmosphere, you need to reach orbit; this takes another hour. You do this from the Travel section by hitting Travel, then Orbit.&lt;br /&gt;
&lt;br /&gt;
Once in orbit, you have to escape the gravity well of the planet you&#039;re orbiting; this is the section shaded in red on the display under Travel. Hit the Sublight button and click on some square that is not in the red. This should take roughly half an hour of travel.&lt;br /&gt;
&lt;br /&gt;
Once out of the gravity well, you&#039;re free to go Hyper. Hit the Hyper button, then select from the menu of sectors (or choose a sector from the map of the galaxy), then select the desired system and Go.&lt;br /&gt;
&lt;br /&gt;
NOTE: Don&#039;t try to abort once in Hyper. You can lose the ship and be killed that way, should you come out near a celestial body.&lt;br /&gt;
&lt;br /&gt;
Upon entering a system, you&#039;ll be still a bit out from your destination planet; you&#039;ll have to hit Sublight and indicate which planet you want to go to.&lt;br /&gt;
&lt;br /&gt;
Upon arrival at the planet, you&#039;re in orbit. You can, at that point, change over to any other ship also in orbit for which you are listed as a Crewmember. To do this, Travel to that room in the ship which has the exit, hit Board, and select from among ships to which you have entree.&lt;br /&gt;
&lt;br /&gt;
To land a ship on the ground, you must reverse the lift-off procedure: First hit Travel, then Descend (and you can select your destination square on the planet); that takes an hour to put you in atmosphere. Once in atmosphere, you land by hitting Descend in the Travel section (and you can select your destination square in the city). Once landed, you can leave the ship by travelling to an exit room and hitting Board.&lt;br /&gt;
&lt;br /&gt;
NOTE: Some planets are protected by shields and will require access to descend to the ground.&lt;br /&gt;
&lt;br /&gt;
When you have been assigned as Pilot to a ship, you can then manage the crewlist. You do this with the Crewlist button on the bottom of the panel.&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
&lt;br /&gt;
Travel: Board&lt;br /&gt;
Control: Position: Travel to cockpit room&lt;br /&gt;
Control: Enter Cockpit&lt;br /&gt;
&lt;br /&gt;
Travel: Ascend to atmosphere&lt;br /&gt;
Travel: Ascend to orbit&lt;br /&gt;
Travel: Sublight out of gravity well&lt;br /&gt;
Travel: Hyper to new system&lt;br /&gt;
Travel: Sublight to planet&lt;br /&gt;
Travel: Descend to atmosphere&lt;br /&gt;
Travel: Descend to ground&lt;br /&gt;
&lt;br /&gt;
Control: Position: Travel to exit room&lt;br /&gt;
Travel: Board&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3911</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=FAQ&amp;diff=3911"/>
		<updated>2025-07-29T10:07:03Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* How can I gain CPs? */  removed donating money for CPs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General Questions==&lt;br /&gt;
&lt;br /&gt;
====What is the Star Wars Combine?==== &lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine is an interactive online Star Wars simulation. People play the sim from diverse nations around the globe. The Star Wars Combine is 100% free of charge, and is a non-profit game. &lt;br /&gt;
&lt;br /&gt;
In the Combine you will be allowed to create a character of your own with several different races to choose from. Upon character creation, you will have the option to join a group from a hefty list of candidates. Life in the Combine galaxy is just like stepping into George Lucas&#039;s epic Star Wars universe with the primary difference being that, in the Combine, there are none of the original Star Wars characters. No Luke Skywalker, no Leia Organa, no Mon Mothma, etc. However, the setting and general plot are the same, there is an ongoing war between the Galactic Empire and New Republic as well as plenty of other player-driven conflicts.&lt;br /&gt;
&lt;br /&gt;
====What time period is the game set in? ====&lt;br /&gt;
&lt;br /&gt;
Though it is difficult to assess the time in comparison to the movies (since events and people are different between the two), it has been generally agreed upon that this game is set within the area of Episode IV: A New Hope and Episode V: The Empire Strikes Back. However, with the new movies and new ideas, we will be incorporating ships and systems from them as well.&lt;br /&gt;
&lt;br /&gt;
====What would make me choose to play this game? ====&lt;br /&gt;
&lt;br /&gt;
The Star Wars Combine provides a unique gaming experience compared to other games in this modern era. Being that it is primarily a role playing (RP) game, much of the in-game history is written and dictated by the actions of our players. With just a few thousand active players, our community is relatively small but it provides ample opportunities for interaction and fun among players.&lt;br /&gt;
&lt;br /&gt;
====What are CPs (Combine Points)? ====&lt;br /&gt;
&lt;br /&gt;
The Combine Points are given to you by the admins for out of character (OOC) efforts you do to support and help the Star Wars Combine. Additionally, CPs are awarded each day that you log into SWC. You can exchange them for ships, vehicles and other inventory items (as they come available), some of which are only available through the CP exchange system.&lt;br /&gt;
&lt;br /&gt;
====What does NPC mean?==== &lt;br /&gt;
&lt;br /&gt;
NPC = Non-Playing Characters. You can hire them to work for you, build ships, fight alongside you, etc.&lt;br /&gt;
&lt;br /&gt;
====Can I kill another character? ====&lt;br /&gt;
&lt;br /&gt;
Right now there are very few options to kill a character. A character can be executed, if they have had an arrest warrant issued on them and are currently under arrest. You can also kill yourself by flying into a sun, which also kills any other passengers located on that ship if the ship class is a Fighter, or Gunboat; For any other ship class, only the pilot is killed.&lt;br /&gt;
&lt;br /&gt;
====Why are the prices of the ships higher than those shown in the rules area? ====&lt;br /&gt;
&lt;br /&gt;
The prices shown in the rules area are the prices of production. The real prices depend on the traders and the in-game demand for ships.&lt;br /&gt;
&lt;br /&gt;
====Can I have more than one character? ====&lt;br /&gt;
&lt;br /&gt;
No, you are only allowed to have one character in the Combine. If your character dies you may create a new one after a period of time. Even if you leave your character for long periods of time, it is still best to try and log back in as that character or check with one of the administrators to see if your old character still exists before creating a new one. &lt;br /&gt;
&lt;br /&gt;
====Can more than one player use the same computer? ====&lt;br /&gt;
&lt;br /&gt;
Yes, but you must link the accounts via the Multi Self-Registration system. For more information check out https://www.swcombine.com/rules/?Character_Creation&lt;br /&gt;
&lt;br /&gt;
====How can I remake my character? ====&lt;br /&gt;
&lt;br /&gt;
Once a character is made in the Combine, it cannot be altered. The only ways a new character can be made is if your character dies or if you &amp;quot;drop&amp;quot; your character (you can find a link to &amp;quot;drop&amp;quot; your character by clicking the &amp;quot;Character&amp;quot; link on the side of the page). If stats are your concern, you are allowed a single re-roll prior to hitting level 3. Additionally, your skills may be upgraded as you progress in the game.&lt;br /&gt;
&lt;br /&gt;
====Why must I wait a period of time to create a new character?==== &lt;br /&gt;
&lt;br /&gt;
This delay was set in order to keep Combine players from creating, killing, and then recreating characters in hopes of getting a Force-sensitive one.&lt;br /&gt;
&lt;br /&gt;
====Who developed/is developing the Combine? ====&lt;br /&gt;
&lt;br /&gt;
The current and former staff of Combine can be found on the Contacts page under the link &amp;quot;The SWC Team&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Is the Combine affiliated with LucasArts/Disney?==== &lt;br /&gt;
&lt;br /&gt;
The Combine is an independent game created by a group of people that love Star Wars. They are not part of LucasArts/Disney.&lt;br /&gt;
&lt;br /&gt;
====What are White Scenarios? ====&lt;br /&gt;
&lt;br /&gt;
White scenarios are in-character (IC) role-playing scenarios that have members of the combine performing actions through the forums. GM&#039;s monitor the scenarios and perform actions with NPC&#039;s. In White Scenarios there are no repercussions for being involved. If you die in one, you will still be alive in the Combine. Depending on how well you role-play in the scenarios you will be given experience points (XPs). You can find scenarios through the community links RPG Centre under Portals. &lt;br /&gt;
&lt;br /&gt;
====What Messaging System do most members use? ====&lt;br /&gt;
&lt;br /&gt;
Most members use either the Combine messaging system (often referred to as &amp;quot;Darkness Message&amp;quot;), Discord, or SWC&#039;s IRC server. Currently, a directory of active Discord channels is maintained in the &amp;quot;General Talk&amp;quot; forum.&lt;br /&gt;
&lt;br /&gt;
====What is IRC? ====&lt;br /&gt;
&lt;br /&gt;
IRC is a instant messaging server. Some combine players use IRC as a primary form of communication to their factions.&lt;br /&gt;
&lt;br /&gt;
====How do I register on IRC and what does it do? ====&lt;br /&gt;
&lt;br /&gt;
Registering on IRC secures your user name to help make sure no one else can use it. To register you will need to type /msg NickServ REGISTER password e-mail (change e-mail and password to what you would like for them both [example /msg NickServ REGISTER 123456 example@hotmail.com) After this you’ll receive a conformation e-mail and every time you log in you will need to type in /msg NickServ IDENTIFY password&lt;br /&gt;
&lt;br /&gt;
====What server do I go to on IRC? ====&lt;br /&gt;
&lt;br /&gt;
irc.swc-irc.com&lt;br /&gt;
&lt;br /&gt;
====How can I be in more than one IRC channel at once? ====&lt;br /&gt;
&lt;br /&gt;
You will need to download an IRC chat client (e.g., mIRC from http://www.mirc.com ). Download and install this and you can be in as many channels as you want! It also has other handy features to make chatting easier.&lt;br /&gt;
&lt;br /&gt;
====Can I also create a city?==== &lt;br /&gt;
&lt;br /&gt;
Anyone can create a city, yes. However, there are some requirements to construct a city. The terrain square you selected must be non-volcanic. Also, either you or your faction must posses the required amount of credits to build a city. It costs a minimum of 1,500,000 credits to build a city.&lt;br /&gt;
&lt;br /&gt;
====I must travel to a system but I don&#039;t know where it is. ====&lt;br /&gt;
&lt;br /&gt;
If you want to find out where a system, sector, planet or city you have to travel to is then you can look at the galaxy map. It is easy to navigate and can be found here: http://www.swcombine.com/rules/?Galaxy_Map&lt;br /&gt;
&lt;br /&gt;
====How do I increase my skill points? ====&lt;br /&gt;
&lt;br /&gt;
Every time you level, you receive a new skill point to use. These skill points can be allocated to your skills via the Character link on your right menu. However, such increases cannot be undone, and the definitions for skills which are not yet implemented may change in the future.&lt;br /&gt;
&lt;br /&gt;
====How long does my character stay in combine if I am not active anymore? ====&lt;br /&gt;
&lt;br /&gt;
Characters with XP Level 1 are wiped after 9 months of inactivity, all characters above Level 1 are retrievable at any time. Dead characters, however, can never be retrieved.&lt;br /&gt;
&lt;br /&gt;
====This stat doesn&#039;t seem to do anything yet, why is it there? ====&lt;br /&gt;
&lt;br /&gt;
Not all of the stats in the game have a use yet, but when the game is fully operational they will all have a use. You can view what your stats will be used for by reading through the various rules in the technical section.&lt;br /&gt;
&lt;br /&gt;
====How much experience do I need to raise up my Experience Level?==== &lt;br /&gt;
&lt;br /&gt;
The needed experience is not the same for every level. To achieve level 2 you need 1000 experience, for level 3 - 3000. For level n you will need 1000 x (n-1) x n / 2. You can find a table with the experience points needed up to level 9 in the rules section.&lt;br /&gt;
&lt;br /&gt;
====Can I create a new faction?==== &lt;br /&gt;
&lt;br /&gt;
Yes you can. To do so you will need to satisfy the conditions found on the Faction Creation rules.&lt;br /&gt;
&lt;br /&gt;
==Technical Questions== &lt;br /&gt;
&lt;br /&gt;
====What do I need to play the Combine in the terms of hardware, software, etc?==== &lt;br /&gt;
&lt;br /&gt;
A computer or smartphone capable of connecting to the Internet and a web browser.&lt;br /&gt;
&lt;br /&gt;
====Do I have to download any software to play?==== &lt;br /&gt;
&lt;br /&gt;
No, all that you need is a browser.&lt;br /&gt;
 &lt;br /&gt;
==Rules Questions==&lt;br /&gt;
&lt;br /&gt;
====Where can I find SWC&#039;s rules?==== &lt;br /&gt;
&lt;br /&gt;
You can find them and other information about the SWC at: https://www.swcombine.com/rules/&lt;br /&gt;
&lt;br /&gt;
====What happens if I die?==== &lt;br /&gt;
&lt;br /&gt;
You lose all of your characters experience points, inventory and money. You will keep only your Combine Points and in three weeks you will be able to create a new character.&lt;br /&gt;
&lt;br /&gt;
====Is theft allowed in the Combine? ====&lt;br /&gt;
&lt;br /&gt;
Theft occurs in the Combine. How your character reacts or performs it is up to you.&lt;br /&gt;
&lt;br /&gt;
====Why can I not change the details (like ownership) of a ship owned by a faction?==== &lt;br /&gt;
&lt;br /&gt;
You can only change a ship&#039;s information if you own it. Ships given by a faction for your use are a privilege, and being such are not owned by you. This action was implemented in order to prevent theft of a faction&#039;s property&lt;br /&gt;
&lt;br /&gt;
====Is the Combine played in real time? ====&lt;br /&gt;
&lt;br /&gt;
The Combine is played in delayed real time. For more information read https://www.swcombine.com/rules/?Timeframe&lt;br /&gt;
&lt;br /&gt;
====What is spying and is it allowed?==== &lt;br /&gt;
&lt;br /&gt;
Spying is when you infiltrate a faction in order to gain information for another faction or person. Currently it is permitted under the rules. Full details on what you may and may not do in regards to spying can be found at http://www.swcombine.com/rules/?Spying .&lt;br /&gt;
&lt;br /&gt;
====What are raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials are the materials required to produce a certain piece of technology (ship, vehicle, weapon, etc.).&lt;br /&gt;
&lt;br /&gt;
====How can I die?==== &lt;br /&gt;
&lt;br /&gt;
Currently, there are only a few ways to die: running a ship into a sun or black hole, aborting hyper travel and crashing into a celestial body, or getting your faction, or someone else, to execute you. Players may also &amp;quot;drop&amp;quot; their character to start a new one (the three week respawn timer still applies).&lt;br /&gt;
&lt;br /&gt;
====How do I get raw materials?==== &lt;br /&gt;
&lt;br /&gt;
Raw materials can be mined or recovered via recycling. For mining, prospecting vehicles must be used to scan planets for deposits, and then a mining faction must construct a mine at the deposit location in order to mine the deposit for materials. For recycling, specific recycling entities must be used to break apart entities or wrecks into their basic materials.&lt;br /&gt;
 &lt;br /&gt;
==Getting Started Questions== &lt;br /&gt;
&lt;br /&gt;
====Can I be a jedi?==== &lt;br /&gt;
&lt;br /&gt;
Every race has its own force probability, giving you a chance to be born force sensitive. But if you are not, then you can still become one later by gaining experience and levels.&lt;br /&gt;
&lt;br /&gt;
====Why is the handle I selected declined?==== &lt;br /&gt;
&lt;br /&gt;
1: It has to sound like a word (Ex: &amp;quot;bgfive&amp;quot; or &amp;quot;imlame&amp;quot; would not be accepted, while &amp;quot;John doe&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
2: It can not be the name of an star wars character, although using the first or last names is allowed (Ex: &amp;quot;Luke skywalker is not a legal handle, but &amp;quot;Luke deacon&amp;quot; or &amp;quot;Mike skywalker&amp;quot; would be)&lt;br /&gt;
&lt;br /&gt;
3: No titles in your handle are allowed (Ex: no &amp;quot;Sir&amp;quot; &amp;quot;Darth&amp;quot; &amp;quot;Princess&amp;quot; &amp;quot;Dr.&amp;quot; etc...)&lt;br /&gt;
&lt;br /&gt;
4: All handles must have a capital for the first letter of the name (Ex: &amp;quot;john doe&amp;quot; is not legit, but &amp;quot;John doe&amp;quot; is)&lt;br /&gt;
&lt;br /&gt;
5: No special chars in it other then spaces, -, or ` (Ex: &amp;quot;John5 doe&amp;quot; would be illegal, but &amp;quot;John&#039;ell doe&amp;quot; would work)&lt;br /&gt;
&lt;br /&gt;
Each handle is unique; if it&#039;s too close to the name of another character it will be declined. (Ex: if you try to set your handle as &amp;quot;Jennifer Dreighton&amp;quot; it will automatically fail, since there already is a &amp;quot;Jennifer Dreighton&amp;quot;). You may have the same last name as another character, but you require their permission first. (Ex: There is a &amp;quot;Wilhelm von Ismay&amp;quot; and a &amp;quot;Victor von Ismay&amp;quot;, but Wilhelm got Victor&#039;s permission before setting his last name to that).&lt;br /&gt;
&lt;br /&gt;
====How do I log in? It keeps refreshing the page.==== &lt;br /&gt;
&lt;br /&gt;
First, use Lost Password to request a new password and log in with that. Be sure to paste or type it in exactly, as it is case sensitive.&lt;br /&gt;
&lt;br /&gt;
If that fails, check to ensure that you are using the up to date version of your web browser. Clear your cache and make sure cookies are enabled.&lt;br /&gt;
&lt;br /&gt;
If you are still having no luck, consider temporarily trying an alternate browser such as Opera (www.opera.com) or Mozilla (www.mozilla.org).&lt;br /&gt;
&lt;br /&gt;
====How can I earn credits?==== &lt;br /&gt;
&lt;br /&gt;
1. You can join a faction that pays its members a salary and/or bonuses.&lt;br /&gt;
&lt;br /&gt;
2. You can buy items and sell it for more.&lt;br /&gt;
&lt;br /&gt;
3. You can collect CPs and exchange them for entities that can be sold for credits.&lt;br /&gt;
&lt;br /&gt;
For more information, see the article on [[Credits]].&lt;br /&gt;
&lt;br /&gt;
====How can I get a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
In the beginning of your character&#039;s life, you will have the option of purchasing 3 ships for a very steep discount at the end of the tutorial, besides that, the easiest way of getting a ship or vehicle is by joining a faction and be assigned one. Later on when you have enough money you can buy another one for yourself. Another possibility is to exchange your CPs for some of the available ships and vehicles in the CP exchange.&lt;br /&gt;
&lt;br /&gt;
====Which faction should I join?==== &lt;br /&gt;
&lt;br /&gt;
That depends on who you want your character to be - a rebel or an empire supporter, a bounty hunter, a trader, a pirate, a researcher, etc. If you want to fly an X-Wing or a Mon Calamari cruiser, then you should join the Rebel Alliance or one of its allies. If you prefer the Tie Fighters and the Star Destroyers then you should definitely join the Galactic Empire. Of course you can join any other faction as well, depending on your interests. And who says you have to join any at all?&lt;br /&gt;
&lt;br /&gt;
====How do I get more Credits? ====&lt;br /&gt;
&lt;br /&gt;
The easiest way is to join a faction and receive a salary. You can also exchange CPs for entities that can be sold for credits. Alternately, you can start your own business like transporting ships and passengers for credits. Another possibility is to get a loan from a Bank faction or from another player, if you find somebody willing to loan you money.&lt;br /&gt;
&lt;br /&gt;
====How can I get off my starting planet?==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Make your way through the tutorial and purchase a ship.&lt;br /&gt;
&lt;br /&gt;
2. Join a faction, most offer transport to the planet you&#039;ll be working on, or supply a ship to fly around in.&lt;br /&gt;
&lt;br /&gt;
3. Buy a ride from another player or a transport faction, or rent a ship from another player/faction.&lt;br /&gt;
&lt;br /&gt;
4. Save up CPs and exchange them for a ship. &lt;br /&gt;
&lt;br /&gt;
5. Purchase a ship and have it moved to your location, to do this you&#039;ll need to earn some money first.&lt;br /&gt;
&lt;br /&gt;
====How to change my location (travel)? ====&lt;br /&gt;
&lt;br /&gt;
If you want to move from one position to another you have to go to position =&amp;gt; travel =&amp;gt; city =&amp;gt; you can enter some coordinates. If you give coordinates from (0,0) to (21,21) when you are on foot (walking), you will travel only inside the city. If you want to go to another city, first move to the edge of your current city in the direction you would like to go. Then go to position =&amp;gt; travel =&amp;gt; cross terrain =&amp;gt; then you can pick a position to where you want to go to.&lt;br /&gt;
&lt;br /&gt;
====I just created my character and assigned skill points. Where do I go and what do I do?==== &lt;br /&gt;
&lt;br /&gt;
It&#039;s up to you. You can work alone and be a freelancer or you can join a faction. While being an independent freelancer may sound fun, it doesn&#039;t provide the benefits a faction does such as paychecks every month, a neat duty like piloting a ship or vehicle, and a place to call home. Visit http://www.swcombine.com/community/factions.php for more details on the various factions. If you are interested in a faction, it would not be a bad idea to check out that faction’s website, as well as contacting a member from the faction&#039;s recruiting office to get more information on that faction’s services and benefits.&lt;br /&gt;
 &lt;br /&gt;
==How to Questions== &lt;br /&gt;
&lt;br /&gt;
====How can I gain CPs?==== &lt;br /&gt;
&lt;br /&gt;
The easiest way is to simply log in and play! You are awarded CPs every day that you log in. Suggesting planet descriptions, reporting bugs and typos, working on admin assignments or other ways of helping the development of the Combine can also be awarded.&lt;br /&gt;
&lt;br /&gt;
====How can I improve my skills? ====&lt;br /&gt;
&lt;br /&gt;
For every Experience Level you achieve, 1 skill point is added to your skill pool, which you can use to improve your skills, using the Character link on your right menu. However, skill increases cannot be undone, and it is possible that skill definitions for features not yet implemented may be changed in the future.&lt;br /&gt;
&lt;br /&gt;
====How can I get more experience? ====&lt;br /&gt;
&lt;br /&gt;
Experience points can be gained in many ways. Flying ships or piloting vehicles is a common method, it is also possible to gain them by mining or prospecting. Constructing buildings or stations gains an amount of experience. Small amounts are also awarded for certain achievements such as sending your first message or joining your first faction. Other ways may be added as the game develops.&lt;br /&gt;
&lt;br /&gt;
====How can I send a message to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the Send message link in your menu (it looks like an envelope) then Send Message. Enter the handle of the recipient and enter the message itself.&lt;br /&gt;
&lt;br /&gt;
====How can I send credits to another player? ====&lt;br /&gt;
&lt;br /&gt;
Click on the display of your current credits total in the right hand menu. This should bring up the Transfer Credits screen. Enter the handle of the character or the name of the faction to receive the credits, then enter the amount and add a comment if you want. Finally click Transfer.&lt;br /&gt;
&lt;br /&gt;
====How do I join a faction? ====&lt;br /&gt;
&lt;br /&gt;
Click the Faction link on the right hand menu and then on Join Faction. Select the one you would want to join, add a message if you want, click submit and await further instructions. Generally allow up to 24-48 hours for a reply from the faction to see if you have been accepted or not.&lt;br /&gt;
&lt;br /&gt;
====How do I launch a missile, fire my blaster or beat up a Wookiee? ====&lt;br /&gt;
&lt;br /&gt;
Full-scale Player vs. Player (PvP) Combat is not yet implemented. It is possible to brawl with Brawler NPCs for experience points and factions have the ability to arrest and execute. Ground combat is currently in beta - there are a couple systems that allow PvP ground combat while Player vs. Environment (PvE) is implemented in every system - while space combat is in alpha - one may find space bandits hiding in asteroid fields in deep space.&lt;br /&gt;
&lt;br /&gt;
====How do I report a bug? ====&lt;br /&gt;
&lt;br /&gt;
If you encounter a bug, click on the &amp;quot;Report Bug&amp;quot; link at the bottom of the right side menu. Please browse though the list of bugs to make sure that the bug you are reporting is a new one. If you find that your bug is already listed, add a comment to it stating your problem as well.&lt;br /&gt;
&lt;br /&gt;
====How can I support the Combine?==== &lt;br /&gt;
&lt;br /&gt;
There are many ways to support the Combine. SWC accepts donations to offset the cost of running servers. You can join one of the many volunteer teams (Art, Descriptions, Development, QA) to help improve the game. You can report bugs and typos.&lt;br /&gt;
&lt;br /&gt;
====How do I buy weapons/droids/items? ====&lt;br /&gt;
&lt;br /&gt;
A few minor items can already be bought in Shop and Commerce Centre facilities. Shops can be found in most starting cities and are NPC-owned, while Commerce Centres are faction/player owned.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the majority of weapons, droids, and items can be purchased from the faction that produces them, which is displayed on the rules page for the item in question, or from players who already own them.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s demonstrate a trade between two players. The person who buys the ship (Luke) has to contact the person who sells the ship (Han). Next, Luke has to pay for the ship by clicking on transaction sheet/credits transaction/transfer credits. Afterward, Luke must write the name of receiver, amount and communication and then choose the receiver type. When all this has been done, Luke solidifies the credit transfer by clicking on the &amp;quot;transfer&amp;quot; button. To give Luke his ship after receiving payment, Han has to click on &amp;quot;ships&amp;quot; in his personal inventory and choose who he wants to give the ship to (faction or person). Han must then select the ship Luke paid for and click on &amp;quot;Make Over.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Be warned that there are no guarantees for trading in the Combine and theft is an ever-present factor in the game.&lt;br /&gt;
&lt;br /&gt;
====How do I enter a ship or vehicle?==== &lt;br /&gt;
&lt;br /&gt;
First, you have to be assigned to the crewlist or set as owner/commander/pilot of the ship or vehicle to be able to board it. Once that is taken care of, click on &amp;quot;Position&amp;quot;, then &amp;quot;Enter&amp;quot;. If the above parameters are met, you should be able to see the ship. Click &amp;quot;Board&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====How do I pilot a ship or vehicle? ====&lt;br /&gt;
&lt;br /&gt;
After you have entered the ship or vehicle there will be a room map representing the layout of the entity in which you now reside. Find your way to the cockpit and a new button will appear on the side of the screen titled &amp;quot;Ship Controls&amp;quot; (or &amp;quot;Vehicle Controls&amp;quot;). Click that button and you will be taken to a new screen that will allow you to pilot your ship/vehicle.&lt;br /&gt;
&lt;br /&gt;
====How do I travel in a ship?==== &lt;br /&gt;
&lt;br /&gt;
To move around within a ship, your status in the Control panel must be set to Position (as opposed to Cockpit -- see below).&lt;br /&gt;
&lt;br /&gt;
To operate a ship, you first travel from the entrance room to the cockpit room. Once in the cockpit room, click &amp;quot;Ship Controls&amp;quot; (this option will only appear if you have been assigned as the pilot of the ship).&lt;br /&gt;
&lt;br /&gt;
To lift off, hit the Travel button then Ascend. It takes an hour to reach (upper) atmosphere.&lt;br /&gt;
&lt;br /&gt;
Once in the upper atmosphere, you need to reach orbit; this takes another hour. You do this from the Travel section by hitting Travel, then Orbit.&lt;br /&gt;
&lt;br /&gt;
Once in orbit, you have to escape the gravity well of the planet you&#039;re orbiting; this is the section shaded in red on the display under Travel. Hit the Sublight button and click on some square that is not in the red. This should take roughly half an hour of travel.&lt;br /&gt;
&lt;br /&gt;
Once out of the gravity well, you&#039;re free to go Hyper. Hit the Hyper button, then select from the menu of sectors (or choose a sector from the map of the galaxy), then select the desired system and Go.&lt;br /&gt;
&lt;br /&gt;
NOTE: Don&#039;t try to abort once in Hyper. You can lose the ship and be killed that way, should you come out near a celestial body.&lt;br /&gt;
&lt;br /&gt;
Upon entering a system, you&#039;ll be still a bit out from your destination planet; you&#039;ll have to hit Sublight and indicate which planet you want to go to.&lt;br /&gt;
&lt;br /&gt;
Upon arrival at the planet, you&#039;re in orbit. You can, at that point, change over to any other ship also in orbit for which you are listed as a Crewmember. To do this, Travel to that room in the ship which has the exit, hit Board, and select from among ships to which you have entree.&lt;br /&gt;
&lt;br /&gt;
To land a ship on the ground, you must reverse the lift-off procedure: First hit Travel, then Descend (and you can select your destination square on the planet); that takes an hour to put you in atmosphere. Once in atmosphere, you land by hitting Descend in the Travel section (and you can select your destination square in the city). Once landed, you can leave the ship by travelling to an exit room and hitting Board.&lt;br /&gt;
&lt;br /&gt;
NOTE: Some planets are protected by shields and will require access to descend to the ground.&lt;br /&gt;
&lt;br /&gt;
When you have been assigned as Pilot to a ship, you can then manage the crewlist. You do this with the Crewlist button on the bottom of the panel.&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
&lt;br /&gt;
Travel: Board&lt;br /&gt;
Control: Position: Travel to cockpit room&lt;br /&gt;
Control: Enter Cockpit&lt;br /&gt;
&lt;br /&gt;
Travel: Ascend to atmosphere&lt;br /&gt;
Travel: Ascend to orbit&lt;br /&gt;
Travel: Sublight out of gravity well&lt;br /&gt;
Travel: Hyper to new system&lt;br /&gt;
Travel: Sublight to planet&lt;br /&gt;
Travel: Descend to atmosphere&lt;br /&gt;
Travel: Descend to ground&lt;br /&gt;
&lt;br /&gt;
Control: Position: Travel to exit room&lt;br /&gt;
Travel: Board&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3805</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3805"/>
		<updated>2019-02-02T12:08:38Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 30 XP with the following message: You hired an NPC for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You used an item for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You have joined chat for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You have made your first post on the forums. (SWC forums)&lt;br /&gt;
*You gained 40 XP with the following message: You learned how to build a facility.&lt;br /&gt;
*You gained 10 XP with the following message: You found out how to form a party.&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3804</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3804"/>
		<updated>2019-01-11T12:04:07Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 20 XP with the following message: You used an item for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You have joined chat for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You have made your first post on the forums. (SWC forums)&lt;br /&gt;
*You gained 40 XP with the following message: You learned how to build a facility.&lt;br /&gt;
*You gained 10 XP with the following message: You found out how to form a party.&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Trading&amp;diff=3803</id>
		<title>Trading</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Trading&amp;diff=3803"/>
		<updated>2018-12-26T01:03:17Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Prices and Markets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==How Does Trading Work?  ==&lt;br /&gt;
===Trading=== &lt;br /&gt;
&#039;&#039;&#039;Important things to keep in mind:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
In the Combine, stealing from players through trading is an acceptable In Character action and is, therefore, neither punished nor undone. As such, it is strongly advised that traders not send first to others they do not already trust. If you doubt the honesty of the other party, then use a respected middleman. If you aren&#039;t sure who to trust, the best thing to do is to consult established Trader Reputation lists or by asking someone in your faction. If you have IRC access, you may also consider asking around in the #SWC-Traders channel on irc.swc-irc.com (See IRC section below). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Known Scammers&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
An up to date listing of known scammers, located in the Traders Lounge and compiled from the reports of traders posted in the forum. &lt;br /&gt;
http://www.swcombine.com/forum/thread.php?thread=9177&amp;amp;page=0 &lt;br /&gt;
&lt;br /&gt;
The idea behind trading is to buy and sell ships, vehicles, cities, buildings, and other assets in order to make a profit. At this time, most trading takes part in the IRC trading channel, in the Combine&#039;s RPG Centre forums, and on some private markets run by various factions. When visiting #SWC-Traders on IRC, you will see people using the following abbreviations: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WFS&#039;&#039;&#039; - What&#039;s for sale? &amp;lt;br /&amp;gt;&lt;br /&gt;
This is asking the traders in the room what they are selling. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FS&#039;&#039;&#039; - For sale &amp;lt;br /&amp;gt;&lt;br /&gt;
When you are trying to sell something, you would add FS as the start then the type of ships (e.g. FS: YT-1300, 2 Firesprays). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FT&#039;&#039;&#039; - For trade &amp;lt;br /&amp;gt;&lt;br /&gt;
This means someone has a ship they wish to trade for another type of ship (e.g. FT: YT-510). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FA&#039;&#039;&#039; - For auction &amp;lt;br /&amp;gt;&lt;br /&gt;
When something is for auction, normally the trader auctioning the item off will provide a link to the auction listing, or it will be online in another channel (e.g. FA: Carrack Cruiser - come to #my_room to bid). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OBO&#039;&#039;&#039; - Or Best Offer &amp;lt;br /&amp;gt;&lt;br /&gt;
When the seller states a price he/she could also accept other offers (e.g. BFF-1 bulk freighter, 21 millions OBO).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WTB&#039;&#039;&#039; - Want to Buy &amp;lt;br /&amp;gt;&lt;br /&gt;
When looking to buy a specific item, use this (e.g. WTB: Y-Wing). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WTS&#039;&#039;&#039; - Want to Sell &amp;lt;br /&amp;gt;&lt;br /&gt;
When looking to sell a specific item, use this (e.g. WTS: X-Wing).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U/U/U&#039;&#039;&#039; - Undamaged, Undocked, Unshielded &amp;lt;br /&amp;gt;&lt;br /&gt;
The entity is not under shield or inside another entity, and its stats are all topped.&lt;br /&gt;
&lt;br /&gt;
When selling a ship, you may be asked to assign the ship first before making it over, and it is recommended that you ask the same of a seller if you are looking to buy a ship, if you have any doubts that they own it. Always avoid sending first to traders you do not trust, or are not listed as reputable. If the other party refuses to send first or to use a middleman, there is a high likelihood that they are trying to steal from you.&lt;br /&gt;
&lt;br /&gt;
===Prices and Markets=== &lt;br /&gt;
&lt;br /&gt;
The Combine has an official market built into its interface, accessed through the &#039;[[Galactic Market|Market]]&#039; link on the right-hand menu (or through http://www.swcombine.com/members/market/ directly). To buy from or sell to the market, you must be on a trading station or inside a commerce centre facility. In case your faction cannot provide you access to such a facility, the factions Centrepoint Space Station and Baobab Merchant Fleet host a listing of public trading stations at http://www.centrepointstation.com/services/markets.php and http://bmf.force501.com/forum/viewtopic.php?f=104&amp;amp;t=2787 respectively. It is best to purchase items as close to your location as possible, since the closer you are to the item you are buying, the less it will cost you. When you purchase it from the market, it is made over to you immediately. Not many traders sell to this market as doing so is not very profitable, so the majority of assets available at any given time are usually the former possessions of a character that has recently died. &lt;br /&gt;
&lt;br /&gt;
The Centrepoint Space Station trading faction also hosts a private market on its own website (referred to as Centrepoint Market, or CPM, and located at http://market.centrepointstation.com/), and this is what most traders use. This market can be compared to eBay, in that traders can post listings for items they are selling and other traders can bid on them or buy them out, but the items are not transferred immediately. The traders must contact each other to complete the transaction, and it is strongly recommended that a trusted middleman is used. This offsite market (linked in Useful Links below) is not officially affiliated with the Combine, and as such, any problems with it need to be directed to the faction hosting it. &lt;br /&gt;
&lt;br /&gt;
The Trade Federation Market (aka TFM) is another place where individuals and companies can advertise their goods (http://dot.swc-tf.com/index.php).&lt;br /&gt;
&lt;br /&gt;
The prices listed in the rules section of the Combine&#039;s website are only the raw production cost of each item. This is bound to be a much lower price than you will be able to purchase the items for from other players. Prices are constantly changing depending on how desirable the item in question is, how many are available to the public, and how much sellers are willing to sell for. Faction-specific items, such as TIE Fighters and A-Wings, are generally not available to the public. In the rare instance that some are successfully stolen from their faction, they tend to sell for hundreds of millions of credits.&lt;br /&gt;
&lt;br /&gt;
===Useful Links=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Centrepoint Market &#039;&#039;&#039;&lt;br /&gt;
http://market.centrepointstation.com/ &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Trade Federation Market &#039;&#039;&#039;&lt;br /&gt;
http://dot.swc-tf.com/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Traders Lounge&#039;&#039;&#039; &#039;&#039;(for trading discussion, not for buying/selling)&#039;&#039; &lt;br /&gt;
http://www.swcombine.com/forum/forum.php?forumID=55 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Commerce forum&#039;&#039;&#039; &lt;br /&gt;
http://www.swcombine.com/forum/forum.php?forumID=52 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gambling Hut &#039;&#039;&#039;&lt;br /&gt;
http://www.swcombine.com/forum/forum.php?forumID=139&lt;br /&gt;
&lt;br /&gt;
===IRC (Internet Relay Chat)=== &lt;br /&gt;
&lt;br /&gt;
[[IRC]] refers to online chatrooms, used to communicate with other individuals in real-time over the Internet. &lt;br /&gt;
&lt;br /&gt;
http://www.mirc.com &lt;br /&gt;
mIRC is the preferred client for the Windows platform. This is recommended for users who plan to use IRC on a regular basis. &lt;br /&gt;
&lt;br /&gt;
http://www.swcombine.com/community/chat/ &lt;br /&gt;
The Combine also hosts a Java client through which players can connect to the Combine IRC server directly through their web browser without downloading an alternate IRC client. This is recommended for users who will not be using IRC on a regular basis. &lt;br /&gt;
&lt;br /&gt;
Server: irc.swc-irc.com &lt;br /&gt;
Port: 6667 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Channels &#039;&#039;&#039;&lt;br /&gt;
* #swc-members - SWC Members Room, for general chat with other players. &lt;br /&gt;
* #swc-traders - SWC Trading Room, for buying and selling from other players. &lt;br /&gt;
* #swc-help - SWC Help Room, for Combine-related and IRC-related help. &lt;br /&gt;
* #CMG- is a prefix usually used to access a specific faction&#039;s chatroom.&lt;br /&gt;
[[Category:Advanced Activities]]&lt;br /&gt;
[[Category:Game Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3802</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3802"/>
		<updated>2018-12-19T20:37:04Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 20 XP with the following message: You have joined chat for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You have made your first post on the forums. (SWC forums)&lt;br /&gt;
*You gained 40 XP with the following message: You learned how to build a facility.&lt;br /&gt;
*You gained 10 XP with the following message: You found out how to form a party.&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Medicine&amp;diff=3801</id>
		<title>Medicine</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Medicine&amp;diff=3801"/>
		<updated>2018-12-06T21:56:55Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Medical Items: What and How */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Medical Items: What and How ==&lt;br /&gt;
&lt;br /&gt;
[http://www.swcombine.com/rules/?Medical_Items Medical items] will let you restore your own, another player&#039;s or an NPC&#039;s [[HP]].&lt;br /&gt;
They can be produced by any medical faction.&lt;br /&gt;
&lt;br /&gt;
The following items are considered medical items and can be used to restore HP:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:BactaPatch.png|center]][http://www.swcombine.com/rules/?Medical_Items&amp;amp;ID=107 Bacta Patch] || [[File:BactaRefill.png|center]][http://www.swcombine.com/rules/?Medical_Items&amp;amp;ID=114 Bacta Refill] || [[File:Emptybactatank.png|center]][http://www.swcombine.com/rules/?Medical_Items&amp;amp;ID=112 Bacta Tank] || [[File:HealingStick.png|center]][http://www.swcombine.com/rules/?Medical_Items&amp;amp;ID=111 Healing Stick] || [[File:KoltoPatch.png|center]][http://www.swcombine.com/rules/?Medical_Items&amp;amp;ID=399 Kolto Patch] || [[File:Medikit.png|center]] [http://www.swcombine.com/rules/?Medical_Items&amp;amp;ID=108 Medikit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To use a medical item, the following conditions must be met: &lt;br /&gt;
&lt;br /&gt;
*You and your target need to be at the same location.&lt;br /&gt;
*You and your target must be in the same faction or be set as &amp;quot;Friend&amp;quot; on each other&#039;s IFF.&lt;br /&gt;
*You and your target must not be part of another medical action.&lt;br /&gt;
*For Bacta Tanks and Medikits: You need enough Bacta Refills inside the entity.&lt;br /&gt;
*For Bacta Tanks: The Tank must be deployed in a medical room and you and your target must be in the same room.&lt;br /&gt;
&lt;br /&gt;
While being part of a medical action, neither you nor your target can move. Before being put into a Bacta Tank, the target automatically drops all equipped items.&lt;br /&gt;
&lt;br /&gt;
=== Drugs ===&lt;br /&gt;
&lt;br /&gt;
Trading factions may produce counterfeit medical items or drugs which look exactly like some medical items. These drugs are mainly made from Ryll and are cheaper to produce. However upon using them as a medical item, they result in 0 HP being recovered.&lt;br /&gt;
&lt;br /&gt;
=== Using a Medical Item ===&lt;br /&gt;
&lt;br /&gt;
To use a medical item on someone else, you have to apply it via the Item screen or - in case of the bacta tank - load the patient into the tank. After using a medical item, the following will happen to the medical item: &lt;br /&gt;
*Bacta Patch / Ryll Patch / Kolto Patch: item is destroyed&lt;br /&gt;
*Healing Stick / Death Stick: item is destroyed&lt;br /&gt;
*Medikit: Medikit remains, 1 Bacta Refill / Ryfill inside is destroyed&lt;br /&gt;
*Bacta Tank: Tank remains, all 3 Bacta Refills / Ryfills inside are destroyed&lt;br /&gt;
&lt;br /&gt;
=== Filling a Bacta Tank ===&lt;br /&gt;
Bacta refills are loaded into the tank the same way one would load items into a container.&lt;br /&gt;
*Click on a bacta refill.&lt;br /&gt;
*The tank is now highlighted as a location where the item can be moved into.&lt;br /&gt;
*Click on the tank.&lt;br /&gt;
*Repeat the above two more times, until you have 3 refills in the tank.&lt;br /&gt;
&lt;br /&gt;
== Equations ==&lt;br /&gt;
{| Border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Item&#039;&#039;&#039; || &#039;&#039;&#039;Base Amount Healed&#039;&#039;&#039; || &#039;&#039;&#039;Refills Needed&#039;&#039;&#039; || &#039;&#039;&#039;Time/min&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| Kolto Patch || 3 || N/A || 30&lt;br /&gt;
|-&lt;br /&gt;
| Bacta Patch || 5 || N/A || 30&lt;br /&gt;
|-&lt;br /&gt;
| Healing Stick || 8 || N/A || 30&lt;br /&gt;
|-&lt;br /&gt;
| Medikit with Bacta Refill || 10 || 1 || 30&lt;br /&gt;
|-&lt;br /&gt;
| Bacta Tank with Bacta Refill || All HP Restored|| 3 || 600&amp;amp;dagger;&lt;br /&gt;
|-&lt;br /&gt;
| Ryll Patch || 0 || N/A || 30 &lt;br /&gt;
|-&lt;br /&gt;
| Death Stick || 0 || N/A || 30&lt;br /&gt;
|-&lt;br /&gt;
| Medikit with Bacta Ryfill || 0 || 1 || 30&lt;br /&gt;
|-&lt;br /&gt;
| Bacta Tank with Bacta Ryfill || 0 || 3 || 600&amp;amp;dagger;&lt;br /&gt;
|}&lt;br /&gt;
&amp;amp;dagger;NOTE: For most medical items, both the player using the item (the &amp;quot;healer&amp;quot;) and the player being healed will enter into a Medical Timer. However, for Bacta Tanks, only the player being healed receives a timer, leaving the &amp;quot;healer&amp;quot; free to go about other activities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The amount of HP restored depends on the item used and the user&#039;s Medical Skill as per the following formula: &lt;br /&gt;
&lt;br /&gt;
 HP restored = round(Base Amount Healed × (Medical Skill + 1)) &lt;br /&gt;
&lt;br /&gt;
If the healing is done within a [[#Entities with Medical Rooms|medical entity]], the healing power of the medical items is increased by a factor of 1.3:&lt;br /&gt;
&lt;br /&gt;
 HP restored = round(Base Amount Healed × (Medical Skill + 1) × 1.3) &lt;br /&gt;
&lt;br /&gt;
The XP gained from using medical items is:&lt;br /&gt;
&lt;br /&gt;
 XP gained = round(HP restored / 2)&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Veynom has 12 HP left of his maximum of 85 HP. He has a Medical Skill of 3. He applies a Bacta Patch to heal his wounds. &lt;br /&gt;
&lt;br /&gt;
 HP restored = 5 * (3 + 1) = 20&lt;br /&gt;
 XP gained = 20 / 2 = 10&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
 &lt;br /&gt;
Selatos has 20 HP left of his maximum 100 HP. He has a Medical Skill of 5. He uses a Medikit with a Bacta Refill to heal his wounds.&lt;br /&gt;
&lt;br /&gt;
 HP restored = 10 * (5 + 1) = 60&lt;br /&gt;
 XP gained = 60 / 2 = 30&lt;br /&gt;
&lt;br /&gt;
=== Bacta Tanks ===&lt;br /&gt;
&lt;br /&gt;
Bacta Tanks can only be deployed in medical rooms. For a bacta tank to be deployed, it must be inside a medical room and no other tanks can be deployed in the same room. (i.e., you can only deploy a single tank in a room).&lt;br /&gt;
&lt;br /&gt;
Once deployed, the tank can be loaded with up to three Bacta Refills. Once a single refill is loaded, the tank cannot be undeployed, nor can the refill be taken out again. You cannot load more than three refills.&lt;br /&gt;
&lt;br /&gt;
Once three refills have been loaded, you can apply the tank to a patient (either yourself, another player or an NPC in your party). At that time, the patient will drop all items he&#039;s carrying and is loaded into the tank. He will be ejected once the healing process is completed.&lt;br /&gt;
&lt;br /&gt;
Any player can add an unconscious player to their party, and a Bacta Tank can be used to heal them above 0 HP.&lt;br /&gt;
&lt;br /&gt;
Bacta Tanks can be flushed, removing any previously loaded Bacta Refills (or Bacta Ryfills) in the process. This can only be done if no patient is present in the tank.&lt;br /&gt;
&lt;br /&gt;
== Entities with Medical Rooms ==&lt;br /&gt;
&lt;br /&gt;
The following entities contain one or more medical rooms. &lt;br /&gt;
&lt;br /&gt;
*Facilities:&lt;br /&gt;
Asylum (1), Command Centre (1), Conference Centre (1), Government House (1), Hospital (6), Imperial Palace (2), Palace (1), Praxium (1), Royal Hapan Palace (1), Sith Temple (1)   &lt;br /&gt;
&lt;br /&gt;
*Ships:&lt;br /&gt;
Ardent-class Fast Frigate (1), Battle Dragon (1), Darkstar-class Battleship (1), EF65 Meridian-class Frigate (2), EF76 Nebulon-B Medical Frigate (4), Executor-class Star Destroyer (1), Imperial I-class Star Destroyer (1), Ithorian Herdship (1), Lucrehulk-class Battleship (1), MC-80 Home One-class Star Cruiser (1), MC-80a Star Cruiser (1), MC-80b Star Cruiser (1), Prometheus-class Star Craft (2), Pulsar Battle Cruiser (1), Sprint-class Rescue Craft (2), Veltraa-class Cruiser (1), Verpine-class Heavy Cruiser (1)&lt;br /&gt;
&lt;br /&gt;
*Vehicles:&lt;br /&gt;
Conquest-class Carrier (1), Kettrifee Air Mover (4)&lt;br /&gt;
&lt;br /&gt;
*Space Stations:&lt;br /&gt;
Centrepoint Station (1), Jubilee Wheel (4), Hospital Platform XQ-2 (3), Medical Factory Station (1)&lt;br /&gt;
[[Category:Advanced Activities]]&lt;br /&gt;
[[Category:Game Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3800</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3800"/>
		<updated>2018-11-29T18:55:49Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 20 XP with the following message: You have made your first post on the forums. (SWC forums)&lt;br /&gt;
*You gained 40 XP with the following message: You learned how to build a facility.&lt;br /&gt;
*You gained 10 XP with the following message: You found out how to form a party.&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3799</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3799"/>
		<updated>2018-11-26T19:02:58Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 40 XP with the following message: You learned how to build a facility.&lt;br /&gt;
*You gained 10 XP with the following message: You found out how to form a party.&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3798</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3798"/>
		<updated>2018-11-24T02:07:49Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 10 XP with the following message: You found out how to form a party.&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3797</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3797"/>
		<updated>2018-11-24T00:12:32Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 40 XP with the following message: You now know how to use scanners.&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3796</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3796"/>
		<updated>2018-11-17T18:10:02Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 10 XP with the following message: You walked to another room for the first time.&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3795</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3795"/>
		<updated>2018-11-17T15:57:26Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 40 XP with the following message: You made your first hyperspace jump.&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3794</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3794"/>
		<updated>2018-11-16T20:32:23Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 20 XP with the following message: You learned how to use the transactions system. (send credits)&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown. (travel sublight)&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets. (assign something)&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3793</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3793"/>
		<updated>2018-11-16T00:05:59Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 40 XP with the following message: You have left your homeworld for horizons unknown.&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets.&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3792</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3792"/>
		<updated>2018-11-15T23:30:32Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Crafting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10 XPs when you successfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets.&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=XP&amp;diff=3791</id>
		<title>XP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=XP&amp;diff=3791"/>
		<updated>2018-11-15T23:30:10Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* First Time XP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XP refers to your Experience Points. These are a measure of how much experience you have accumulated as your character, and generally how powerful you are. The more XP you have, the higher your level, and the more skill points you have available to allocate to your skills.&lt;br /&gt;
&lt;br /&gt;
==Getting XP==&lt;br /&gt;
There are a variety of different ways of getting XP. It is received for the majority of in-game actions within the SWC interface. Some of the ways to accumulate XP are listed below:&lt;br /&gt;
&lt;br /&gt;
===Building===&lt;br /&gt;
&lt;br /&gt;
===Crafting===&lt;br /&gt;
[[Crafting]] nets you 10XP when you sucessfully complete crafting an item.&lt;br /&gt;
&lt;br /&gt;
===First Time XP===&lt;br /&gt;
*You gained 20 XP with the following message: You found out how to assign assets.&lt;br /&gt;
*You gained 50 XP with the following message: You sent a DM to your faction.&lt;br /&gt;
*You gained 100 XP with the following message: You used NPC Transport Service for the first time.&lt;br /&gt;
*You gained 50 XP with the following message: You successfully found your way out of the starting building.&lt;br /&gt;
*You gained 100 XP with the following message: You are now a faction member for the first time.&lt;br /&gt;
*You gained 20 XP with the following message: You started using the message system.&lt;br /&gt;
*You gained 20 XP with the following message: You sent your first faction join request&lt;br /&gt;
&lt;br /&gt;
===Force Training===&lt;br /&gt;
Those who are able to use the force gain experience every time they successfully train. As well as gaining experience towards their next level of force mastery, a character also gains 15 XP for every successful training session.&lt;br /&gt;
&lt;br /&gt;
If training with an apprentice, should the apprentice successfully train then the apprentice gains 15 XP and the master gains 5 XP for overseeing them.&lt;br /&gt;
&lt;br /&gt;
===Healing===&lt;br /&gt;
You receive XP each time you heal yourself from an injury and gain XP equal to half the amount of HP healed. The amount healed improves with your Medical Treatment skill and with the quality of medical items used. A bacta tank or medikit loaded with bacta refills heals for the greatest amount of HP, and therefore rewards you with the most XP (although a bacta tank takes a long time to complete healing and is an inefficient source of XP gain). Healing sticks provide the next highest amount of healing, followed by bacta patches.&lt;br /&gt;
&lt;br /&gt;
Using a healing item while on board a medical entity, which is any entity containing at least one healing room, multiplies the amount of healing done by 1.3, and therefore also provides you with more XP.&lt;br /&gt;
&lt;br /&gt;
===Hunting===&lt;br /&gt;
Hunting is one of the most lucrative means of XP gain. You receive up to 40 XP per half hour combat round and cannot die. XP is decreased if you miss any shots. See the [[Hunting]] page for more information and for detailed advice about getting started and maximizing your XP gains.&lt;br /&gt;
&lt;br /&gt;
===Making Doors===&lt;br /&gt;
[[Doors and Locks|Installing doors]] gives you a varying amount of XP, depending on the level of the door you are installing:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Level&#039;&#039;&#039; || &#039;&#039;&#039;XP&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 20XP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 40XP&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 80XP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Mining===&lt;br /&gt;
[[Production (Mining)|Mining]] nets you a set 10XP each time a mine finishes mining. This happens after the 7 day mining period ends. If the mine is set to &#039;repeat&#039; then it will continue to mine, giving you 10XP every week until it stops.&lt;br /&gt;
&lt;br /&gt;
===Production===&lt;br /&gt;
&lt;br /&gt;
===Recycling===&lt;br /&gt;
&lt;br /&gt;
===Travel===&lt;br /&gt;
Ground travel enables you to gain 1 XP per surface square traveled, and crossing terrain enables you to gain 10 XP. Space travel enables you to gain 1 XP per coordinate traveled, both in sublight and in hyperspace. Traveling between ground and atmosphere in a ship, or atmosphere and orbit, enables you to gain 5 XP for that trip.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
Participating in [[White Scenarios]] rewards you with up to 150 XP per post, based on the quality and quantity of your roleplaying post content. The average per post is around 40 XP.&lt;br /&gt;
&lt;br /&gt;
Participating in the Scenario Hall forum in the RPG Centre rewards you with up to 20 XP per post, also based on quality and quantity of your post content. These are easier to join than a White Scenario and require considerably less time for the moderators to complete scoring, so you receive XP more quickly.&lt;br /&gt;
&lt;br /&gt;
There is no limit to the number of scenarios you can participate in simultaneously on either board.&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Construction&amp;diff=3790</id>
		<title>Construction</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Construction&amp;diff=3790"/>
		<updated>2018-10-07T07:42:26Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Construction Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Construction is a term used to categorise the creation of cities, facilities and stations and can be considered separate from [[production]]. This article attempts to cover the construction of such entities in brief.&lt;br /&gt;
&lt;br /&gt;
Facilities can be either built on the ground or in space, with each having a different set of requirements and restrictions. They will therefore be discussed individually.&lt;br /&gt;
&lt;br /&gt;
==Space Stations==&lt;br /&gt;
[[File:Golan2.jpg|Golan II Defence Station]]&lt;br /&gt;
&lt;br /&gt;
Space stations are large structures built only within systems. These can serve a variety of uses, some act as defensive structures such as Golan class (see above), designed to attack enemies nearby. Others can be used for trading, production or [[recycling]].&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
Before construction can commence on a station, various things must be gathered before the user can proceed.&lt;br /&gt;
&lt;br /&gt;
*Station Blueprints - The user must get hold of blueprints for the station they wish to build. Station blueprints are distributed primarily to factions, with different factions holding station blueprints. Government factions have the widest range of stations, holding many of the defensive and support station designs, while Smugglers and mercenary groups have facilities such as Asteroid Hideouts. The user may be able to join one of these factions in order to make use of the plans.&lt;br /&gt;
*Raw Materials - The user will need raw materials in order to construct their station. These must be located on a [[Ships|ship]] at the site of the project. Be aware that large stations such as Golan II or Shipyard IV will require dramatically more resources to build. Also the user will need credits.&lt;br /&gt;
*[[NPC]]s - Builder NPCs are required to construct stations. These need to be at the same system location as the planned station. A user may have anywhere between one and 25 NPCs working on a station. &lt;br /&gt;
* [[Privileges]] - If the user is building the station for a faction then they require the relevant materials privileges to use faction resources and the relevant construction privileges.&lt;br /&gt;
* The area of space the user wishes to build in must not contain another station, star or black hole.&lt;br /&gt;
* Build Permissions - Users may build a station in orbit of a planet however in order to do so, the request must be approved by the sector owner. Before construction can commence, a build request must be submitted to the owning faction stating the precise nature of the project for the factions consideration. If approved then you may build only the requested facility.&lt;br /&gt;
&lt;br /&gt;
===Construction Process===&lt;br /&gt;
&lt;br /&gt;
Once the above has been considered, the user is ready to build. Proceed to the entrance room of the ship to find the option for Station Construction. The preview will show the intended location of the station and a time estimate will be provided. The user may then assign any number of builder NPCs to the project, with more builders decreasing the time taken. Additionally the users management skill will reduce the financial cost and time requirements.&lt;br /&gt;
&lt;br /&gt;
Once accepted the project will commence. The station foundations are placed in the system and will be noticeable effective immediatly. All raw materials and NPCs involved in the project transfer onto the station, at which point the user is free to move along and come back at a later date. Note that stations will take a long time to produce, some can take several months to build. Once completed, an amount of experience is provided to the user as well as all NPCs.&lt;br /&gt;
&lt;br /&gt;
===Pausing/Aborting Construction===&lt;br /&gt;
&lt;br /&gt;
Once a construction project has started it can be halted through the stations management section. The project will then be stopped. A project can remain halted indefinitely without problem.&lt;br /&gt;
&lt;br /&gt;
Alternatively the project can be cancelled remotely by anyone with sufficient privileges to do so or the original builder. When the project is cancelled there is the option to return any used resources to any ship at the same location. The amount of resources returned is equal to the percentage of the project remaining minus 10%. It will also take a few hours to take the station apart, the closer it is to completion the longer it will take to dismantle.&lt;br /&gt;
&lt;br /&gt;
All NPCs will finally leave the station remains once completely dismantled and can be collected in a specialist escape pod.&lt;br /&gt;
&lt;br /&gt;
==Ground Facilities==&lt;br /&gt;
Ground facilities are structures based on a planets surface and are built in mostly the same way to stations also having similar requirements and limitations.&lt;br /&gt;
&lt;br /&gt;
===City Placement===&lt;br /&gt;
A user cannot start construction on a planet straight away. First any space on the ground which needs construction must be developed into a city. The person must descend to the planets surface to perform what is known as &amp;quot;slabbing&amp;quot;. This converts the empty surface tile into a city ready for construction.&lt;br /&gt;
&lt;br /&gt;
The process costs an amount of credits between one and three million credits depending upon the terrain type being used and will take an hour. It may also cost an extra half million if the planet is of a particularly dangerous atmosphere. This cost can be paid by either the individual or, if built for faction purposes, faction credits. The user does not need any NPC for this task.&lt;br /&gt;
&lt;br /&gt;
Alternatively the user may opt to make the city a hidden city. Hidden cities do not appear on planetary maps and are not visible from above unless a character is in the atmosphere directly above.&lt;br /&gt;
&lt;br /&gt;
Caution, if the city is empty for more than three months the city will be removed and the slabbing costs will not be returned.&lt;br /&gt;
&lt;br /&gt;
===Facility Construction Requirements===&lt;br /&gt;
&lt;br /&gt;
Once a city has been founded, the user is able to construct facilities. Before building though, it is adviseable to use the [http://www.swcombine.com/citydesigner/| Combine City Designer]. This will allow the user to plan out their city and identify if their design is valid, whether it will have sufficient power etc. The designer will also show the amount of materials required.&lt;br /&gt;
&lt;br /&gt;
Before a user can construct there are requirements, many of these the same as space stations such as the need for facility blueprints. Again various faction types have the ability to create such buildings. Otherwise the user still needs raw materials, credits, NPC builders as well as permissions from the city owner to build.&lt;br /&gt;
&lt;br /&gt;
Additional concerns:&lt;br /&gt;
* Validity - A facility has slightly different requirements in that it MUST have two completely free sides to build roads along them. Note that the edges of the city do not count as free space.&lt;br /&gt;
* Power - Once completed, a facility will require power to function. This can be provided from any Power Generators in the same city. Without power it cannot perform the majority of its functions.&lt;br /&gt;
&lt;br /&gt;
===Construction Process===&lt;br /&gt;
The resources to commence construction must be available in any ship or pre-existing facility in the city. Once again faction privileges are required to use faction resources.&lt;br /&gt;
&lt;br /&gt;
The user must have builder NPCs in their party and must enter the city. In order to start construction, the user must stand in a square adjacent to the planned facility. &lt;br /&gt;
&lt;br /&gt;
The user may then name the facility, select a type of facility and the ownership of the finished object. Note that some items MUST be owned by a faction, such as religious or defensive facilities. The user may select the orientation of the finished city, either horizontally or vertically.&lt;br /&gt;
&lt;br /&gt;
The next step will be to see how the city will appear with the finished building, which is demonstrated on the preview. The design may also be changed by the user to suit the planets environment or design, finally the number of builders can be assigned to the project. The maximum number of builders which can be assigned is 10, with more reducing the time slightly as well as the Management skill. It is possible to start construction with a number of Builders and later add more Builders (within the maximum 10 NPCs per facility limit). NPCs are added through the Party command menu.&lt;br /&gt;
&lt;br /&gt;
Once the project has been started the user is free to move somewhere else and allow the NPC to work. Once completed the builder and manager will receive experience points.&lt;br /&gt;
&lt;br /&gt;
===Pausing/Aborting Construction===&lt;br /&gt;
Construction work can be halted on a project by removing NPCs from the project. Most commonly this happens when an NPC is arrested. If the number of active NPCs reaches zero, production stops. NPCs can then be re added if necessary. Construction can also be halted through facility management options.&lt;br /&gt;
&lt;br /&gt;
Additionally it is possible to abort the production, materials may be returned to any ship, vehicle or suitable facility. As per before, resources returned equals the percentage left on the project minus 10 percent.&lt;br /&gt;
[[Category:Advanced Activities]]&lt;br /&gt;
[[Category:Game Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Construction&amp;diff=3789</id>
		<title>Construction</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Construction&amp;diff=3789"/>
		<updated>2018-10-07T07:32:02Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Construction Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Construction is a term used to categorise the creation of cities, facilities and stations and can be considered separate from [[production]]. This article attempts to cover the construction of such entities in brief.&lt;br /&gt;
&lt;br /&gt;
Facilities can be either built on the ground or in space, with each having a different set of requirements and restrictions. They will therefore be discussed individually.&lt;br /&gt;
&lt;br /&gt;
==Space Stations==&lt;br /&gt;
[[File:Golan2.jpg|Golan II Defence Station]]&lt;br /&gt;
&lt;br /&gt;
Space stations are large structures built only within systems. These can serve a variety of uses, some act as defensive structures such as Golan class (see above), designed to attack enemies nearby. Others can be used for trading, production or [[recycling]].&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
Before construction can commence on a station, various things must be gathered before the user can proceed.&lt;br /&gt;
&lt;br /&gt;
*Station Blueprints - The user must get hold of blueprints for the station they wish to build. Station blueprints are distributed primarily to factions, with different factions holding station blueprints. Government factions have the widest range of stations, holding many of the defensive and support station designs, while Smugglers and mercenary groups have facilities such as Asteroid Hideouts. The user may be able to join one of these factions in order to make use of the plans.&lt;br /&gt;
*Raw Materials - The user will need raw materials in order to construct their station. These must be located on a [[Ships|ship]] at the site of the project. Be aware that large stations such as Golan II or Shipyard IV will require dramatically more resources to build. Also the user will need credits.&lt;br /&gt;
*[[NPC]]s - Builder NPCs are required to construct stations. These need to be at the same system location as the planned station. A user may have anywhere between one and 25 NPCs working on a station. &lt;br /&gt;
* [[Privileges]] - If the user is building the station for a faction then they require the relevant materials privileges to use faction resources and the relevant construction privileges.&lt;br /&gt;
* The area of space the user wishes to build in must not contain another station, star or black hole.&lt;br /&gt;
* Build Permissions - Users may build a station in orbit of a planet however in order to do so, the request must be approved by the sector owner. Before construction can commence, a build request must be submitted to the owning faction stating the precise nature of the project for the factions consideration. If approved then you may build only the requested facility.&lt;br /&gt;
&lt;br /&gt;
===Construction Process===&lt;br /&gt;
&lt;br /&gt;
Once the above has been considered, the user is ready to build. Proceed to the entrance room of the ship to find the option for Station Construction. The preview will show the intended location of the station and a time estimate will be provided. The user may then assign any number of builder NPCs to the project, with more builders decreasing the time taken. Additionally the users management skill will reduce the financial cost and time requirements.&lt;br /&gt;
&lt;br /&gt;
Once accepted the project will commence. The station foundations are placed in the system and will be noticeable effective immediatly. All raw materials and NPCs involved in the project transfer onto the station, at which point the user is free to move along and come back at a later date. Note that stations will take a long time to produce, some can take several months to build. Once completed, an amount of experience is provided to the user as well as all NPCs.&lt;br /&gt;
&lt;br /&gt;
===Pausing/Aborting Construction===&lt;br /&gt;
&lt;br /&gt;
Once a construction project has started it can be halted through the stations management section. The project will then be stopped. A project can remain halted indefinitely without problem.&lt;br /&gt;
&lt;br /&gt;
Alternatively the project can be cancelled remotely by anyone with sufficient privileges to do so or the original builder. When the project is cancelled there is the option to return any used resources to any ship at the same location. The amount of resources returned is equal to the percentage of the project remaining minus 10%. It will also take a few hours to take the station apart, the closer it is to completion the longer it will take to dismantle.&lt;br /&gt;
&lt;br /&gt;
All NPCs will finally leave the station remains once completely dismantled and can be collected in a specialist escape pod.&lt;br /&gt;
&lt;br /&gt;
==Ground Facilities==&lt;br /&gt;
Ground facilities are structures based on a planets surface and are built in mostly the same way to stations also having similar requirements and limitations.&lt;br /&gt;
&lt;br /&gt;
===City Placement===&lt;br /&gt;
A user cannot start construction on a planet straight away. First any space on the ground which needs construction must be developed into a city. The person must descend to the planets surface to perform what is known as &amp;quot;slabbing&amp;quot;. This converts the empty surface tile into a city ready for construction.&lt;br /&gt;
&lt;br /&gt;
The process costs an amount of credits between one and three million credits depending upon the terrain type being used and will take an hour. It may also cost an extra half million if the planet is of a particularly dangerous atmosphere. This cost can be paid by either the individual or, if built for faction purposes, faction credits. The user does not need any NPC for this task.&lt;br /&gt;
&lt;br /&gt;
Alternatively the user may opt to make the city a hidden city. Hidden cities do not appear on planetary maps and are not visible from above unless a character is in the atmosphere directly above.&lt;br /&gt;
&lt;br /&gt;
Caution, if the city is empty for more than three months the city will be removed and the slabbing costs will not be returned.&lt;br /&gt;
&lt;br /&gt;
===Facility Construction Requirements===&lt;br /&gt;
&lt;br /&gt;
Once a city has been founded, the user is able to construct facilities. Before building though, it is adviseable to use the [http://www.swcombine.com/citydesigner/| Combine City Designer]. This will allow the user to plan out their city and identify if their design is valid, whether it will have sufficient power etc. The designer will also show the amount of materials required.&lt;br /&gt;
&lt;br /&gt;
Before a user can construct there are requirements, many of these the same as space stations such as the need for facility blueprints. Again various faction types have the ability to create such buildings. Otherwise the user still needs raw materials, credits, NPC builders as well as permissions from the city owner to build.&lt;br /&gt;
&lt;br /&gt;
Additional concerns:&lt;br /&gt;
* Validity - A facility has slightly different requirements in that it MUST have two completely free sides to build roads along them. Note that the edges of the city do not count as free space.&lt;br /&gt;
* Power - Once completed, a facility will require power to function. This can be provided from any Power Generators in the same city. Without power it cannot perform the majority of its functions.&lt;br /&gt;
&lt;br /&gt;
===Construction Process===&lt;br /&gt;
The resources to commence construction must be available in any ship or pre-existing facility in the city. Once again faction privileges are required to use faction resources.&lt;br /&gt;
&lt;br /&gt;
The user must have builder NPCs in their party and must enter the city. In order to start construction, the user must stand in a square adjacent to the planned facility. &lt;br /&gt;
&lt;br /&gt;
The user may then name the facility, select a type of facility and the ownership of the finished object. Note that some items MUST be owned by a faction, such as religious or defensive facilities. The user may select the orientation of the finished city, either horizontally or vertically.&lt;br /&gt;
&lt;br /&gt;
The next step will be to see how the city will appear with the finished building, which is demonstrated on the preview. The design may also be changed by the user to suit the planets environment or design, finally the number of builders can be assigned to the project. The maximum number of builders which can be assigned is 10, with more reducing the time slightly as well as the Management skill. It is possible to start construction with a number of Builders and later add more Builders (within the maximum 10 NPCs per facility limit).&lt;br /&gt;
&lt;br /&gt;
Once the project has been started the user is free to move somewhere else and allow the NPC to work. Once completed the builder and manager will receive experience points.&lt;br /&gt;
&lt;br /&gt;
===Pausing/Aborting Construction===&lt;br /&gt;
Construction work can be halted on a project by removing NPCs from the project. Most commonly this happens when an NPC is arrested. If the number of active NPCs reaches zero, production stops. NPCs can then be re added if necessary. Construction can also be halted through facility management options.&lt;br /&gt;
&lt;br /&gt;
Additionally it is possible to abort the production, materials may be returned to any ship, vehicle or suitable facility. As per before, resources returned equals the percentage left on the project minus 10 percent.&lt;br /&gt;
[[Category:Advanced Activities]]&lt;br /&gt;
[[Category:Game Features]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3775</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3775"/>
		<updated>2018-09-15T22:10:44Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Lists */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|floor || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ceil || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|log || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|exp || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|modulo || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|stochastic_round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|list-of-zeros ||number||Makes a list of &#039;&#039;number&#039;&#039; 0s|| || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|toDigits ||number base||Convert a positive whole &#039;&#039;number&#039;&#039; to its digit representation in &#039;&#039;base&#039;&#039;. If you pass a floating point &#039;&#039;number&#039;&#039;, it will be rounded down || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|digits-to-base ||list baselist ||Takes a &#039;&#039;list&#039;&#039; of digits and converts them to a base representation as provided in &#039;&#039;baselist&#039;&#039; || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|fromDigits ||digits base||List of &#039;&#039;digits&#039;&#039; in base &#039;&#039;base&#039;&#039; and converts to decimal || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-digits ||digits n-digits ||Takes a list of &#039;&#039;digits&#039;&#039; and normalises it to N-digits. Less than N-digits adds leading zeros || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| make-seq ||number (function n) ||Creates a list of integer &#039;&#039;number&#039;&#039;+1 terms using the passed &#039;&#039;function&#039;&#039;  of the termid. Function must take one integer as a parameter ||1. (make-seq 3 (lambda (n) (+ n 1)))&amp;lt;br /&amp;gt;2. (make-seq 2 (lambda (n) 1)) ||1. &#039;(4 3 2 1)&amp;lt;br /&amp;gt;2. &#039;(1 1 1) || (load &amp;quot;funlib&amp;quot;)   &lt;br /&gt;
|-&lt;br /&gt;
| find-matches-in ||val searchlist (matchfun?) || || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-pos-of-matches-in ||val searchlist (counter) (matchfun?) || || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| drop-first-n ||num list ||Removes first &#039;&#039;num&#039;&#039; elements of &#039;&#039;list&#039;&#039; || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-duplicates ||list ||Removes duplicates from one-dimensional list of atmos &#039;&#039;list&#039;&#039; || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| set-nth ||list nth val ||Returns &#039;&#039;list&#039;&#039; with the &#039;&#039;nth&#039;&#039; element replaced with &#039;&#039;val&#039;&#039; || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
| has-room-in-party || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(say &amp;quot;Hello World!&amp;quot;) ||&amp;quot;Hello World!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(describe &amp;quot;The droid beeps and burps.&amp;quot;) ||&#039;&#039;The droid beeps and burps.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.||(add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) ||say &amp;quot;Wow, I didn&#039;t know that!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||(add-action &amp;quot; exit the room.&amp;quot; room12) ||&#039;&#039;You exit the room.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3774</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3774"/>
		<updated>2018-09-15T20:27:09Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Arithmetic Operators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|floor || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ceil || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|log || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|exp || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|modulo || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|stochastic_round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|list-of-zeros ||number||Makes a list of &#039;&#039;number&#039;&#039; 0s|| || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|toDigits ||number base||Convert a positive whole &#039;&#039;number&#039;&#039; to its digit representation in &#039;&#039;base&#039;&#039;. If you pass a floating point &#039;&#039;number&#039;&#039;, it will be rounded down || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|digits-to-base ||list baselist ||Takes a &#039;&#039;list&#039;&#039; of digits and converts them to a base representation as provided in &#039;&#039;baselist&#039;&#039; || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|fromDigits ||digits base||List of &#039;&#039;digits&#039;&#039; in base &#039;&#039;base&#039;&#039; and converts to decimal || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-digits ||digits n-digits ||Takes a list of &#039;&#039;digits&#039;&#039; and normalises it to N-digits. Less than N-digits adds leading zeros || || ||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
| has-room-in-party || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(say &amp;quot;Hello World!&amp;quot;) ||&amp;quot;Hello World!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(describe &amp;quot;The droid beeps and burps.&amp;quot;) ||&#039;&#039;The droid beeps and burps.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.||(add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) ||say &amp;quot;Wow, I didn&#039;t know that!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||(add-action &amp;quot; exit the room.&amp;quot; room12) ||&#039;&#039;You exit the room.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3773</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3773"/>
		<updated>2018-09-15T19:40:44Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Others */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|floor || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ceil || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|log || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|exp || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|modulo || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|stochastic_round || || || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
| has-room-in-party || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(say &amp;quot;Hello World!&amp;quot;) ||&amp;quot;Hello World!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(describe &amp;quot;The droid beeps and burps.&amp;quot;) ||&#039;&#039;The droid beeps and burps.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.||(add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) ||say &amp;quot;Wow, I didn&#039;t know that!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||(add-action &amp;quot; exit the room.&amp;quot; room12) ||&#039;&#039;You exit the room.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Talk:SWC_LISP&amp;diff=3772</id>
		<title>Talk:SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Talk:SWC_LISP&amp;diff=3772"/>
		<updated>2018-09-15T18:51:21Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;same-time? and cmp-time do the same thing and are in the same library.&lt;br /&gt;
&lt;br /&gt;
rand-from-list Y16D1 and rand-from-list-unique are two different functions or the same?&lt;br /&gt;
&lt;br /&gt;
sublist-firstof or sublists-firstof?&lt;br /&gt;
&lt;br /&gt;
on Y18D5 get-entity alone is not present, there are several get-entity-somethingMore. Is it ok or is it missing?&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Talk:SWC_LISP&amp;diff=3771</id>
		<title>Talk:SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Talk:SWC_LISP&amp;diff=3771"/>
		<updated>2018-09-15T18:47:50Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;same-time? and cmp-time do the same thing and are in the same library.&lt;br /&gt;
&lt;br /&gt;
rand-from-list Y16D1 and rand-from-list-unique are two different functions or the same?&lt;br /&gt;
&lt;br /&gt;
sublist-firstof or sublists-firstof?&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3770</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3770"/>
		<updated>2018-09-15T18:42:24Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Arithmetic Operators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|floor || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ceil || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|log || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|exp || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|modulo || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|stochastic_round || || || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(say &amp;quot;Hello World!&amp;quot;) ||&amp;quot;Hello World!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(describe &amp;quot;The droid beeps and burps.&amp;quot;) ||&#039;&#039;The droid beeps and burps.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.||(add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) ||say &amp;quot;Wow, I didn&#039;t know that!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||(add-action &amp;quot; exit the room.&amp;quot; room12) ||&#039;&#039;You exit the room.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3769</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3769"/>
		<updated>2018-09-15T18:41:17Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Arithmetic Operators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|floor || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ceil || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|round || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|log || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|-exp || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|modulo || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|stochastic_round || || || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(say &amp;quot;Hello World!&amp;quot;) ||&amp;quot;Hello World!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(describe &amp;quot;The droid beeps and burps.&amp;quot;) ||&#039;&#039;The droid beeps and burps.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.||(add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) ||say &amp;quot;Wow, I didn&#039;t know that!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||(add-action &amp;quot; exit the room.&amp;quot; room12) ||&#039;&#039;You exit the room.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3768</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3768"/>
		<updated>2018-09-15T18:39:11Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Conversational Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(say &amp;quot;Hello World!&amp;quot;) ||&amp;quot;Hello World!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(describe &amp;quot;The droid beeps and burps.&amp;quot;) ||&#039;&#039;The droid beeps and burps.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.||(ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.||(add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) ||say &amp;quot;Wow, I didn&#039;t know that!&amp;quot; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||(add-action &amp;quot; exit the room.&amp;quot; room12) ||&#039;&#039;You exit the room.&#039;&#039; ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3767</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3767"/>
		<updated>2018-09-15T08:19:11Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Conversational Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
==Other Resources==&lt;br /&gt;
You can also check out:&lt;br /&gt;
http://racket-lang.org/ which is a version of LISP similar to SWC-Lisp and decent to practice with to get the basic idea of programming in LISP.&lt;br /&gt;
&lt;br /&gt;
There is also [http://lisp.plasticki.com/ LISP In Small Parts] which is a good simple overview and basic introduction to LISP&#039;s methodology of programming.  It primarily focuses on thinking about how to use the language, rather than memorizing the CLISP native functions (which won&#039;t help you in SWC-LISP).&lt;br /&gt;
&lt;br /&gt;
===Other Reading===&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Scripts Rules Page]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=66316&amp;amp;page=0 LISP Changelog Thread]&lt;br /&gt;
*[http://www.swcombine.com/forum/thread.php?thread=67116&amp;amp;post=774948#post774948 Public Script Modules List]&lt;br /&gt;
*[http://dev.swcombine.com/~selatos/scripting.pdf Original LISP Introduction PDF from Selatos]&lt;br /&gt;
*[https://docs.google.com/document/d/1yLxbBREmN59W6cu8hwbV2C39Qdi3M2t7F82AF4lBYx0/ Kay Dallben&#039;s Starter Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=Scripting&amp;diff=3766</id>
		<title>Scripting</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=Scripting&amp;diff=3766"/>
		<updated>2018-09-15T08:15:35Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Other Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The scripting language used by SWC is currently available for speeches of Custom NPCs and for interactions with items (e.g. egg incubator). &lt;br /&gt;
&lt;br /&gt;
The new language ([[SWC LISP]]) is a big step ahead from the old system. Here we want to list the major differences with the old system to ease the conversion from the old system to the new one.&lt;br /&gt;
&lt;br /&gt;
==Wildcards (OLD SWC Script Syntax)==&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! SWC Lisp&lt;br /&gt;
! Old Wildcard&lt;br /&gt;
! Description&lt;br /&gt;
! Example&lt;br /&gt;
! Default&lt;br /&gt;
! For Custom NPCs?&lt;br /&gt;
|-&lt;br /&gt;
|(get-name self) || %npc.name% || NPC&#039;s name || Joe Bloggs || N/A || Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-race self) || %npc.race% ||NPC&#039;s race ||Nautolan ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| (get-infofield self) ||%npc.infofield% ||NPC&#039;s infofield ||Master Carpenter ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-gender self) ||%npc.gender% ||NPC&#039;s gender ||Male ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-formal self) ||%npc.formal% ||NPC&#039;s formal greeting ||Sir/Ma&#039;am ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-ally? self) ||%npc.ally% ||is NPC IFF friendly? ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-enemy? self) ||%npc.enemy% ||is NPC IFF enemy? ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-neutral? self) ||%npc.neutral% ||is NPC IFF neutral? ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-unharmed? self) ||%npc.unharmed% ||is NPC unharmed? - requires (load &amp;quot;swclib&amp;quot;) ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-slightly-wounded? self) ||%npc.slightlywounded% ||is NPC slightly wounded?- requires (load &amp;quot;swclib&amp;quot;) ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-wounded? self) ||%npc.wounded% ||is NPC wounded?- requires (load &amp;quot;swclib&amp;quot;)||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-badly-wounded? self) ||%npc.badlywounded% ||is NPC badly wounded?- requires (load &amp;quot;swclib&amp;quot;) ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-name character) ||%character.name% ||Character&#039;s handle ||Selatos ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-race character) ||%character.race% ||Character&#039;s race ||Human ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| (get-infofield character) ||%character.infofield% ||Character&#039;s 1st infofield ||Emperor ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| (get-infofield2 character) ||%character.infofield2% ||Character&#039;s 2nd infofield ||1st Recon Division ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| (get-infofield3 character) ||%character.infofield3% ||Character&#039;s 3rd infofield ||2nd Expansionary Fleet ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-gender character) ||%character.gender% ||Character&#039;s gender ||Male ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-unharmed? character) ||%character.unharmed% ||is Character unharmed? - requires (load &amp;quot;swclib&amp;quot;)||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-slightly-wounded? character) ||%character.slightlywounded% ||is Character slightly wounded? - requires (load &amp;quot;swclib&amp;quot;)||N/A ||N/A ||]Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-wounded? character) ||%character.wounded% ||is Character wounded? - requires (load &amp;quot;swclib&amp;quot;)||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-badly-wounded? character) || %character.badlywounded% ||is Character badly wounded?- requires (load &amp;quot;swclib&amp;quot;) ||N/A ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-formal character) || %character.formal% ||Character&#039;s formal greeting ||Sir/Ma&#039;am ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-entity-faction character) || %character.faction% ||Character&#039;s current faction ||New Republic ||Freelance ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-owner? character) || %character.isowner% ||Is character the owner of the NPC ||Produces no output ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-manager? character) || %character.ismanager% ||Is character the manager of the NPC ||Produces no output ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-pilot? character)  || %character.issupervisor% ||Is character the owner of the NPC ||Produces no output ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-name (get-entity-faction character)) || %faction.name% ||Character&#039;s faction&#039;s name ||New Republic ||Empty string (if freelance) ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(is-freelancer? character) || n.a. ||is the character a freelancer? || || ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(faction-type (get-entity-faction character)) || %faction.type% ||Character&#039;s faction&#039;s type ||Mining ||Empty string (if freelance) ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(faction-leader (get-entity-faction character)) || %faction.leader% ||Character&#039;s faction&#039;s leaders name ||Ellias ||Empty String (if freelance) ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(faction-website (get-entity-faction character)) || %faction.website% ||Character&#039;s faction&#039;s leaders name ||http://swcombine.com (Link) ||Empty string (if freelance) ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| || %owner.name% ||Name of the NPC&#039;s owner ||Darkness ||Empty string if special owner (Market, None) ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| || %owner.entityType% ||Type of the NPC&#039;s owner ||Faction or Character ||Empty string if special owner (Market, None) ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| || %owner.infofield% ||Owner&#039;s 1st infofield ||Emperor ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| || %owner.infofield2% ||Owner&#039;s 2nd infofield ||1st Recon Division ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| || %owner.infofield3% ||Owner&#039;s 3rd infofield ||2nd Expansionary Fleet ||Empty String ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(city-name character) || %location.city% ||Current city name ||City 327 ||Unknown ||Yes*&lt;br /&gt;
|-&lt;br /&gt;
|(planet-name character) || %location.planet% ||Current planet name ||Glee Anselm ||Unknown ||Yes*&lt;br /&gt;
|-&lt;br /&gt;
|(system-name character) || %location.system% ||Current system name ||Danju ||Unknown ||Yes*&lt;br /&gt;
|-&lt;br /&gt;
|(sector-name character) || %location.sector% ||Current sector name ||Tapani ||Unknown ||Yes*&lt;br /&gt;
|-&lt;br /&gt;
| (get-destination entity) || %location.destination% ||Destination name ||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city) ||Unknown ||Yes*&lt;br /&gt;
|-&lt;br /&gt;
|(get-eta entity) || %location.eta% ||ETA for current travel ||3 days, 24 hours and 5 minutes ||Unknown ||Yes*&lt;br /&gt;
|-&lt;br /&gt;
|(is-traveling? character) || n.a. ||Checks if the character is traveling or not || || ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| (get-name (get-container self))|| %container.name% ||Current container name, e.g. the ship or vehicle standing in ||Tydirium ||Unknown ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-entity-type-name (get-container self)) || %container.type% ||Current container type, e.g. the ship or vehicle standing in ||Lambda Shuttle ||Unknown ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(get-type entity-object) || %container.entityType% ||Current container entity type, e.g. the ship, vehicle, city, planet, station ||Ship, Vehicle, City, Planet, Space Station ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
|(in-room? entity-object) || n.a. ||Checks if the entity is in any room at all, as opposed to outside on the surface || || ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| %cgt.year% ||Gets current CGT year ||12 ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| %cgt.day% ||Gets current CGT day ||183 ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||23 ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||59 ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||59 ||N/A ||Yes&lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| %time.ofday% ||Gets current phase of day ||Morning, Afternoon, Evening ||N/A ||Yes&lt;br /&gt;
|}&lt;br /&gt;
Entries with a &amp;quot;Yes&amp;quot; are available for custom NPCs. Entries with a &amp;quot;Yes*&amp;quot; may have some limitations on their use (e.g. they may not be available when the NPC cannot reliably determine the information without godmodding - for example location whilst in hyperspace).&lt;br /&gt;
&lt;br /&gt;
==Custom NPC Environment==&lt;br /&gt;
This is the latest posting of functions and constants available to Custom NPCs.  Some of these may not be synced to Main yet.  Some are also listed above in Wildcards.  Where possible, the syntax, required&amp;amp;optional parameters and example usage &amp;amp; evaluation are included.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! SWC Lisp           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Default eval&lt;br /&gt;
! Testing Status&lt;br /&gt;
|-&lt;br /&gt;
| self 	||	||	The object running the script (NPC, item...).	||	Test Tickle	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	character 	||		||	The character interacting with the object running the script.	||	Kay Dallben	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	evar 	|||	&#039;name defaultValue	||	This is a persistent variable in the context of self.  See Persistent Variables for usage notes.	||	special case	||	defaultValue	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	ovar 	||	&#039;name defaultValue	||	This is a persistent variable in the context of self &amp;amp; character.  See Persistent Variables for usage notes.	||	special case	||	defaultValue	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	svar 	||	&#039;name defaultValue	||	This is a persistent variable in the context of the current *session*.  Session is the interaction between a PC and a scripted entity.  See Persistent Variables for usage notes.	||	special case	||	defaultValue	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	#t	||		||	This is &amp;quot;True&amp;quot;	||	#t	||	#t	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	+ 	||	a b &amp;amp;d &amp;amp;e …	||	Basic addition function.  Takes at least 2 numbers.	||	a+b	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	-	||	a b &amp;amp;d &amp;amp;e …	||	Basic subtraction function.  Takes at least 2 numbers.   Evaluates as a - b - c - d … or a - (sum b…n)	||	a-b-c-d…	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	&amp;gt;	||	a b	||	Preposition. Answers: Is a Greater than b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	* 	||	a b	||	Basic multiplication function.  Takes at least 2 parameters.	||	a*b	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	/ 	||	a b	||	Basic division function.  Takes at least 2 parameters.	||	a/b	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	ge? 	||	a b	||	Preposition. Answers: Is a Greater than OR equal to b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	&amp;gt;= 	||	a b	||	Preposition. Answers: Is a Greater than OR equal to b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	le? 	||	a b	||	Preposition. Answers: Is a less than OR equal to b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	&amp;lt;= 	||	a b	||	Preposition. Answers: Is a less than OR equal to b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	gt? 	||	a b	||	Preposition. Answers: Is a Greater than b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|		||		||		||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	lt? 	||	a b	||	Preposition. Answers: Is a less than b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	&amp;lt; 	||	a b	||	Preposition. Answers: Is a less than b?	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	and 	||	a b &amp;amp;c…	||	Logical Operand.  #t if all its parameters are #t	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	or 	||	a b &amp;amp;c…	||	Logical Operand.  #t if any of its parameters are #t.  If it finds a #t, it will stop evaluating the rest of the parameters.	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	not 	||	a	||	Logical Operand. #t if a is #f	||	#t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	concat 	||	stringA &amp;amp;stringB	||	a concatenated string made up of the provided strings.	||	abc…	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	strlen 	||	string	||	number of characters in the provided string a	||	4	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	trim 	||	string &amp;amp;character_mask	||	removes:&amp;quot;\0&amp;quot; null &amp;quot;\t&amp;quot; tab &amp;quot;\n&amp;quot; new line &amp;quot;\x0B&amp;quot; vertical tabs &amp;quot;\r&amp;quot; carriage returns and &amp;quot; &amp;quot; spaces.  &amp;amp;character_mask can be used to trim only some of those.	||	sample string	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	substr 	||	string start &amp;amp;length	||	a string made of of the sequential characters within the provided string, beginning at the start character, and ending at &amp;amp;length, if provided. If &amp;amp;length is not provided, the rest of the string is provided.	||	ample string	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	stripos 	||	stringA searchFor &amp;amp;offset	||	the start position of searchFor if contained in stringA, beginning the search at &amp;amp;offset.	||	(stripos &amp;quot;sample string&amp;quot; &amp;quot;mp&amp;quot;) -&amp;gt; 2	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	length 	||	listA	||	number of elements in listA	||	(length (list &#039;a &#039;b &#039;c &#039;d 4)) -&amp;gt; 5	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	reverse 	||	listA	||	a list of the reversed elements of listA	||	(reverse (list &#039;a &#039;b &#039;c)) -&amp;gt; (c b a)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	sublist 	||	listA offset &amp;amp;length &amp;amp;preserve_keys	||	a list of the elements of listA beginning at offset and continuing to the end of listA OR to &amp;amp;length elements if provided.  &amp;amp;preserve_keys should be #t or nil.	NOTE:  sublist will (perhaps unexpectedly) return strings from a list of symbols.  Be aware when using it to get a sublist involving symbols.  This is important because (eq? &#039;a &amp;quot;a&amp;quot;) -&amp;gt; #f||	(sublist (list &amp;quot;a&amp;quot; &#039;b &amp;quot;c&amp;quot;) 0 2) -&amp;gt; `(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot;)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	sort 	||	listA	||	a list of sorted elements of listA.  Sort is alphanumeric.	||	(sort `(b c a)) -&amp;gt; (a b c)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	nth-of	||	listA n	||	the element of listA at position n.  0 is the first element	NOTE:  nth-of will (perhaps unexpectedly) return strings from a list of symbols.  Be aware when using it to get nth-of from a list involving symbols.  This is important because (eq? &#039;a &amp;quot;a&amp;quot;) -&amp;gt; #f ||	(nth-of `(a b c) 1) -&amp;gt; &amp;quot;b&amp;quot;	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	rand 	||	&amp;amp;min &amp;amp;max	||	random number between &amp;amp;min &amp;amp;max. If not provided &amp;amp;min is 0 and &amp;amp;max is ?.   See Randomization topic.	||	(rand 0 5) -&amp;gt; 2	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	rand-from-list	||	listA	||	random element from listA	NOTE:  Be aware that rand-from-list will not return any Symbol if you give it a list of symbols.  It will return a STRING if the random element it finds is a symbol.  This is important because (eq? &#039;a &amp;quot;a&amp;quot;) -&amp;gt; #f||	(rand-from-list `(a b c)) -&amp;gt; &amp;quot;b&amp;quot; or &amp;quot;a&amp;quot; or &amp;quot;c&amp;quot;	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-entity-type-id	||	name	||	Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}	||	(get-entity-type-id &#039;Planet) -&amp;gt; 	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-type-type	||	typeID entityType	||	returns a full TYPE 	|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-creature-type	||	typeID	||	returns the type of Creature	|| (get-creature-type 175) returns the type for an Eye-Snatcher		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-droid-type	||	typeID	||  returns the type of Droid		||	(get-droid-type 14) gets the droid type obj for Pit Droids	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-item-type	||	typeID	|| returns the type of Item	||	(get-item-type 298) returns the type of a Focusing Crystal	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-npc-type	||	typeID	||returns the type of NPC	|| (get-npc-type NUM) returns the type for a NPC of typeid NUM	||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	get-type-of	||	entity	||	returns the type object for the entity	||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)		||		||&lt;br /&gt;
|-											&lt;br /&gt;
|	get-npc-owner	||		||	returns the &amp;quot;NPC Owner&amp;quot; object	||		||		||	useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|	get-hostile-owner	||		||returns the &amp;quot;Hostile Owner&amp;quot; object		||		||		||  ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|	style=&amp;quot;white-space: nowrap;&amp;quot;|get-market-owner	||		||	returns the &amp;quot;Market Owner&amp;quot; object	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-character	||	name	||	entity-object for character &amp;quot;name&amp;quot;	||	(get-character &amp;quot;Kay Dallben&amp;quot;)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-faction	||	name	||	faction-object for faction &amp;quot;name&amp;quot;	||	(get-faction &amp;quot;Darkness&amp;quot;)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-npc	||	id	||	npc-object for NPC with ID id	||	(get-npc 155408)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-quest	||	id	||	quest-object for quest with ID id	||	(get-quest 4408)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-item	||	id	||	item-object for item with ID id	||	(get-item 481099)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-ship	||	id	||	ship-object for ship with ID id	||	(get-ship 448088)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-vehicle	||	id	||	vehicle-object for vehicle with ID id	||	(get-vehicle 46846816)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-room	||	id	||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.	||	(get-room 4478)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-id	||	entity	||	ID for the entity	||	(get-id (get-npc 100)) -&amp;gt; 100	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-name	||	entity	||	name of the object	||	(get-name (get-vehicle 1150488))	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-formal	||	entity	||	Sir if gender is male, Maam if gender is female.	||	(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) -&amp;gt; Sir	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-infofield	||	entity	||	string of the first infofield of entity	||	(get-infofield (get-npc 111548))	||	empty string	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-infofield2	||	pc-entity	||	string of the 2nd infofield of entity	||	(get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;))	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-infofield3	||	pc-entity	||	string of the 3rd infofield of entity	||	(get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;))	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-race	||	entity	||	string representing race of the entity	||	(get-race self)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-gender	||	entity	||	string of the gender of entity	||	(get-gender self) -&amp;gt;Male	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-hp-status-text	||	entity	||	string of the hp-status-text {unharmed, slightly-wounded, etc.}	||	(get-hp-status-text self)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-ally?	||	test &amp;amp;source	||	Preposition. Answers: is test an ally to &amp;amp;source (default: self)	||	(is-ally? (get-npc 445158))	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-neutral?	||	test &amp;amp;source	||	Preposition. Answers: is test neutral to &amp;amp;source (default: self)	||	(is-neutral? (get-npc 4408))	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-enemy?	||	test &amp;amp;source	||	Preposition. Answers is test an enemy to &amp;amp;source (default: self)	||	(is-enemy? (get-npc 4408))	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-freelancer?	||	test-character	||	Preposition. Answers: is test-character a freelancer?	||	(is-freelancer? (get-character &amp;quot;Kay Dallben&amp;quot;)) -&amp;gt; #T	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	faction-owned?	||	entity	||	Preposition.  Answers: is the entity owned by a faction?	||	(faction-owned? self)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-entity-faction	||	entity	||	faction-object for the faction entity belongs to?	||		||	n/a	||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	faction-type	||	faction-entity	||	type of faction	||	String?	||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	faction-leader	||	faction-entity	||	leader of faction	||	String?	||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	faction-website	||	faction-entity	||	website of faction	||	String?	||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	get-owner	||	entity	||	owner object of entity	||	(get-owner self)-&amp;gt; Kay Dallben	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-type	||	entity	||	type of entity	||	type ID or string?	||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	get-entity-type-name	||	entity	||	name of type of entity	||	string?	||	 	||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	is-owner?	||		||	Preposition. Answers: is character the owner of self	||	(is-owner?) -&amp;gt; #t	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-commander?	||		||	Preposition. Answers: is character the commander of self	||	(is-commander?)	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-manager? 	||		||	Preposition. Answers: is character the manager of self	||	(is-manager?)	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-pilot?	||		||	Preposition. Answers: is character the pilot of self	||	(is-pilot?)	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-supervisor?	||		||	Preposition. Answers: is character the supervisor of self	||	(is-supervisor?)	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	in-room?	||	entity	||	Preposition. Answers: is entity in the same room as self?	||	(in-room? (get-NPC 4808))	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	is-traveling?	||	entity	||	Preposition. Answers: is entity travelling?	||	(is-traveling? (get-ship 3334))	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-container	||	entity	||	entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	get-destination	||	entity	||	destination of entity	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	get-eta	||	entity	||	eta of arrival of entity to its destination	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	get-location	||	entity	||	String of location (currently including hyperlinks) if viewable without godmoding.	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	city-name	||	entity	||	Name of the city containing entity?	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	planet-name	||	entity	||	name of the planet containing entity?	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	system-name	||	entity	||	name of the system containing entity?	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	sector-name	||	entity	||	name of the sector containing entity?	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	send-message	||	sender receiver message &amp;amp;subject	||	Output:  Sends a DM to receiver, from sender with message and subject &amp;amp;subject.  Receiver and Sender must be any PC-object and self	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	flash	||style=&amp;quot;white-space: nowrap;&amp;quot;|	type{&#039;green &#039;red &#039;blue &#039;good &#039;bad &#039;info} message	||	Puts a small coloured bar with the message on the screen of character.	||	(flash &#039;green &amp;quot;You did it!&amp;quot;)	||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	null	||		||	null	||		||	null	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	empty	||		||	Use for the empty list `()	||		||	null	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	nil	||		||	aka #f	||		||	null	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	cgt-year	||		||	current year	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	cgt-day	||		||	current day	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	cgt-hour	||		||	current hour	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	cgt-minute	||		||	current minute	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	timeofday	||		||	string of timeofday Morning Afternoon Evening Night	||		||	n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|	teleport-to-room	||	entities container room	||	?	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	leave-room	||	character direction	||	?	||		||		||	needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|	say	||	message &amp;amp;close	||	Output: NPC &amp;quot;says&amp;quot; message.  &amp;amp;close is boolean.  If true, this will start a new paragraph.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	describe	||	message &amp;amp;close	||	Output: NPC &amp;quot;describes&amp;quot; message.  &amp;amp;close is boolean.  If true, this will start a new paragraph.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	ooc	||	message &amp;amp;close	||	Output: NPC &amp;quot;oocs&amp;quot; message.  &amp;amp;close is boolean.  If true, this will start a new paragraph.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	say-c	||	message	||	Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	describe-c	||	message	||	Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	ooc-c	||	message	||	Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	add-response	||	message callback	||	Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	add-action	||	message callback	||	Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	add-text	||	message callback	||	Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|	add-input	||	not implemented	||	Input: creates a text box for the user to type something in.  In progress.	||		||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
The biggest differences are:&lt;br /&gt;
* the &amp;quot;=&amp;quot; is no longer used to do comparisons;&lt;br /&gt;
&lt;br /&gt;
Old system:&lt;br /&gt;
&amp;lt;pre&amp;gt;!if character.race=Gungan! Don&#039;t slip over!&lt;br /&gt;
!if character.race=Human! Humans are the best!&lt;br /&gt;
!ifnot character.race=Human! Alien scum!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
New system:&lt;br /&gt;
&amp;lt;pre&amp;gt;(cond &lt;br /&gt;
  [(eq? (get-race character) &amp;quot;Gungan&amp;quot;) (say &amp;quot;Don&#039;t slip over!&amp;quot;) (say &amp;quot;Alien scum!&amp;quot;)]&lt;br /&gt;
  [(eq? (get-race character) &amp;quot;Human&amp;quot;) (say &amp;quot;Humans are the best!&amp;quot;)]&lt;br /&gt;
  [#t (say &amp;quot;Alien scum!&amp;quot;)])&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR&lt;br /&gt;
&amp;lt;pre&amp;gt;(cond[(eq? (get-race character) &amp;quot;Gungan&amp;quot;) (say &amp;quot;Don&#039;t slip over!&amp;quot;) (say &amp;quot;Alien scum!&amp;quot;)])&lt;br /&gt;
(cond [(is-owner?) (say &amp;quot;Oh, uh.  Welcome Boss!&amp;quot;)]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* with &#039;&#039;cond&#039;&#039; statement, the conditions are tested sequentially until one of them is true, and then it evaluates it and stops testing. This is much like an If...ElseIf...ElseIf. This means that if you have two statements, you must put them inside the same condition.  If you have multiple alternate conditions (ElseIfs) to test, you must ensure that at least one of them evaluates true &#039;&#039;&#039;every time&#039;&#039;&#039;.  Commonly this is done with a final [#t] condition.  &lt;br /&gt;
* You can use &#039;&#039;cond&#039;&#039; statements as a simple IF by only including one test.&lt;br /&gt;
&lt;br /&gt;
Old system:&lt;br /&gt;
&amp;lt;pre&amp;gt;Responses:&lt;br /&gt;
!if character.race=Baragwin! !if character.gender=Female! Excuse me, how do you know I am a female? -&amp;gt; Baragwin female&lt;br /&gt;
!if character.race=Baragwin! !if character.gender=Male! Excuse me, how do you know I am a male? -&amp;gt; Baragwin male&lt;br /&gt;
!ifnot character.race=Baragwin! I&#039;d like to have more information on the museum. -&amp;gt; info&lt;br /&gt;
!ifnot character.race=Baragwin! What can I do here? -&amp;gt; what to do&lt;br /&gt;
!ifnot character.race=Baragwin! Do I need to pay an entrance fee? -&amp;gt; fee&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
New system:  NOTE: Technically, the last ElseIf can just be #t rather than (not (eq? (get-race character) &amp;quot;Baragwin&amp;quot;)).  This is because the first two checks cover all cases where the character could be a Baragwin (female or male).&lt;br /&gt;
&amp;lt;pre&amp;gt;  (cond &lt;br /&gt;
    [(and (eq? (get-race character) &amp;quot;Baragwin&amp;quot;) (eq? (get-gender character) &amp;quot;Female&amp;quot;)) &lt;br /&gt;
      (add-response &amp;quot;Excuse me, how do you know I am a female?&amp;quot; Baragwin-female)]&lt;br /&gt;
    [(and (eq? (get-race character) &amp;quot;Baragwin&amp;quot;) (eq? (get-gender character) &amp;quot;Male&amp;quot;)) &lt;br /&gt;
      (add-response &amp;quot;Excuse me, how do you know I am a male?&amp;quot; Baragwin-male)]&lt;br /&gt;
    [(not (eq? (get-race character) &amp;quot;Baragwin&amp;quot;))&lt;br /&gt;
      (add-response &amp;quot;I&#039;d like to have more information on the museum.&amp;quot; info) &lt;br /&gt;
      (add-response &amp;quot;What can I do here?&amp;quot; what-to-do)&lt;br /&gt;
      (add-response &amp;quot;Do I need to pay an entrance fee?&amp;quot; fee)][#t])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note 2:  Also, since the two add-responses in the first cases are so similar, you can combine them and toss the M/F determination, if important, into the Baragwin defun next conversation step.&lt;br /&gt;
&amp;lt;pre&amp;gt;(cond &lt;br /&gt;
    [(eq? (get-race character) &amp;quot;Baragwin&amp;quot;) (add-response (concat &amp;quot;Excuse me, how do you know I am a &amp;quot; (get-gender character) &amp;quot;?&amp;quot;) Baragwin-female)]&lt;br /&gt;
    [#t&lt;br /&gt;
      (add-response &amp;quot;I&#039;d like to have more information on the museum.&amp;quot; info) &lt;br /&gt;
      (add-response &amp;quot;What can I do here?&amp;quot; what-to-do)&lt;br /&gt;
      (add-response &amp;quot;Do I need to pay an entrance fee?&amp;quot; fee)])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Variable Examples==&lt;br /&gt;
The following little script shows how to use session variables.&lt;br /&gt;
 (defvar hp-session-var (svar &#039;hp 10))&lt;br /&gt;
 (defvar str-session-var (svar &#039;str 5))&lt;br /&gt;
 (defvar rand-val (svar &#039;rand (rand 1 5)))&lt;br /&gt;
 (defvar setted-rand-val (svar &#039;setted-rand-val (rand 11 15)))&lt;br /&gt;
&lt;br /&gt;
 (defun (incr-hp val)&lt;br /&gt;
   (set-var! hp-session-var (+ hp-session-var val)))&lt;br /&gt;
&lt;br /&gt;
 (defun (incr-str val)&lt;br /&gt;
   (set-var! str-session-var (+ str-session-var val)))&lt;br /&gt;
&lt;br /&gt;
 (defun start&lt;br /&gt;
   (ooc (concat &amp;quot;Your HP is: &amp;quot; hp-session-var &amp;quot;. Your Str is: &amp;quot; str-session-var &amp;quot;. The rand-val is: &amp;quot; rand-val &amp;quot;. The &#039;setted-rand-val&#039;  is: &amp;quot; setted-rand-val &amp;quot;.&amp;quot; ) )&lt;br /&gt;
   (add-action &amp;quot;Set the setted-rand-val to store the rand between 6 and 10 for the whole session.&amp;quot; set-rand-val)&lt;br /&gt;
   (add-action &amp;quot;Add 2 HP&amp;quot; add-2hp)&lt;br /&gt;
   (add-action &amp;quot;Sub 4 HP&amp;quot; sub-4hp)&lt;br /&gt;
   (add-action &amp;quot;Add Str to HP&amp;quot; add-str-to-hp)&lt;br /&gt;
   (add-action &amp;quot;Add Rand 1 - 9 to Str&amp;quot; add-rand-to-str))&lt;br /&gt;
&lt;br /&gt;
 (defun add-2hp (incr-hp 2) (start))&lt;br /&gt;
&lt;br /&gt;
 (defun sub-4hp (incr-hp -4) (start))&lt;br /&gt;
&lt;br /&gt;
 (defun add-str-to-hp (incr-hp str-session-var) (start))&lt;br /&gt;
&lt;br /&gt;
 (defun set-rand-val&lt;br /&gt;
   (set-var! setted-rand-val (rand 6 10)) (start))&lt;br /&gt;
&lt;br /&gt;
 (defun add-rand-to-str (incr-str (rand 1 9)) (start))&lt;br /&gt;
&lt;br /&gt;
==Basic Custom NPC Interaction==&lt;br /&gt;
===Conversation===&lt;br /&gt;
{|&lt;br /&gt;
! Syntax&lt;br /&gt;
! Example of Use&lt;br /&gt;
! Actual Output&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;say&#039;&#039;&#039; string || (say &amp;quot;Hello World!&amp;quot;) || &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;describe&#039;&#039;&#039; string || (describe &amp;quot;The droid beeps and burps.&amp;quot;) || &#039;&#039;The droid beeps and burps.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|ooc string || (ooc &amp;quot;Now go to the mentioned location and talk to the NPC there.&amp;quot;) ||&lt;br /&gt;
|-&lt;br /&gt;
|add-response string next-function) || (add-response &amp;quot;Wow, I didn&#039;t know that!&amp;quot; explainmore) || say &amp;quot;Wow, I didn&#039;t know that!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|add-action string next-function || (add-action &amp;quot; exit the room.&amp;quot; room12) || &#039;&#039;You exit the room.&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==LISP Language Functions==&lt;br /&gt;
These are some general CLISP functions that are useable in SWC-LISP, and not necessarily included in the dbg-env tables above.&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! SWC Lisp           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Default eval (if applicable)&lt;br /&gt;
|-&lt;br /&gt;
|car || &#039;&#039;list&#039;&#039; || The first element of the list.  Aka &#039;First&#039; || (car `(1 2 3)) -&amp;gt; 1 || n/a&lt;br /&gt;
|-&lt;br /&gt;
|cdr || &#039;&#039;list&#039;&#039; || A list of all the elements of the list, in order, except the first. AKA &#039;Rest&#039; || (cdr `(1 2 3)) -&amp;gt; (2 3) || n/a&lt;br /&gt;
|-&lt;br /&gt;
|cons || &#039;&#039;expr1&#039;&#039; &#039;&#039;expr2&#039;&#039; || constructs a list from the two expressions provided. Typically used to prepend an element onto a list (push), using (cons atom1 list). Careful when consing atoms only.  That creates a &amp;quot;dotted list&amp;quot; which can result in unexpected behaviour.  If you want to make a list with just one element, either use (list atom) or `(atom), or (cons atom `()) aka (cons atom empty). || (cons 1 `(2 3)) -&amp;gt; (1 2 3) || n/a&lt;br /&gt;
|-&lt;br /&gt;
|list || &#039;&#039;expr1&#039;&#039; &#039;&#039;expr2&#039;&#039; ... &#039;&#039;exprN&#039;&#039; || Constructs a list out of atoms or lists, or I guess symbols. || (list 1 2 `(3)) -&amp;gt; (1 2 (3)) || n/a&lt;br /&gt;
|-&lt;br /&gt;
|empty? || &#039;&#039;list&#039;&#039; || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. || style=&amp;quot;white-space: nowrap;&amp;quot;|(empty? `()) -&amp;gt; #t (empty? `(1)) -&amp;gt; #f || n/a&lt;br /&gt;
|-&lt;br /&gt;
|eq? || &#039;&#039;atom1&#039;&#039; &#039;&#039;atom2&#039;&#039; || Preposition: Are the two provided atoms equal?  Unsure exactly which &amp;quot;eq&amp;quot; from LISP documentation this really is.  Does not work for Lists. || (eq? 1 1) -&amp;gt; #t (eq? 1 2) -&amp;gt; #f ... || n/a&lt;br /&gt;
|-&lt;br /&gt;
|nth-of || &#039;&#039;list&#039;&#039; &#039;&#039;index#&#039;&#039; || aka &amp;quot;nth&amp;quot;.  Returns the nth element of list.  Note: 0 is the first element. || (nth-of `(1 2 3) 0) -&amp;gt; 1; &lt;br /&gt;
&lt;br /&gt;
(nth-of `(1 2 (3 4)) 2 -&amp;gt; (3 4) &lt;br /&gt;
|| n/a &lt;br /&gt;
|-&lt;br /&gt;
|floor&lt;br /&gt;
|-&lt;br /&gt;
|ceil&lt;br /&gt;
|-&lt;br /&gt;
|round&lt;br /&gt;
|-&lt;br /&gt;
|log&lt;br /&gt;
|-&lt;br /&gt;
|-exp&lt;br /&gt;
|-&lt;br /&gt;
|modulo&lt;br /&gt;
|-&lt;br /&gt;
|stochastic_round&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==How to Pass Parameters in Functions==&lt;br /&gt;
Below you can see a simple example of creating a function accepting two parameters, and passing them.&lt;br /&gt;
&lt;br /&gt;
 (defun (myfun a b)&lt;br /&gt;
 (ooc (concat &amp;quot;I do something with &amp;quot; a &amp;quot;, then I do something with &amp;quot; b)))&lt;br /&gt;
&lt;br /&gt;
 (defun start&lt;br /&gt;
 (myfun &amp;quot;turkey&amp;quot; &amp;quot;salami&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
Another example with numbers. This calculate the absolute of a number.&lt;br /&gt;
 (defun (abs x) &lt;br /&gt;
   (cond&lt;br /&gt;
    [(lt? x 0) (* x -1)]&lt;br /&gt;
    [#t x]))&lt;br /&gt;
&lt;br /&gt;
 (defun start&lt;br /&gt;
   (say (concat &amp;quot;The absolute of 20 + -44 is &amp;quot; (abs (+ 20 -44)))))&lt;br /&gt;
&lt;br /&gt;
[[Category:Features]]&lt;br /&gt;
[[Category:Advanced Activities]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3765</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3765"/>
		<updated>2018-09-15T08:14:17Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Conversational Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
*[http://www.swcombine.com/rules/?Scripts Rules page on lisp]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP/Debugging_and_Errors&amp;diff=3764</id>
		<title>SWC LISP/Debugging and Errors</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP/Debugging_and_Errors&amp;diff=3764"/>
		<updated>2018-09-14T23:24:28Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Debugging Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Debugging Functions==&lt;br /&gt;
* &amp;lt;code&amp;gt;dbg-break&amp;lt;/code&amp;gt; triggers an exception (ignoring the rest of the script) and print supplied values, for example &amp;lt;code&amp;gt;(dbg-break self character (+ 1 2))&amp;lt;/code&amp;gt; will display info about the current entity, current character, and the number 3&lt;br /&gt;
** note that if you put &amp;lt;code&amp;gt;(dbg-break)&amp;lt;/code&amp;gt; in the global scope (a line on its own), it&#039;ll block the whole script at startup. Instead, you must use it inside another function, in the point where you want the script to stop.&lt;br /&gt;
* &amp;lt;code&amp;gt;dbg-pp&amp;lt;/code&amp;gt; prints values for debugging without triggering an exception (script continues), using the same semantics as &amp;lt;code&amp;gt;dbg-break&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dbg-env&amp;lt;/code&amp;gt; dumps the entire symbol table (very large) and can be used to get basic information about the API to help with missing documentation&lt;br /&gt;
* &amp;lt;code&amp;gt;dbg-rp&amp;lt;/code&amp;gt; provides low-level view of data structures&lt;br /&gt;
&lt;br /&gt;
==Understanding Errors==&lt;br /&gt;
Most often, if you get an error it is a problem of parenthesis. When you save the script, the parser checks only for matching parenthesis; however, if the total of open parenthesis matches the total of closed parenthesis, the parser reports no errors on saving.&lt;br /&gt;
&lt;br /&gt;
===Symbol [name] is not defined!===&lt;br /&gt;
If you get this error while the script runs, it could mean that there are misplaced parenthesis. In this case, go through your script placing your cursor on the end parenthesis to see if everything is ok.&lt;br /&gt;
&lt;br /&gt;
If the error is not due to misplaced parenthesis, check that the name is not mispelt. If ok, check that the call to the function comes before the function called.&lt;br /&gt;
&lt;br /&gt;
===Symbol -&amp;gt; is not defined!===&lt;br /&gt;
It is the easiest to fix. You&#039;ve just written a &amp;quot;-&amp;gt;&amp;quot; in an add-response function, between the end of text and the name of the function to go to. The old system used that symbol, but the new system need not that. Just remove that &amp;quot;-&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A second case is if you&#039;ve added a parameter to the describe function different from close. Example, the old &#039;left alignment keyword, now invalid.&lt;br /&gt;
&lt;br /&gt;
===Symbol is undefined and cannot be evaluated===&lt;br /&gt;
You&#039;ve probably forgotten to specify where to go after an add-response text. Simply add the name of the function to continue with.&lt;br /&gt;
&lt;br /&gt;
Mind the parenthesis if you have a concat function in add-response or other function with parameters. Example, this code is right:&lt;br /&gt;
&lt;br /&gt;
 (defun start&lt;br /&gt;
  (say &amp;quot;Hello, how may I help you?&amp;quot;)&lt;br /&gt;
  (cond&lt;br /&gt;
    [(eq? (get-race character) &amp;quot;Kuati&amp;quot;) &lt;br /&gt;
    	(add-response &amp;quot;Excuse me, your dress is very elegant. May I know what caste are you?&amp;quot; caste01)]&lt;br /&gt;
    [(not (eq? (get-race character) &amp;quot;Kuati&amp;quot;)) &lt;br /&gt;
    	(add-response (concat &amp;quot;I see you are a &amp;quot; (get-infofield self) &amp;quot;. What do you do, exactly?&amp;quot;) do01) &lt;br /&gt;
    	(add-response &amp;quot;Are you a real expert on ships?&amp;quot; expert01)&lt;br /&gt;
    	(add-response &amp;quot;Very kind of you, but I am just browsing. No need for help.&amp;quot; end01)]))&lt;br /&gt;
&lt;br /&gt;
but if you write the add-response with the concat function as &lt;br /&gt;
 (add-response (concat &amp;quot;I see you are a &amp;quot; (get-infofield self) &amp;quot;. What do you do, exactly?&amp;quot; do01))&lt;br /&gt;
&lt;br /&gt;
you get this type of error, because the closing parenthesis of the concat function must go after the string end and before the next-function-name parameter.&lt;br /&gt;
&lt;br /&gt;
====Symbol set-var is undefined and cannot be evaluated====&lt;br /&gt;
The correct syntax is set-var! (with the &#039;bang&#039;) and not set-var or setvar. Check your syntax.&lt;br /&gt;
&lt;br /&gt;
===Invalid speech option selected===&lt;br /&gt;
This is a generic error, meaning that any thing wrong in the next-function-name called by the user click may cause this error. A syntax error, a logic error... Below you find some examples. Note that this error appears when you try to click on an answer, therefore you should look for the function called by that answer.  You can use the (dbg-xx) functions in the functions called by the add-action/add-response/add-text to check your code for unexpected evaluation results.&lt;br /&gt;
&lt;br /&gt;
* If you&#039;re trying to concatenate a text with a describe, you&#039;ll get this error. Example:&amp;lt;br /&amp;gt;&lt;br /&gt;
 (say (concat &amp;quot;Well, another protocol droid you can see here is the SP-4. It is defined as an analysis droid and it uses the same chassis and many parts assembled in the cheaper PK-series worker droid. You cannot say that it is made to resemble its owner...&amp;quot; (describe &amp;quot;winks&amp;quot;)))&lt;br /&gt;
&lt;br /&gt;
The solution is to put the describe in a single line, all alone, and remove the concat in the say function.  `concat` only assembles several strings into one string.  `describe` is a function that does not evaluate to a single string, and so concat cannot make proper use of it.&lt;br /&gt;
&lt;br /&gt;
* A conditional statement with a wrong use of keywords:&lt;br /&gt;
  (eq? (get-entity-faction character) &amp;quot;Galactic Empire&amp;quot;)&lt;br /&gt;
is bugged;&lt;br /&gt;
  (eq? (get-name (get-entity-faction character)) &amp;quot;Galactic Empire&amp;quot;)&lt;br /&gt;
is correct.&lt;br /&gt;
&lt;br /&gt;
* Adding a missing [#t] to a conditional statement.&lt;br /&gt;
&lt;br /&gt;
===Attempted to evaluate a literal value or a null: &amp;quot;somestring&amp;quot;===&lt;br /&gt;
One possible case is that you are trying to call a function that needs a parameter from inside an add-response function. As of Y19D270, add-response can only call simple functions, without parameters.&amp;lt;br /&amp;gt;&lt;br /&gt;
In order to solve this problem, you should make an intermediate function. Example:&lt;br /&gt;
 (add-response &amp;quot;Please forward this parameter.&amp;quot; (intermediate-fun))&lt;br /&gt;
 (defun intermediate-fun (get-parameter &amp;quot;Here is the parameter&amp;quot;))&lt;br /&gt;
 (defun (get-parameter thisparameter)&lt;br /&gt;
 code code code)&lt;br /&gt;
&lt;br /&gt;
===Not enough arguments supplied in function call===&lt;br /&gt;
You have called a function that is expecting one or more parameters, but you have not specified any parameter.&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: add the parameters needed.&lt;br /&gt;
&lt;br /&gt;
===`set-var!` can only be called on *vars===&lt;br /&gt;
wip&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3763</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3763"/>
		<updated>2018-09-14T23:23:19Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
; (defun (foo bar (baz 1))&amp;lt;br /&amp;gt;   code code code) : declares a function named &#039;&#039;foo&#039;&#039; with a required argument &#039;&#039;bar&#039;&#039; and an optional argument &#039;&#039;baz&#039;&#039; that defaults to 1 if not given.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3762</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3762"/>
		<updated>2018-09-14T23:20:25Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Definitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; hook : this allow asynchronous notification of events to different areas of code or LISP scripts (primarily in support of scripting responses to in-game events)&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3761</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3761"/>
		<updated>2018-09-14T23:17:50Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Others */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events (combat, travel, asset transfer, etc. for use with quests) and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3760</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3760"/>
		<updated>2018-09-14T23:16:20Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Conversational Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean (defaults to true).  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting, without inserting linebreaks ||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters. Useful for multi-step decision trees, options menus, etc. that may not need to print something from the player&#039;s perspective || || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|clear-window|| ||Clears the current conversation log window before rendering the information from the current interaction || || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3759</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3759"/>
		<updated>2018-09-14T23:09:54Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Conditional Statements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| create-hook|| ||Creates a hook that listen to specific in-game events and then call a lisp function || || ||&lt;br /&gt;
|-&lt;br /&gt;
| get-hook || ||Retrieves a hook by ID || || ||&lt;br /&gt;
|-&lt;br /&gt;
| delete-hook || ||Deletes an existing hook || || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conversational Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|say||message &amp;amp;close||Output: NPC &amp;quot;says&amp;quot; message.  &#039;&#039;&amp;amp;close&#039;&#039; is boolean.  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe||message &amp;amp;close||Output: NPC &amp;quot;describes&amp;quot; message.  &amp;amp;close is boolean.  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc||message &amp;amp;close||Output: NPC &amp;quot;oocs&amp;quot; message.  &amp;amp;close is boolean.  If true, this will start a new paragraph.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|say-c||message	||Output: NPC &amp;quot;says&amp;quot; message, continuing previous paragraph and using that formatting||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|describe-c||message||Output: NPC &amp;quot;describes&amp;quot; message, continuing previous paragraph and using that formatting|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|ooc-c||message	||Output: NPC &amp;quot;oocs&amp;quot; message, continuing previous paragraph and using that formatting||	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-response||message callback	||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You say &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-action||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will a) display &amp;quot;You &amp;quot; message; and b) run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-text||message callback||Input: Adds a clickable option labelled &#039;message&#039; that will not display anything and simply run the callback function.  NOTE: Currently the callback functions may not have any parameters.	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|add-input||not implemented||Input: creates a text box for the user to type something in.  In progress.	|| || ||	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3758</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3758"/>
		<updated>2018-09-14T22:58:18Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Lists */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sort || ||Numerical sorting of lists  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| length || ||Returns the length of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| nth-of || ||Returns the nth element of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| sublist || ||Returns some number of elements from the middle of a list  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
| reverse || ||Reverses the elements in a list (at the top level) ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
	<entry>
		<id>http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3757</id>
		<title>SWC LISP</title>
		<link rel="alternate" type="text/html" href="http://guide.swcombine.com/index.php?title=SWC_LISP&amp;diff=3757"/>
		<updated>2018-09-14T22:52:15Z</updated>

		<summary type="html">&lt;p&gt;Ruben Wan: /* Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Main page - trying to reorganise the LISP content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SWC-LISP can be considered a fork from the main Lisp branches that is used to interact with the Combine&#039;s database. For this reason it is not used to create stand-alone applications, rather dialogue scripts for Custom NPCs or working procedures for objects as well as implementing game-wide quests.&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
Notation for a sequence of things is often 1 2 ... n, where the first couple things give you an idea of how the sequence goes (in this case incrementing by 1), the ellipses (...) indicate it continues.  When referring to any specific &#039;thing&#039; in that sequence, we talk about its position.  1 is the &#039;&#039;first&#039;&#039; thing.  2 is the &#039;&#039;second&#039;&#039; thing, and all the way at the end, the term n representing the last thing in that sequence is the &amp;quot;nth&amp;quot; thing.  We use the same kind of notation and terms to discuss lists.&lt;br /&gt;
&lt;br /&gt;
; atom : a single &#039;thing&#039; - the smallest unit thing in LISP. It is an s-expression, but more than that it is a value, number, &lt;br /&gt;
; boolean : Boolean is a data type that can be either True or False.  We often refer to functions which return #t or #f as &#039;&#039;&#039;&#039;&#039;predicates&#039;&#039;&#039;&#039;&#039;, and in SWC-LISP, the convention is to name those functions ending with a question mark.  If i made a predicate to check if numbers a and b are both 2, i&#039;d name it both-two?&lt;br /&gt;
; define : in the sense of LISP, this means to formally tell the script what you want a given &#039;&#039;symbol&#039;&#039; to evaluate to.  You use two functions for this:  &#039;&#039;defvar&#039;&#039; for variables and &#039;&#039;defun&#039;&#039; for functions.&lt;br /&gt;
; element : We often refer to each &#039;thing&#039; inside a list as an &#039;&#039;element&#039;&#039;.  It&#039;s useful to have a term for this since we discuss how lists are navigated and need common ways to talk about it.  &lt;br /&gt;
; evaluate : More or less this means &#039;determine the meaning of &#039;. This action is what the LISP interpreter does for every s-expression.  We often say an s-expression &#039;evaluates to&#039; something else, and many LISP books use the notation =&amp;gt; to indicate that. E.G. 1=&amp;gt; 1; (defvar blue &amp;quot;Red&amp;quot;) blue=&amp;gt; &amp;quot;Red&amp;quot;;  (+ 1 7) =&amp;gt; 8; (concatenate &amp;quot;My favourite colour is &amp;quot; blue) =&amp;gt; &amp;quot;My favourite colour is Red&amp;quot;&lt;br /&gt;
; functions : Instructions to the interpreter on what to do.  You define these using &#039;&#039;defun&#039;&#039; telling the interpreter a) what you want the symbol to be, b) if you want to feed your function data (&#039;&#039;parameters&#039;&#039;), what temporary symbols you will use to refer to each parameter (&amp;quot;&#039;&#039;local variables&#039;&#039;&amp;quot;), and what function that symbol should evaluate to.  More on this later, but the important concept is that functions are your way of directing what you want to happen, when.&lt;br /&gt;
; lambda functions : They are (generally) function definitions not bound to an identifier - or in our case a symbol. They can be used anywhere you&#039;d normally use a defined function name by directly describing its behavior rather than indirectly by referring to the name of an established function (Excepting add-action, add-response, add-text). I primarily use them in more interesting ways than the above in order to create temporary functions based on a template.  In general, they are a way of defining a function for use in an s-expression without having to name the function.  You can think of it as the function equivalent of passing a string value as &amp;quot;Blue&amp;quot; instead of (defvar colour &amp;quot;Blue&amp;quot;) colour.&lt;br /&gt;
; list : a group of s-expressions represented in the form (s-expression1 s-expression2 ... s-expressionN).  A list is itself an s-expression, so can be contained inside other lists. &lt;br /&gt;
; parameter : a piece of data you feed to a function, upon which it operates. Also known as &#039;&#039;input&#039;&#039;. These are often listed as an expected type - for example &#039;&#039;defvar&#039;&#039; expects a &#039;&#039;symbol&#039;&#039; and a &#039;&#039;value&#039;&#039;, while &#039;&#039;say&#039;&#039; expects a &#039;&#039;string&#039;&#039;.&lt;br /&gt;
; quoting : Lisp must decide which parts of our program consist of code (stuff to be executed) and which parts are just data. Whenever you type something, Lisp assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to &#039;&#039;code mode&#039;&#039;. On the other hand, stuff written in &#039;&#039;data mode&#039;&#039; is treated as data. This means the computer will not try to &amp;quot;execute&amp;quot; it, which allows us to have information in our code that’s just plain old data. The &#039;&#039;&#039;single quote &#039;&#039;&#039;&#039; tells Lisp to treat the subsequent form as a chunk of data — simply a list of items. Lisp then prints the result of evaluating what we entered, which is the list itself. It ignores any functions or variables in our list, treating everything as data. Example: (+ 2 3) =&amp;gt; 5 whereas &#039;(+ 2 3) =&amp;gt; (+ 2 3).&lt;br /&gt;
; quasiquoting : This feature allows us to create chunks of data that have small pieces of Lisp code embedded in them. To enable quasiquoting, you must use a &#039;&#039;backquote&#039;&#039; [`] not a single quote [&#039;] when switching from code to data mode. Both the single quote and backquote in Lisp &amp;quot;flip&amp;quot; a piece of code into data mode, but only a backquote can also be unquoted using the &#039;&#039;comma&#039;&#039; character, to flip back into code mode. Example: &amp;lt;code&amp;gt;`(a b ,character)&amp;lt;/code&amp;gt; produces a list that contains the symbols a and b, followed by the value of the symbol character. The first two are not evaluated, but the third is.&lt;br /&gt;
; s-expression : a general term that means an atom or a grouping of atoms called a &#039;&#039;list&#039;&#039;.&lt;br /&gt;
; scope :  Really we mean &#039;&#039;lexical scope&#039;&#039;, which sets the range of functionality of a symbol so it can only be used inside the part of the script it is defined in.  This is a longer subject and will be covered in more detail later, but when we talk about scope, we&#039;re talking about where we can use a particular defined symbol and where we cannot.&lt;br /&gt;
; session : a unique interaction between a character and a scripted entity.  Lasts as long as the script is still running.&lt;br /&gt;
; string : A set of letters and numbers that the interpreter does not evaluate further - treats it as text.  &amp;quot;Blue&amp;quot; is a string, while Blue is a symbol.  (defvar colour &amp;quot;Blue&amp;quot;) defines the symbol `colour` to evaluate to the string &amp;quot;Blue&amp;quot;.  You can also feed defvar (or other functions) a symbol which evaluates to the expected type.  (defvar some-colour colour) would then set the symbol `some-colour` to evaluate to the symbol `colour`, which evaluates to the string &amp;quot;Blue&amp;quot;.&lt;br /&gt;
; symbol : looks just like any other word in the code.  It&#039;s exactly what you intuit it to mean: a representation of something else - a value, a string, a function, a list, etc.&lt;br /&gt;
; variables : As a programming term, it is a storage location paired with a symbolic name.  For our purposes, it&#039;s a symbol that will evaluate to a set &amp;quot;something&amp;quot; stored: a value, another symbol, a function, etc.).  (defvar symbol value) is the general form, and that makes an unchangeable variable, which you can then refer to as `symbol` for the rest of the script.  There are exceptions/provisos/caveats, but they&#039;ll be discussed as they come up.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* *vars can now properly handle lists of values in addition to scalar values. Storing an instance of a class is not supported and (should) result in an exception being thrown.&lt;br /&gt;
&lt;br /&gt;
==Predicates==&lt;br /&gt;
The following table lists functions that return either #t or #f. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|is-unharmed?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;unharmed&amp;quot;||(is-unharmed? character)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-slightly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;slightly wounded&amp;quot;||(is-slightly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;wounded&amp;quot;||(is-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-											&lt;br /&gt;
|is-badly-wounded?||player-NPC-object||Returns true if player-NPC-object&#039;s HP-Status-Text is &amp;quot;badly wounded&amp;quot;||(is-badly-wounded? character)||#f||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-same-faction?||entityA entityB||Returns true if entity A and B are in or owned by the same faction. Can be written (eq? (get-entity-faction entityA)(get-entity-faction entityB))||(in-same-faction? )||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|in-container?||object container||Returns true if object is inside container||(n-container? hilt toolkit)||#t||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|is-ally?||player-NPC-object||Returns true if NPC/PC is IFF friendly (defaults to self)||(is-ally? self)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-enemy?||player-NPC-object||Returns true if NPC/PC is IFF enemy (defaults to self)||(is-enemy? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-neutral?||player-NPC-object||Returns true if NPC/PC is IFF neutral (defaults to self)||(is-neutral? self)||#f||&lt;br /&gt;
|-&lt;br /&gt;
|is-owner?||player||Returns true if character is the owner of the NPC||(is-owner? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-commander?||player||Returns true if character is the commander of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-manager?||player||Returns true if character is the manager of the NPC ||(is-manager? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-pilot?|| player ||Returns true if character is the owner of the NPC ||(is-pilot? character)||#t||&lt;br /&gt;
|-										&lt;br /&gt;
|is-supervisor?	||player||Returns true if character is the supervisor of the NPC||(is-supervisor?)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|is-freelancer?|| player ||Returns true if the character is a freelancer||(is-freelancer? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|is-traveling?|| player  ||Checks if the character is traveling or not ||(is-traveling? character)||#t||&lt;br /&gt;
|-&lt;br /&gt;
|in-room?|| entity-object ||Checks if the entity is in any room at all, as opposed to outside on the surface ||(in-room? entity-object)||#t||&lt;br /&gt;
|-									&lt;br /&gt;
|faction-owned?||entity||Returns true if the entity is owned by a faction ||(faction-owned? self)||#t||	&lt;br /&gt;
|-&lt;br /&gt;
|empty? ||list || checks if you have an empty list.  Can have unexpected behaviour if attempting to store an empty list in a persistent variable. ||1. (empty? `())&amp;lt;br /&amp;gt;2. (empty? `(1))||1. #t&amp;lt;br /&amp;gt;2. #f ||&lt;br /&gt;
|-&lt;br /&gt;
|in? ||needle haystack||Returns true if one or more of the elements of &#039;&#039;haystack&#039;&#039; is equal to &#039;&#039;needle&#039;&#039;. &#039;&#039;needle&#039;&#039; is an atom and &#039;&#039;haystack&#039;&#039; is a list of atoms ||(in? 3 (list 1 &#039;a 6 3 &#039;u)) ||#t ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|sublists-empty? ||list-of-lists || Returns true if any of the sublists are empty. Note: the function expects only lists, no atoms at the top level || ||  ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|earlier? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is less than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|later? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is greater than &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|same-time? ||timeA timeB || Returns true if &#039;&#039;timeA&#039;&#039; is equal to &#039;&#039;timeB&#039;&#039;. timeA and timeB are two time objects || ||  ||(load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|enum-valid? || || Tests a value for being part of an enum || ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
===Arithmetic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| +||number1 number2 &amp;amp;numberN||Adds numbers together||(+ 5 2)||7||	&lt;br /&gt;
|-											&lt;br /&gt;
| -||number1 number2 &amp;amp;numberN||Subtracts numbers||(- 5 2)||3||	&lt;br /&gt;
|-											&lt;br /&gt;
|*||number1 number2 &amp;amp;numberN||Multiplies numbers||(* 5 2)||10||	&lt;br /&gt;
|-											&lt;br /&gt;
|/||number1 number2||Divides numbers||(/ 10 2)||5||	&lt;br /&gt;
|-&lt;br /&gt;
|abs||number||Returns the absolute value of number||(abs -10)||10||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|power||number exponent||Returns the value of number&amp;lt;sup&amp;gt;exponent&amp;lt;/sup&amp;gt;||(power 2 3)||8||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|minof||list-of-numbers||Returns the minimum value from a list of numbers||(minof &#039;(2 3 7 9 1 18))||1||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|maxof||list-of-numbers||Returns the maximum value from a list of numbers||(maxof &#039;(2 3 27 9 1 18))||27||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|neg?||number||Returns true if number is negative, nil if positive||(neg? -1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|pos?||number||Returns true if number is positive, nil if negative||(pos? 1)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|zero?||number||Returns true if number is 0, nil if otherwise||(zero? 0)||#t||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|factorial||number||Returns !number||(factorial 5)||120||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|common-number-format||number||Returns a string with commas separating the thousands||(common-number-format 10000.51)||&amp;quot;10,000.51&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|add-leading-zeros||number &amp;amp;HowManyDigits||Returns a string of value = number, with optional integer HowManyDigits leading zeros. HowManyDigits defaults to 1||1. (add-leading-zeros 3)&amp;lt;br /&amp;gt;2. (add-leading-zeros 30)&amp;lt;br /&amp;gt;3. (add-leading-zeros 3 2)&amp;lt;br /&amp;gt;4. (add-leading-zeros 30 2)||1. &amp;quot;03&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;30&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;003&amp;quot;&amp;lt;br /&amp;gt;4. &amp;quot;030&amp;quot;||(load &amp;quot;mathematics&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Comparison Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|ge?||number1 number2||Is number1 equal to or greater than number2?||(ge? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|le?||number1 number2||Is number1 equal to or less than number2?||(le? 5 2)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|gt?||number1 number2||Is number1 greater than number2?||(gt? 5 2)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|lt?||number1 number2||Is number1 less than number2?||(lt? 5 2)||#f||	&lt;br /&gt;
|-&lt;br /&gt;
|eq? || atom1 atom2 || Returns true if the two provided atoms are equal. Does not work for Lists. ||1. (eq? 1 1)&amp;lt;br /&amp;gt;2. (eq? 1 2)||1. #t&amp;lt;br /&amp;gt;2. #f||&lt;br /&gt;
|-&lt;br /&gt;
|neq?||atom1 atom2||Returns true if atom 1 is not equal to atom 2||(neq? 1 2)||#t||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|eq-lists?||listA listB||Returns true if all elements of list A are equal to all elements of list B. As of Y19D290 it doesn&#039;t take into account lists of lists, but only one-dimensional lists||1. (eq-lists? &#039;(a b c) &#039;(d e f))&amp;lt;br /&amp;gt;2. (eq-lists? &#039;(a b c) &#039;(a b c))&amp;lt;br /&amp;gt;3. (eq-lists? &#039;( &#039;(a) b c))||1. #f&amp;lt;br /&amp;gt;2. #f&amp;lt;br /&amp;gt;3. Error||(load &amp;quot;funlib&amp;quot;)	&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logic Operators===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|and||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if all exprs are true||(and? #t #f)||#f||	&lt;br /&gt;
|-											&lt;br /&gt;
|or||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns true if at least one expr is true||(or #t #f)||#t||	&lt;br /&gt;
|-											&lt;br /&gt;
|not||boolean-expression1 boolean-expression2 &amp;amp;boolean-expressionN||Returns the opposite value||(not #t)||#f||	&lt;br /&gt;
|-												&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Getters==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|get-name||player-NPC-object|| Returns the name of the entity ||1. (get-name self)&amp;lt;br /&amp;gt;2. (get-name (get-entity-faction character))&amp;lt;br /&amp;gt;3. (get-name (get-container self))&amp;lt;br /&amp;gt;4. (get-name (get-vehicle 1150488))||1. Johnny Walker&amp;lt;br /&amp;gt;2. New Republic (empty string if Freelance&amp;lt;br /&amp;gt;3. Tydirium (Current container name, e.g. the ship or vehicle standing in)&amp;lt;br /&amp;gt;4. My vehicle|| &lt;br /&gt;
|-&lt;br /&gt;
|get-race|| player-NPC ||Returns the PC/NPC&#039;s race as string ||(get-race self)||Nautolan ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield||player-NPC ||Returns the string of the first infofield of PC/NPC&#039;s||1. (get-infofield self)&amp;lt;br /&amp;gt;2. (get-infofield (get-npc 111548)) ||1. Master Carpenter&amp;lt;br /&amp;gt;2. empty string ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield2||player-NPC ||Returns the string of the 2nd infofield of PC/NPC&#039;s||1. (get-infofield2 self)&amp;lt;br /&amp;gt;2. (get-infofield2 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. O-4&amp;lt;br /&amp;gt;2.  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-infofield3||player-NPC ||Returns the string of the 3rd infofield of PC/NPC&#039;s||1. (get-infofield3 self)&amp;lt;br /&amp;gt;2. (get-infofield3 (get-character &amp;quot;Kay Dallben&amp;quot;)) ||1. Inactive&amp;lt;br /&amp;gt;2. ||&lt;br /&gt;
|-&lt;br /&gt;
|get-gender||player-NPC ||Returns the PC/NPC&#039;s gender as a string ||(get-gender self)||Male  ||&lt;br /&gt;
|-&lt;br /&gt;
|get-formal||player-NPC ||Returns the PC/NPC&#039;s formal greeting (Sir if gender is male, Ma&#039;am if gender is female.) ||(get-formal (get-character &amp;quot;Kay Dallben&amp;quot;)) ||Sir ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-faction|| player-NPC ||Returns the PC/NPC&#039;s current faction ||(get-entity-faction character)||Galactic Empire ||&lt;br /&gt;
|-&lt;br /&gt;
|get-destination|| entity ||Returns the destination name ||(get-destination entity)||&amp;quot;Corellia sector&amp;quot; (if deep space) &amp;lt;br /&amp;gt; &amp;quot;Corellia system&amp;quot; (if heading to that system) &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;Corellia planet&amp;quot; (if heading in sublight) &amp;lt;br /&amp;gt; &amp;quot;Atmosphere (3,4) of Corellia&amp;quot; (if heading in atmo) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) of city Cityname on Corellia&amp;quot; (if heading to ground in city) &amp;lt;br /&amp;gt; &amp;quot;Ground (3,4) at (4,7) on Corellia&amp;quot; (if heading to ground outside a city)&lt;br /&gt;
|-&lt;br /&gt;
|get-eta|| entity ||Returns the ETA for current travel ||(get-eta entity)||3 days, 24 hours and 5 minutes ||&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-type-name|| entity ||Returns the name of the type of the entity|| (get-entity-type-name (get-container self)) ||Lambda Shuttle||&lt;br /&gt;
|-&lt;br /&gt;
|get-type|| entity-object ||Returns the current container entity type, e.g. the ship, vehicle, city, planet, station ||(get-type entity-object)||Ship, Vehicle, City, Planet, Space Station||&lt;br /&gt;
|-											&lt;br /&gt;
|get-entity-type-id||name||Type ID for the entity type name.  {Ship, Vehicle, City, Planet, Space Station}||(get-entity-type-id &#039;Planet) -&amp;gt; ||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-type||typeID entityType||returns a full TYPE|| (get-type-type 298 (enum &amp;quot;EntityType&amp;quot; &amp;quot;ITEM&amp;quot;)) is equal to (get-item-type 298)	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-creature-type||typeID||returns the type of Creature|| (get-creature-type 175) returns the type for an Eye-Snatcher	||		||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-droid-type	||typeID|| returns the type of Droid||(get-droid-type 14) gets the droid type obj for Pit Droids|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item-type	||typeID|| returns the type of Item||(get-item-type 298) returns the type of a Focusing Crystal	|| ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-type||typeID||returns the type of NPC||(get-npc-type NUM) returns the type for a NPC of typeid NUM|| ||needs testing&lt;br /&gt;
|-											&lt;br /&gt;
|get-type-of||entity||returns the type object for the entity||(get-type-of self) could return the type for a Quest NPC (if self is a quest npc)|| ||&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc-owner	|| ||returns the &amp;quot;NPC Owner&amp;quot; object|| || ||useful for an is-unclaimed? check.&lt;br /&gt;
|-											&lt;br /&gt;
|get-hostile-owner|| ||returns the &amp;quot;Hostile Owner&amp;quot; object|| || ||ie checks if it is a spawned Bandit/Creature&lt;br /&gt;
|-											&lt;br /&gt;
|get-market-owner|| ||returns the &amp;quot;Market Owner&amp;quot; object	|| || ||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-character	|| name	||entity-object for character &amp;quot;name&amp;quot;||(get-character &amp;quot;Kay Dallben&amp;quot;)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-faction||name||faction-object for faction &amp;quot;name&amp;quot;||(get-faction &amp;quot;Darkness&amp;quot;)	||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-npc||id||npc-object for NPC with ID id||(get-npc 155408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-quest||id||quest-object for quest with ID id||(get-quest 4408)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-item||id||item-object for item with ID id||(get-item 481099)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-ship||id||ship-object for ship with ID id||(get-ship 448088)||n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-vehicle||id||vehicle-object for vehicle with ID id||(get-vehicle 46846816)||n/a||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-room||id||	room object for room ID.  Rooms are commonly numbered among ALL of a given entity type. So all VSDs have the same room numbers, and no other entity has those room numbers.||(get-room 4478)||	n/a||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-id	||entity||ID for the entity||(get-id (get-npc 100)) -&amp;gt; 100||n/a	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-hp-status-text||entity||string of the hp-status-text {unharmed, slightly-wounded, etc.}||(get-hp-status-text self)	||n/a||	&lt;br /&gt;
|-&lt;br /&gt;
|get-owner||entity||owner object of entity||(get-owner self)-&amp;gt; Kay Dallben||	||	&lt;br /&gt;
|-											&lt;br /&gt;
|get-container||entity||entity-object for container of entity.	||	(get-container self)	||	n/a	||	&lt;br /&gt;
|-										&lt;br /&gt;
|get-location||entity||String of location (currently including hyperlinks) if viewable without godmoding.|| || ||needs testing&lt;br /&gt;
|-&lt;br /&gt;
|get-storageform||entity get-entity-type-name||Returns a storageform for the entity. As of Y19D290 it works only on entities of types: NPC, Item, Ship, Room, Vehicle, Character (missing entities: Quest, Hook, Faction, Facility, Station, Droid).&amp;lt;br /&amp;gt; NOTE: If you use this in a script module you must bind the function (get-entity-type-name) ||(get-storageform (get-npc 22048668) get-entity-type-name) ||&#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;) ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-entity-from-storageform||storageform||Returns the entity object described in storageform. &#039;&#039;storageform&#039;&#039; is a list in the form of &#039;(&amp;quot;NPC&amp;quot; &amp;quot;Quest NPC&amp;quot; 22048668 &amp;quot;Vash Thompson&amp;quot;)|| || ||(load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-first-n||n list||Returns the first &#039;&#039;n&#039;&#039; elements of &#039;&#039;list&#039;&#039;. If &#039;&#039;n&#039;&#039; &amp;gt; (length &#039;&#039;list&#039;&#039;) it returns the whole list. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list ||(get-first-n 3 &#039;(a b c d e f g h i j)) ||&#039;(a b c) ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-name-typeof||entity-type||Returns just the Name component of the &#039;&#039;entity-type&#039;&#039;. &#039;&#039;entity-type&#039;&#039; is a type, i.e. what you can get from (get-typeof &#039;&#039;entity&#039;&#039;) ||(defvar held-in-hand (get-item FocusingCrystalid))&amp;lt;br /&amp;gt;(get-name-typeof (get-typeof held-in-hand)) ||&amp;quot;Focusing Crystal&amp;quot; ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|get-nth||haystack nth||Returns the &#039;&#039;nth&#039;&#039; element of &#039;&#039;haystack&#039;&#039; using &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cdr&amp;lt;/code&amp;gt; only. This does not call the PHP nth-of, so it can return a symbol. It might have performance issues for large lists or large nth ||(get-nth ?? ||?? ||(load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions for SWC Database==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
|faction-type|| player-NPC ||Character&#039;s faction&#039;s type || (faction-type (get-entity-faction character)) || Mining (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-leader|| player-NPC ||Character&#039;s faction&#039;s leaders name || (faction-leader (get-entity-faction character)) || Ellias (Empty String if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|faction-website || player-NPC ||Character&#039;s faction&#039;s website URL ||(faction-website (get-entity-faction character))  || http://swcombine.com (Link) (Empty string if freelance) ||&lt;br /&gt;
|-&lt;br /&gt;
|city-name || player-NPC ||Current city name ||(city-name character) || City 327 ||&lt;br /&gt;
|-&lt;br /&gt;
|planet-name || player-NPC ||Current planet name ||(planet-name character)|| Glee Anselm ||&lt;br /&gt;
|-&lt;br /&gt;
|system-name|| player-NPC ||Current system name ||(system-name character)|| Danju ||&lt;br /&gt;
|-&lt;br /&gt;
|sector-name|| player-NPC ||Current sector name ||(sector-name character)||Tapani ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Time Related Functions==&lt;br /&gt;
Functions that are useful in the tracking and manipulation of Time objects. Time objects are lists in the form of &#039;(Y D H M S).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| cgt-year|| n.a. ||Gets current CGT year ||(cgt-year)|| 12 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-day|| n.a. ||Gets current CGT day ||(cgt-day)||183 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-hour|| n.a. ||Gets current CGT hour ||(cgt-hour)||23 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-minute|| n.a. ||Gets current CGT minutes ||(cgt-minute)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| cgt-second|| n.a. ||Gets current CGT seconds||(cgt-second)||59 || &lt;br /&gt;
|-&lt;br /&gt;
| timeofday|| n.a. ||Gets current phase of day ||(timeofday)||Morning, Afternoon, Evening ||&lt;br /&gt;
|-&lt;br /&gt;
| now-time|| n.a. ||Returns the &#039;time&#039; object for Now ||(now-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-seconds|| n.a. ||Returns the seconds for Now ||(now-seconds)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-days|| amount ||Add amount to Now in days ||(now-plus-days 3)|| a time object that is 3 days from Now|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-hours|| amount ||Add amount to Now in hours||(now-plus-hours 5)|| a time object that is 5 hours from Now || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-minutes|| amount ||Add amount to Now in minutes ||(now-plus-minutes 18)|| a time object that is 18 minutes from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| now-plus-seconds|| amount ||Add amount to Now in seconds||(now-plus-seconds 55)|| a time object that is 55 seconds from Now  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| timer-end-time|| amount-or-time &amp;amp;ydhms start-time ||Returns a time object that marks the end of a timer of length amount-or-time beginning on start-time. The ydhms defaults to &#039;m (minutes) and can be &#039;y &#039;d &#039;h &#039;m &#039;s to indicate what units amount-or-time is in. start-time defaults to now-time but is a time object to denote the start time of the timer. ||1. (timer-end-time 30)&amp;lt;br /&amp;gt;2. (timer-end-time 5 &#039;h &#039;(17 192 13 57 05))||1. a time object that is 30 minutes from Now (the same as (now-plus-minutes 30) i.e. 30 minutes from CGT at the time of script execution&amp;lt;br /&amp;gt;2. &#039;(17 192 18 57 05) i.e. 5 hours from Y17 D192 at 13:57:05 being Y17D192 18:57:05  || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| time-to-string|| time &amp;amp;format||Converts a time object to a string. format defaults to &#039;YDHMS ||If time &#039;(17 192 18 20 15) then:&amp;lt;br /&amp;gt;1. (time-to-string time &#039;YDHMS)&amp;lt;br /&amp;gt;2. (time-to-string time &#039;YYDDHHMMSS)&amp;lt;br /&amp;gt;3. (time-to-string time &#039;YsDsHsMsSs)|| 1. &amp;quot;Y17 D192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;Year 17 Day 192 18:20:15&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;Years: 17 Days: 192 Hours: 18 Minutes: 20 Seconds: 15&amp;quot;|| (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cmp-time|| timeA timeB ||Basic comparison of two time objects. Returns true if equal ||(cmp-time)|| || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| fix-improper-time|| time ||Corrects an improper time object. &amp;quot;Improper&amp;quot; refers only to D, H, M, S being out of bounds.&amp;lt;br /&amp;gt;-60 &amp;lt; M &amp;lt; 60; -60 &amp;lt; S &amp;lt; 60; -23 &amp;lt; H &amp;lt; 23; -365 &amp;lt; D &amp;lt; 365 || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-n|| time amount ||Adds that amount of &#039;&#039;n&#039;&#039; to the &#039;&#039;time&#039;&#039;. &#039;&#039;n&#039;&#039; is any of seconds mins hrs days years || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-times|| timeA timeB ||Returns the time object which is the sum of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timesB&#039;&#039;. Proper format. || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| add-ydhms-to|| time ydhms amount ||All-encompassing time-addition function. Adds &#039;&#039;amount&#039;&#039; &#039;y &#039;d &#039;h &#039;m or &#039;s to &#039;&#039;time&#039;&#039;. You can also use 0, 1, 2, 3 or 4 to refer to year, day, hour, minutes or seconds respectively, for &#039;&#039;ydhms&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sub-times|| timeA timeB ||Returns the time object which is &#039;&#039;timeA&#039;&#039; minus &#039;&#039;timesB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| diff-times|| timeA timeB ||Returns the time object which is the smalles difference of &#039;&#039;timeA&#039;&#039; and &#039;&#039;timeB&#039;&#039; || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-seconds|| time ||Converts &#039;&#039;time&#039;&#039; into seconds || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| to-time|| seconds ||Converts &#039;&#039;seconds&#039;&#039; into time || || || (load &amp;quot;timelib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| abc ||n.a.||List of strings comprising the alphabet, lowercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ABC ||n.a.||List of strings comprising the alphabet, uppercase|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| numstr||n.a.||List of strings from 1 to 9, rather than numbers|| || || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-caps ||n.a.||List of strings comprising the Aurebesh alphabet, with the initial letter capitalised|| ||&amp;quot;Aurek&amp;quot; &amp;quot;Besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| aurebesh-lc ||n.a.||List of strings comprising the Aurebesh alphabet, all lowercase|| || &amp;quot;aurek&amp;quot; &amp;quot;besh&amp;quot; ... || (load &amp;quot;swclib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| trim || ||?? || || ?? || &lt;br /&gt;
|-&lt;br /&gt;
| flash||type message ||Shows a flashing message to the player to provide non-conventional extra information, for example to indicate that a journal entry was added. &#039;&#039;type&#039;&#039; is one of: &#039;good &#039;bad &#039;info, &#039;&#039;message&#039;&#039; is a string ||(flash &#039;good &amp;quot;You have received 25 XP for helping to free the Jawas&amp;quot; ||  || &lt;br /&gt;
|-&lt;br /&gt;
| enum||  ||Retrieves a named value from a specific enum ||(enum &#039;entityType &#039;room) ||Retrieves the entity type value for rooms  || &lt;br /&gt;
|-&lt;br /&gt;
| enum-values||  ||Retrieves all values from an enum || ||  || &lt;br /&gt;
|-&lt;br /&gt;
| substr||string start &amp;amp;length ||Carves out a portion of a string. &#039;&#039;start&#039;&#039; is the position of the first character in the &#039;&#039;string&#039;&#039; you want to get, and &#039;&#039;length&#039;&#039; is the number of characters you want (default is to the end of the &#039;&#039;string&#039;&#039;). Positions begin at 0 for the first character. You can also use a negative number to indicate you want to start &amp;quot;that many&amp;quot; characters from the end of the string ||1. (substr &amp;quot;I like cheese&amp;quot; 2)&amp;lt;br /&amp;gt;2. (substr &amp;quot;I like cheese&amp;quot; 0 6)&amp;lt;br /&amp;gt;3. (substr &amp;quot;I like cheese&amp;quot; -6) ||1. &amp;quot;like cheese&amp;quot;&amp;lt;br /&amp;gt;2. &amp;quot;I like&amp;quot;&amp;lt;br /&amp;gt;3. &amp;quot;cheese&amp;quot; || &lt;br /&gt;
|-&lt;br /&gt;
| strpos||string find start ||Looks in &#039;&#039;string&#039;&#039; for the string &#039;&#039;find&#039;&#039; starting to look at position &#039;&#039;start&#039;&#039;, and returns the position in &#039;&#039;string&#039;&#039; where it finds it ||1. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot;like&amp;quot;)&amp;lt;br /&amp;gt;2. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot;)&amp;lt;br /&amp;gt;3. (strpos &amp;quot;I like cheese&amp;quot; &amp;quot; &amp;quot; 2) ||1. 2&amp;lt;br /&amp;gt;2. 1&amp;lt;br /&amp;gt;3. 6 (looking for a space but beginning after the first space) || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| join||separator-character list||Combines the elements of &#039;&#039;list&#039;&#039; with the &#039;&#039;separator-character&#039;&#039; to form a string||(join &amp;quot;, &amp;quot; (list &amp;quot;Green&amp;quot; &amp;quot;Blue&amp;quot; &amp;quot;Yellow&amp;quot;)) ||&amp;quot;Green, Blue, Yellow, &amp;quot; || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| map||function list||Calls &#039;&#039;function&#039;&#039; for each member of &#039;&#039;list&#039;&#039; and returns the list of results||(map (lambda (x) (+ x 2)) (list 1 0 4)) ||(3 2 6)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| apply-foreach||function list||Calls &#039;&#039;function&#039;&#039; once for each member in &#039;&#039;list&#039;&#039;, using the element as the single parameter. Returns #f (i.e., does not return a list of results)||(apply-foreach (lambda (x) (say (x)) (list &amp;quot;I like&amp;quot; &amp;quot;cheesy poofs.&amp;quot; &amp;quot;Do you?&amp;quot;)) ||I like&amp;lt;br /&amp;gt;cheesy poofs.&amp;lt;br /&amp;gt;Do you? || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| append||list element||Adds &#039;&#039;element&#039;&#039; to the end of &#039;&#039;list&#039;&#039; ||(append (list 1 2) 3) ||(1 2 3) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| list-append||list1 list-to-append||Adds all the elements of the list &#039;&#039;list-to-append&#039;&#039; to the end of &#039;&#039;list1&#039;&#039; ||(list-append &#039;(1 2) &#039;(3 4)) ||&#039;(1 2 3 4)  || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| reduce||function init list||Reduces a list to a single value, using the combiner &#039;&#039;function&#039;&#039; provided, which function takes two inputs &#039;&#039;init&#039;&#039; and &#039;&#039;(car list)&#039;&#039; ||(reduce (lambda (x y) (+ x (* 2 y))) 0 (list 1 2 3)) ||12 [i.e. (((0 + 2*1) + (2*2)) + (2*3)) ] || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| repeat-fn||function num-times object||Repeats &#039;&#039;function&#039;&#039; for the number of &#039;&#039;num-times&#039;&#039; on &#039;&#039;object&#039;&#039; ||(repeat-fn (lambda (x) (+ x 1)) 4 0)||4|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list-unique||n list||Returns a list of &#039;&#039;n&#039;&#039; elements taken randomly from &#039;&#039;list&#039;&#039;, without any duplicates, even if an element appears multiple times in &#039;&#039;list&#039;&#039;. &#039;&#039;n&#039;&#039; is an integer and &#039;&#039;list&#039;&#039; is a list. Note that currently this returns a list of strings if the element chosen is a symbol, due to PHP ||(rand-from-list-unique 7 &#039;(a b c d a a q)) ||&#039;(&amp;quot;c&amp;quot; &amp;quot;d&amp;quot; &amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;q&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-first-of||vals list-to-search (matchfun? eq?)||Returns a list of the first value in &#039;&#039;vals&#039;&#039; found in &#039;&#039;list-to-search&#039;&#039; and the first position (integer with 0 = first element) in list-to-search where vals is found. &#039;&#039;vals&#039;&#039; is an atom or a list of atoms to look for in list-to-search||(find-first-of (list 0 2 5) (list 1 3 2 7 5 0))||(list 2 2)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| find-in||atom list-to-search (start-position -1) (matchfun? eq?)||Returns the first position (integer with 0 = first element) where &#039;&#039;atom&#039;&#039; is found in &#039;&#039;list-to-search&#039;&#039;||(find-in 7 (list 3 6 1 7 3 9 7))||3|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| zip||list1 list2||Returns a list of pairs of the corresponding elements of list1 and list2. list1 and list2 must be lists of atoms of equal length||(zip &#039;(1 2 3 4) &#039;(a b c d))||&#039;((1 a) (2 b) (3 c) (4 d))|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| without||needle haystack ||Returns a list equal to &#039;&#039;haystack&#039;&#039; with all occurrences of &#039;&#039;needle&#039;&#039; removed. &#039;&#039;haystack&#039;&#039; is a list of atoms and &#039;&#039;needle&#039;&#039; is an atom||(without &amp;quot;blue&amp;quot; (list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;blue&amp;quot; &amp;quot;white&amp;quot;)) ||(list &amp;quot;red&amp;quot; &amp;quot;yellow&amp;quot; &amp;quot;orange&amp;quot; &amp;quot;white&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| l-to-csv||my-list ||Returns a csv-concatenated list of the elements of &#039;&#039;my-list&#039;&#039;. &#039;&#039;my-list&#039;&#039; is a list of atoms which are convertible to strings ||(l-to-csv &#039;(1 b a 3 d c)) ||&#039;(&amp;quot;1,b,a,3,d,c&amp;quot;)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| replace-nth||my-list n value||Returns a list which is a copy of &#039;&#039;my-list&#039;&#039; with the nth value changed. &#039;&#039;my-list&#039;&#039; is a list, &#039;&#039;n&#039;&#039; is an integer, &#039;&#039;value&#039;&#039; is a s-expression. Note: the first element of a list is 0. ||(replace-nth &#039;(a b c d e f g) 3 &amp;quot;Hornswaggle&amp;quot;) ||&#039;( a b c &amp;quot;Hornswaggle&amp;quot; e f g) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| matchup||val searchlist fetchlist ||Finds the position of the first occurrence of &#039;&#039;val&#039;&#039; in &#039;&#039;searchlist&#039;&#039;, and returns the same position element of &#039;&#039;fetchlist&#039;&#039;. &#039;&#039;val&#039;&#039; is a value to search for, &#039;&#039;searchlist&#039;&#039; is a list to search in, and &#039;&#039;fetchlist&#039;&#039; is the list from which to return the corresponding element. Note: this returns a string instead of a symbol if the corresponding element of &#039;&#039;fetchlist&#039;&#039; is a symbol ||(matchup &amp;quot;b&amp;quot; &#039;(&amp;quot;a&amp;quot; &amp;quot;b&amp;quot; &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)) &#039;(&amp;quot;A monkey&amp;quot; &amp;quot;An eagle&amp;quot; &amp;quot;A lion&amp;quot; &amp;quot;A snake&amp;quot;)) ||&amp;quot;An eagle&amp;quot;|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-first||needle haystack ||Returns &#039;&#039;haystack&#039;&#039; without the first occurrence of &#039;&#039;needle&#039;&#039; located in it. &#039;&#039;needle&#039;&#039; is an atom, &#039;&#039;haystack&#039;&#039; is a list ||(remove-first x &#039;(1 2 4 x f x 4)) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| remove-nth-of||haystack nth ||Returns &#039;&#039;haystack&#039;&#039; without the &#039;&#039;nth&#039;&#039; element. &#039;&#039;haystack&#039;&#039; is a list, &#039;&#039;nth&#039;&#039; is an integer. Note: the first element of a list is the 0th element ||(remove-nth-of &#039;(1 2 4 x f x 4) 3) ||&#039;(1 2 4 f x 4)|| (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| ziplets||list-of-lists ||Returns a list of n-lets made up of the corresponding elements of each list in list-of-lists. &#039;&#039;list-of-lists&#039;&#039; is a list of lists of atoms ||(ziplets (list (list &amp;quot;I&amp;quot; &amp;quot;You&amp;quot; &amp;quot;We all&amp;quot;) (list &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;scream&amp;quot;) (list &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot; &amp;quot;for ice cream&amp;quot;))) ||((&amp;quot;I&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;You&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;) (&amp;quot;We all&amp;quot; &amp;quot;scream&amp;quot; &amp;quot;for ice cream&amp;quot;)) || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| sublist-firstof||list-of-lists ||Returns a list of the &amp;lt;code&amp;gt;car&amp;lt;/code&amp;gt; of each sublist || || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| rand-from-list || ||  ||  || || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conditional Statements==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Function Name           &lt;br /&gt;
! Required &amp;amp;Optional (&amp;quot;&amp;amp;&amp;quot;) Parameters&lt;br /&gt;
! Description&lt;br /&gt;
! Example Text&lt;br /&gt;
! Example Evaluation&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| case||val caselist &amp;amp;compfun||&#039;&#039;val&#039;&#039; is the value to check against; each case in &#039;&#039;caselist&#039;&#039; which is a list of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; lists in the form `(checkval ,toDo); &#039;&#039;&amp;amp;compfun&#039;&#039; is an optional function which takes 2 parameters and outputs #t or #f. Default is &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt;. Note: &amp;lt;code&amp;gt;eq?&amp;lt;/code&amp;gt; doesn&#039;t work on lists, so only use atoms for the checkval. It is also possible to write a &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; type in longer form, as follows: (list (list &amp;quot;blue&amp;quot; (set-var! x &amp;quot;blue&amp;quot;)) (list &amp;quot;yellow&amp;quot; (set-var! y &amp;quot;yellow&amp;quot;))) ||`((&amp;quot;blue&amp;quot; ,(set-var! x &amp;quot;blue&amp;quot;)) (&amp;quot;yellow&amp;quot; ,(set-var! y &amp;quot;yellow&amp;quot;))) || || (load &amp;quot;funlib&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| cond|| [test result] ||&#039;&#039;test&#039;&#039; is a s-expression that evaluates to #t or #f, &#039;&#039;result&#039;&#039; is a s-expression to execute if true ||(cond&amp;lt;br /&amp;gt;[is-owner? (say &amp;quot;Hi, Boss!&amp;quot;)]&amp;lt;br /&amp;gt;[#t (say &amp;quot;Hello World!&amp;quot;)]) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*[[Scripting]]&lt;br /&gt;
*[[SWC LISP/Debugging and Errors]]&lt;br /&gt;
*[[SWC LISP/Admin-Only Functions]]&lt;br /&gt;
*[[SWC LISP/Modules]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SWC LISP]]&lt;/div&gt;</summary>
		<author><name>Ruben Wan</name></author>
	</entry>
</feed>