Sprak connection functions: Difference between revisions

From wikinotes
Line 70: Line 70:
powertap.Tap(nodename)
powertap.Tap(nodename)
</blockquote><!-- PowerTap -->
</blockquote><!-- PowerTap -->
== Meteorology ==
<blockquote>
<syntaxhighlight lang="bash">
var server = Connect("MeteorologyServer")
server.ReadHumidity()
</syntaxhighlight>
</blockquote><!-- Meteorology -->
</blockquote><!-- Domain Specific Functions -->
</blockquote><!-- Domain Specific Functions -->

Revision as of 06:07, 9 January 2023

This section is for interacting with specific computers.

Basices

var conn = Connect("Finance Computer")  # make a connection
var conns = GetConnections()            # List of all connections made to computer
Ping(conn)                              # test if connection exists

Domain Specific Functions

FinanceComputer

The town's bank

fin = Connect("Finance Computer")
fin.ChangeBalance("Sebastian", +100)  # Change User's Balance

Wellspring

Wellspring's inventory, and balance.

wells = Connect("Wellspringer")
wells.RegisterSeller( name, amount ) # Register Sale for a User
# the default wellspring soda code..
var server = Connect("wellspringer")
server.Trace(GetUser(), Getroom())

Factory

Goods

string db = Connect("GoodsDatabase")
db.Register(goodsType, quality)

var id = Connect("SendPipe2")
Send(id)

var machine = Connect("MachineB2")
string result = machine.Convert()
Print("Result: "+ result )

Security

ZapPerson(name)        # possibly what happened to suit when hacking fusebox?
light.StartBlinking()

PowerTap

  1. fuse-boxes, default code. Uncertain what it does.

number tap = Connect("PowerTap") string nodeName = GetName() powertap.Tap(nodename)

Meteorology

var server = Connect("MeteorologyServer")
server.ReadHumidity()