Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    New Coder
    Join Date
    Aug 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    For the "scrolling" issue, uuh... well... It's kind of hard to explain. When the text expands out of the limits of the output box, it will remain at the top of the box. While the scrollbar is getting smaller, and you can still press the down arrow to go down, it doesn't do it automatically, witch is a huge inconvenience.

    The "eat" thing was just an example, I'm not really using it. I meant using something like "say alpha" and then "say beta". So it would execute the "Say" function each time, but using "alpha" or "beta" as a parameter.

    So far, I haven't got much of the coding done. I've been hitting multiple standstills, witch the kind people of this forum have been helping me with.

  2. #17
    New Coder
    Join Date
    Aug 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Bump.

  3. #18
    New Coder
    Join Date
    Aug 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Bump...

  4. #19
    New Coder
    Join Date
    Aug 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Bump.

  5. #20
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,080
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Plesse look at the posting guidelines.

    5) Do not bump your thread repeatedly when you don't get a response. Sometimes when you post for help, you may not get a response in a timely matter, if at all. Forums aren't wishing wells, and some questions will fall through the cracks. That's a fact of life. It's ok to occasionally bump a thread, but only when done after an ample amount of time (ie: 2-3 days) have passed without a response, and never more than once, . Your thread is no more important than another member's when it comes to the amount of attention it should receive.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  6. #21
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,091
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Plus you have not provided any additional information that had been requested in previous posts in the thread. What do you expect to be answered when some questions remain?

  7. #22
    New Coder
    Join Date
    Aug 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    @Philip M
    Sorry. But it said not to bump unless ample time(2-3 days) was provided. My bumps were a couple weeks apart.

    @jmrker
    I'm not really sure how to explain it. Forget the scrolling problem, it isn't a problem. For the other problem, I need something to activate only when a certain phrase is entered into the input box.

    Code:
    function Say() {
    	WriteLine(output, 'You say ' + input.value + ".");
    	WriteLine(output, 'Nothing happens.');
    }
    This is what will happen most of the time. But I need a way to make it so if "Engage" is stated, something specific will happen. I know I need to use an "if" statement, but I'm not sure exactly what code to use.

  8. #23
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    I guess it could be something like this:
    Code:
    <body>
    Input an action (eat, jump, walk followed by a space and your phrase, ie: Walk down the hill<br>
    <input id="action" />
    <input type="button" value="enter action" onclick="getWords()"/>
    <script type="text/javascript">
    function getWords(){
    var val=document.getElementById("action").value
    var act=val.substring(0,val.indexOf(" ")).toLowerCase();
    var word=val.substring(val.indexOf(" "));
    var acts={jump:function(){
    			alert("you jump"+word)
    			},
    		eat:function(){
    			alert("you eat"+word)
    			},	
    		walk:function(){
    		alert("you walk"+word)
    			}
    	}
    if (!acts[act]){alert("nothing happens")
    return;
    } else{
    acts[act]()
    	}
    }
    
    </script>
    </body>


 
Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •