Skip to main content

User input in chat function

Comments

2 comments

  • Michael Reilly

    Never mind, did some research.  For those looking, it's a little ambiguous to the user, but you need to enter variables that don't necessarily have a prompt.  

     

    def moveByInput(r, c):  #the r and c parameter are not explicity asked for
        agent.teleport_to_player()
        agent.move(FORWARD, r)
        agent.move(UP, c)

    player.on_chat("move", moveByInput)
    #in chat, enter "move 2 5" to move forward 2 then up 5, for example
    0
  • Moderator Beacon of Knowledge Super Star

    Hi, Michael Reilly - pleased to meet you! Sounds like your problem solving is right on track! I know I have been unable to use text as input to chat functions. So let me spare you the grief. =D Unless something was upgraded, you can't pass a string (like what kind of block or what direction.)
    Let us know what you create ~ glad to have you here!

    0

Please sign in to leave a comment.