Ejemplo n.º 1
0
from lib.client_interfacer import ClientInterfacer

cf = ClientInterfacer()

cf._sendToClient("watch comc")

while 1:
    s = cf._readLineFromClient()
    if s.startswith("scripttell"):
        break
    cf._sendToConsole(s)

Ejemplo n.º 2
0
from lib.client_interfacer import ClientInterfacer

cf = ClientInterfacer()

cf._sendToClient("monitor")

while 1:
    s = cf._readLineFromClient()
    if s.startswith("scripttell"):
        break
    cf._sendToConsole(s)

Ejemplo n.º 3
0
from lib.client_interfacer import ClientInterfacer, Color

cf = ClientInterfacer()

while 1:
    s = cf._readLineFromClient()
    cf.draw("recv: '%s'" % (s))
    if s.startswith("scripttell "):
        rest = s[len("scripttell "):]
        cf.draw("send: %s" % (rest), color=Color.DARK_ORANGE)
        cf._sendToClient(rest)
Ejemplo n.º 4
0
tag = int(s)

testItem = None
for item in cf.getInventory():
    if item.tag == tag:
        testItem = item
        break

if testItem is None:
    cf.fatal("Couldn't find item with tag %d" % tag)

dropCmd   = cf.getDropCommand(testItem)
pickupCmd = cf.getPickupCommand(testItem)
for i in range(20):
    # We set targetPendingCommands high enough that these will all dispatch
    # immediately.
    cf.queueCommand(dropCmd)
    cf.queueCommand(pickupCmd)
cf.queueCommand("east")
cf._sendToClient("sync 6")

# Fall back to passthru.py.
while 1:
    s = cf._readLineFromClient()
    cf.draw("recv: '%s'" % (s))
    if s.startswith( "scripttell "):
        rest = s[len("scripttell "):]
        cf.draw("send: %s" % (rest), color=Color.DARK_ORANGE)
        cf._sendToClient(rest)