2013-11-27 04:21:43 +08:00
|
|
|
Cylon = require '../..'
|
2013-11-26 06:28:13 +08:00
|
|
|
|
|
|
|
Cylon.api host: '0.0.0.0', port: '8080'
|
|
|
|
|
2013-11-27 04:21:43 +08:00
|
|
|
class MyRobot
|
|
|
|
commands: ["relax"]
|
2013-11-26 06:28:13 +08:00
|
|
|
|
|
|
|
relax: ->
|
2013-11-27 04:21:43 +08:00
|
|
|
"#{this.name} says relax"
|
2013-11-26 06:28:13 +08:00
|
|
|
|
|
|
|
work: (me) ->
|
|
|
|
every 1.seconds(), ->
|
2014-01-04 09:18:09 +08:00
|
|
|
console.log me.name
|
2013-11-26 06:28:13 +08:00
|
|
|
|
2013-11-27 04:21:43 +08:00
|
|
|
robot = new MyRobot
|
2013-11-26 06:28:13 +08:00
|
|
|
robot.name = "frankie"
|
|
|
|
Cylon.robot robot
|
|
|
|
|
|
|
|
Cylon.start()
|