Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function genMove()
  2. local str=""
  3. for i = 1, 19 do
  4. str = str .. tostring(math.random( 1, 4 ))
  5. end
  6. return (str)
  7. end
  8.  
  9. function newgame()
  10. txt = io.output("botlog.txt")
  11. io.write("NewGame \n")
  12. txt = io.close()
  13. end
  14.  
  15. function savemove(str)
  16. txt = io.output("botlog.txt", "w")
  17. io.write(str, "\n")
  18. txt = io.close()
  19. end
  20.  
  21. local function setJoints(player, js)
  22. for i = 1, string.len(js) do
  23. set_joint_state(player, i-1, string.sub(js, i,i))
  24. end
  25. end
  26.  
  27. str=genMove()
  28. newgame()
  29. setJoints(0, str)
  30. savemove(str)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement