View Single Post
  #4  
Old 02-16-2010, 10:53 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You can't use while loops like that in Graal; it will hit a max loop limit. Either way, it's best to just use the onKeyPressed event.

I would probably do it somewhat like this:

PHP Code:
//#CLIENTSIDE
function startFishing() {
  
this.isFishing true;
  
this.onNextFish();
}

function 
onNextFish() {
  
this.keyToPress int(random(04));
  
  
this.cancelEvents("nextFish");
  
this.scheduleEvent(3"nextFish"null);
}

function 
onKeyPressed(codekey) {
  if (! 
this.isFishing) {
    return;
  }
  
  for (
temp.04++) {
    if (
keydown(i)) {
      if (
this.keyToPress == i) {
        
this.caughtFish();
      }
      
      
// next fish
      
this.onNextFish();
      break;
    }
  }

You'll need to add in images and such, and I haven't tested it so it may not work for some reason, not sure.
__________________
Reply With Quote