<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://theuniversal.net/worldmanual/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://theuniversal.net/worldmanual/feed.php">
        <title>Universal World Owners Manual - scripting:samples</title>
        <description></description>
        <link>http://theuniversal.net/worldmanual/</link>
        <image rdf:resource="http://theuniversal.net/worldmanual/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-21T11:03:00+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:basicbuilding&amp;rev=1748450111&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:buildingproxevents&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:dronetraining&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:functionbuilding&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:genericschool&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:hiscoretable&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:osd_values&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:racing&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpleaxe&amp;rev=1748450111&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpleschool&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpletask&amp;rev=1748458706&amp;do=diff"/>
                <rdf:li rdf:resource="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:teamcombatsubgame&amp;rev=1748458706&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://theuniversal.net/worldmanual/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Universal World Owners Manual</title>
        <link>http://theuniversal.net/worldmanual/</link>
        <url>http://theuniversal.net/worldmanual/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:basicbuilding&amp;rev=1748450111&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T16:35:11+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>basicbuilding</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:basicbuilding&amp;rev=1748450111&amp;do=diff</link>
        <description>Simple 'Gather Building' Sample script

Here is a simple script for a 'Gather Building' - i.e. One where the user accesses a 'building' (doesnt have to be an actual building model of course, it could be a rock or a tree or a NPC..) and it gives the user a particular item (up to a defined limit).</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:buildingproxevents&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>buildingproxevents</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:buildingproxevents&amp;rev=1748458706&amp;do=diff</link>
        <description>Building Proximity Event Sample


$kBuildingIDForProxEvents = 5
$kProxDistanceMeters = 40
$kBuildingHiddenTime = 30

// When player logs in activate a building proximity event for them
//  This means that whenever this player gets within range of the building,
//   the &quot;BuildingProxEnter&quot; event will be triggered
Event( &quot;PlayerLogin&quot;, &quot;&quot; )
{
    sysActivateBuildingProximityEvent( $kBuildingIDForProxEvents, $kProxDistanceMeters )
}


// This event will be triggered when the player gets within 40m …</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:dronetraining&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>dronetraining</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:dronetraining&amp;rev=1748458706&amp;do=diff</link>
        <description>Drone Training Script

Here's an example of a chunky script that uses entities to provide a basic single player game with multiple levels.

First off we've got a basic building script file that's used to provide an access point for the player where they can start the minigame:</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:functionbuilding&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>functionbuilding</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:functionbuilding&amp;rev=1748458706&amp;do=diff</link>
        <description>Here's an example of using a function to create a custom display that can be used to provide a range of standard data-driven interfaces. In this case, the function generates a display offering the user a set of different buildings to construct:


$kConstructionStructSize = 6
Function	ConstructionListOSD( $aConstructionList, $selectFunc )
{
	$index = 1
	$lineY = 40
	$imageX = 100
	$textX = 200
	$subtextWidth = 300
        // Set root path for all the menu images..
	osdadditem(HTTPSET, &quot;&quot;, &quot;http:/…</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:genericschool&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>genericschool</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:genericschool&amp;rev=1748458706&amp;do=diff</link>
        <description>Generic School Script





Standard school script used on lovelace (etc).  Table at the top defines the skills available, graphics are hosted on a webpage specified in the script. 

(Alternatively, try A simpler scripted school example )


#include &quot;BaseSchool.mit&quot;    // Include the standard base school functions

$kSchoolStructSize = 7

$kExampleSchoolBuildingNum = 2
$kUniversityBuildingNum = 40

$maLessonsList[] = 
{// cat.       skill name	 price    learn time    graphic			 desc		
	0,	&quot;Lumber…</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:hiscoretable&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>hiscoretable</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:hiscoretable&amp;rev=1748458706&amp;do=diff</link>
        <description>This script demonstrates use of the sysHiscores functions.
A &amp;command function is included demonstrating how to add scores to the table.

The script uses a module variable '$kScoreboardName' to identify the board.. you can change this to whatever you like and you can create multiple scoreboards just by using different names.</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:osd_values&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>osd_values</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:osd_values&amp;rev=1748458706&amp;do=diff</link>
        <description>OSD Value Controls

Value controls provide an interface that lets the user select a value which is then provided to your script when they press a button. Setting up a value control requires you to provide initial, minimum and maximum values. Getting the resulting value back to your script is done using a reference to the name of the value control which is made using the &amp; symbol. Here is a 'simple' example:</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:racing&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>racing</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:racing&amp;rev=1748458706&amp;do=diff</link>
        <description>Racing Script Example

First you'll want some way to initiate a race.. Sometimes you might want that to be a special command for admins, or you could do something automatic like this example:


Event( &quot;OnTheHour&quot;, &quot;&quot; )
{
    $courseNum = 1
    *raceinit $courseNum 
    *announce The hourly race is about to begin. Click the 'Sign Up' button to join!
    *soundeffect 26
    *eao ShowRaceJoinNotification $courseNum
}</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpleaxe&amp;rev=1748450111&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T16:35:11+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>simpleaxe</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpleaxe&amp;rev=1748450111&amp;do=diff</link>
        <description>Simple Bronze Axe Sample

This simple sample script provides a 'UseItem' event that will check to see if the player is near to some trees and if so, award them with 1 'Wood' item.


//------------------------------------- Bronze Axe
Event( &quot;UseItem&quot;, &quot;Bronze Axe&quot; )
{
	$dist = sysGetNearestForest( $gPlayerWorldX,$gPlayerWorldY )
	$distM = $dist / 100

	if ( $distM &lt; 65 )
	{
		*notifylarge %PLAYER% +1 Wood
		*choptrees $gPlayerWorldX,$gPlayerWorldY
		*grantitem %PLAYER% 1 Wood
	}
	else
	{
		*alert…</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpleschool&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>simpleschool</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpleschool&amp;rev=1748458706&amp;do=diff</link>
        <description>$kSchoolBuildingNum = 10

Event( &quot;AccessBuilding&quot;, &quot;$kSchoolBuildingNum&quot; )
{
    osdcreate(OSDBUILDING,&quot;SchoolOSD&quot;, &quot;Example School&quot; ) 
    
    $liney = 10    
    $liney = ShowSkillButton( 10, 20, 100 )   // Skill num 10, 20 game days to learn, costs 100d
    $liney = ShowSkillButton( 12, 25, 200 )   // Skill num 12, 25 game days to learn, costs 200d
    $liney = ShowSkillButton( 16, 28, 300 )   // Skill num 16, 28 game days to learn, costs 300d
    
    osdactivate() 
}

function ShowSkillBut…</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpletask&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>simpletask</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:simpletask&amp;rev=1748458706&amp;do=diff</link>
        <description>Example using the Task system

The 'Task' system is used to block the player for a period of time while they're occupied with some task. For example, you may want the player to have to wait for 30 seconds while they are crafting an item before it is added to their inventory. Here is a simple example demonstrating this system, that is triggered when the player uses the 'Flour' item:</description>
    </item>
    <item rdf:about="http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:teamcombatsubgame&amp;rev=1748458706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-28T18:58:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>teamcombatsubgame</title>
        <link>http://theuniversal.net/worldmanual/doku.php?id=scripting:samples:teamcombatsubgame&amp;rev=1748458706&amp;do=diff</link>
        <description>This script sets up a team CTF game. It assumes we've got vehicles 6 and 7 set up to be used by each team, and a script zones 6 and 7 added to the map as the spawn points.

First function is called when the player joins the game:


function	CTFSignup()
{
	$team = TeamAutoSelect()

	if ( $team == 1 )
	{
		*setvehicle %PLAYER% 6
		*respawninscriptzone %PLAYER% 6
	}
	else
	{
		*setvehicle %PLAYER% 7
		*respawninscriptzone %PLAYER% 7
	}
	
}</description>
    </item>
</rdf:RDF>
