{"action":"closed","issue":{"url":"https://api.github.com/repos/walterhiggins/ScriptCraft/issues/262","labels_url":"https://api.github.com/repos/walterhiggins/ScriptCraft/issues/262/labels{/name}","comments_url":"https://api.github.com/repos/walterhiggins/ScriptCraft/issues/262/comments","events_url":"https://api.github.com/repos/walterhiggins/ScriptCraft/issues/262/events","html_url":"https://github.com/walterhiggins/ScriptCraft/issues/262","id":99833150,"number":262,"title":"trouble following 'beginners guide to writing plugins...'","user":{"login":"johndgreene","id":13429419,"avatar_url":"https://avatars.githubusercontent.com/u/13429419?v=3","gravatar_id":"","url":"https://api.github.com/users/johndgreene","html_url":"https://github.com/johndgreene","followers_url":"https://api.github.com/users/johndgreene/followers","following_url":"https://api.github.com/users/johndgreene/following{/other_user}","gists_url":"https://api.github.com/users/johndgreene/gists{/gist_id}","starred_url":"https://api.github.com/users/johndgreene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johndgreene/subscriptions","organizations_url":"https://api.github.com/users/johndgreene/orgs","repos_url":"https://api.github.com/users/johndgreene/repos","events_url":"https://api.github.com/users/johndgreene/events{/privacy}","received_events_url":"https://api.github.com/users/johndgreene/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-08T20:58:14Z","updated_at":"2015-08-09T11:26:48Z","closed_at":"2015-08-09T11:26:48Z","body":"i'm following the book beginners guide to writing minecraft plugins in javascript with my 11 year old son. we're making pretty good progress and it's mostly working.  we are not getting the expected results when we try to follow the instructions on page 104, with the 'guessTheNumber' script.  \r\n\r\nwe start the server and in the server console we typed the following and got these results:\r\njs guessTheNumber( self )\r\n[13:41:19] [CanaryMod] [INFO] [MESSAGE]: Pick a number between 0 and 5 inclusive\r\n> > 3\r\n[13:41:23] [net.minecraft.server.MinecraftServer] [INFO]: Unknown command. Try /help for a list of commands\r\n> \r\n\r\n\r\nthe first part seems right - the script asks the player (self in this case) to pick a number. but then when we type a number at the console prompt, we get an error.  it seems like the input function is not working somehow and the console just went back to normal, not expecting an answer from 'self'.  \r\n\r\nfor reference, here is a paste of the code from the numberGuess.js script we saved in the scriptcraft/plugins folder:\r\n(this version is from a bit further in the book - we went ahead and added the if clause from page 109. we have the same problem with this version).  \r\n\r\nvar input=require('input');\r\nvar dice=require('dice');\r\nvar randomNumber;\r\n\r\nfunction checkAnswer(guess, guesser){\r\n\tif(guess==randomNumber){\r\n\t\techo (guesser,'You guessed correctly!');\r\n\t} else{\r\n\t\techo(guesser,'better luck next time');\r\n\t}\r\n\techo(guesser, 'Thanks for playing');\r\n}\r\n\r\nfunction guessTheNumber(player){\r\n\trandomNumber=dice.roll(6);\r\n\tinput(player,'Pick a number between 0 and 5 inclusive',checkAnswer);\r\n}\r\n\r\nexports.guessTheNumber=guessTheNumber;\r\n\r\n\r\nwe have a similar problem getting the Minecraft client to say 'Night!' as on page 113, but other than that we are following the book ok. we have moved on in the book - we finished chapter 9 and will start chapter 10.   we got the dropped cookies to work at end of chapter 9\r\n\r\nwe are on a macbook air.  our mcserver folder is in the users/johngreene folder\r\n\r\nany suggestions to fix the console input and echo functions would be much appreciated!\r\n\r\nthanks\r\njohn g"}}