Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
slubworld_notes [2013-06-12 13:52] davegriffithsslubworld_notes [2013-06-12 13:56] (current) davegriffiths
Line 1: Line 1:
-==== Slubworld Notes ====+====== Slubworld Notes ======
  
-Naked on Pluto commands (incl superuser ones)+=====Plutonian Bot Zlang===== 
 + 
 +Command line in naked on pluto game interface: 
 + 
 +Make a new bot and set it up:  
 +  make SlubBot 
 +  program SlubBot slub 
 + 
 +Ping the new bot:  
 +  @SlubBot ping 
 +  => SlubBot @BobBloggs I am stopped 
 + 
 +Program the bot: 
 +  @SlubBot 10 say hello 
 +  @SlubBot 20 goto 10 
 +  @SlubBot run 
 +  => SlubBot @BobBloggs hello  
 +  ... 
 +  @SlubBot ping 
 +  => SlubBot @BobBloggs I am running 
 + 
 +Look at the code: 
 +  @Slubbot list 
 + 
 +Rewrite code: 
 +  @SlubBot 20 goto 50 
 +  
 +  @SlubBot ping 
 +  SlubBot @BobBloggs I have crashed with SYNTAX ERROR ON LINE 20: OUT OF RANGE 
 + 
 +Otherwise, to stop the bot: 
 +  @SlubBot stop 
 + 
 +Doing something more useful, look at the world - speak the names of the entities (players or bots) in the current room (or node): 
 + 
 +  @SlubBot 10 for node.entities 
 +  @SlubBot 20 say top.name 
 +  @SlubBot 30 end 
 + 
 +top = top of the stack, I will change this for a form such as "for i in node.entities" and "i.name"
 + 
 +Read what entities are carrying: 
 + 
 +  @SlubBot 10 for node.entities 
 +  @SlubBot 20   say top.name is carrying: 
 +  @SlubBot 30   for top.contents 
 +  @SlubBot 40     say A top.name 
 +  @SlubBot 50   end 
 +  @SlubBot 60 end 
 + 
 +Conditionals (will say "BONG" if someone has picked up the TinyBell): 
 + 
 +  @SlubBot 10 for node.entities 
 +  @SlubBot 20   for top.contents 
 +  @SlubBot 30     if top.name == "TinyBell" 
 +  @SlubBot 40       say BONG 
 +  @SlubBot 45     end 
 +  @SlubBot 50   end 
 +  @SlubBot 60 end 
 +  @SlubBot 70 goto 10 
 + 
 + 
 +==Naked on Pluto commands (incl superuser ones)
  
   walk <destination>   walk <destination>
Line 76: Line 138:
   * Bots programming/rewriting each other's code via messages   * Bots programming/rewriting each other's code via messages
      
-==How to use== 
- 
-Command line in naked on pluto game interface: 
- 
-Make a new bot:  
-  make SlubBot 
- 
-Ping the new bot:  
-  @SlubBot ping 
-  => SlubBot @BobBloggs I am stopped 
- 
-Program the bot: 
-  @SlubBot 10 say hello 
-  @SlubBot 20 goto 10 
-  @SlubBot run 
-  => SlubBot @BobBloggs hello  
-  ... 
-  @SlubBot ping 
-  => SlubBot @BobBloggs I am running 
- 
-Look at the code: 
-  @Slubbot list 
- 
-Rewrite code: 
-  @SlubBot 20 goto 50 
-  
-  @SlubBot ping 
-  SlubBot @BobBloggs I have crashed with SYNTAX ERROR ON LINE 20: OUT OF RANGE 
- 
-Otherwise, to stop the bot: 
-  @SlubBot stop 
- 
-Doing something more useful, look at the world - speak the names of the entities (players or bots) in the current room (or node): 
- 
-  @SlubBot 10 for node.entities 
-  @SlubBot 20 say top.name 
-  @SlubBot 30 end 
- 
-top = top of the stack, I will change this for a form such as "for i in node.entities" and "i.name". 
- 
-Read what entities are carrying: 
- 
-  @SlubBot 10 for node.entities 
-  @SlubBot 20   say top.name is carrying: 
-  @SlubBot 30   for top.contents 
-  @SlubBot 40     say A top.name 
-  @SlubBot 50   end 
-  @SlubBot 60 end 
- 
-Conditionals (will say "BONG" if someone has picked up the TinyBell): 
- 
-  @SlubBot 10 for node.entities 
-  @SlubBot 20   for top.contents 
-  @SlubBot 30     if top.name == "TinyBell" 
-  @SlubBot 40       say BONG 
-  @SlubBot 45     end 
-  @SlubBot 50   end 
-  @SlubBot 60 end 
-  @SlubBot 70 goto 10 
  
  • slubworld_notes.1371045147.txt.gz
  • Last modified: 2013-06-12 13:52
  • by davegriffiths