Sprak connection functions

From wikinotes

This section is for interacting with specific computers.

Basics

You can connect to permanent world objects.

  • doors
  • computers

Functions defined on these objects are callable with a dot. (ex. door.Say("hi"))

var conn = Connect("Finance Computer")          # make a connection
var conns = GetConnections()                    # List of all connections made to computer
conn.Ping(Name())                               # test if connection exists
RemoteFunctionCall(conn, "MyFunc", ["params"])  # RPC

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()