Thread: Delaying actions when you click an object?

Results 1 to 10 of 10
  1. #1 Delaying actions when you click an object? 
    Registered Member

    Join Date
    Oct 2012
    Posts
    397
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    I want to make it so when you click an object, you have to wait 5 seconds before you can click it again. How would I do this? Here is an example in the clickobject class:

    case 245:
    c.sendMessage("Wait 5 seconds..");
    (make it wait 5 seconds here)
    c.startAnimation(200); (after the 5 seconds is over)
    break;
    And than make it wait 5 seconds until you can pull it again.

    I'll rep if you can do this. Thanks

    inb4ninthcallsmeanoob
    Reply With Quote  
     

  2. #2  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    LOL @ BOTTOM!

    I could write this.


    If you wait till Sunday:/

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Oct 2012
    Posts
    397
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    Why sunday? but yeah I can wait unless someone else writes it. Thanks
    Reply With Quote  
     

  4. #4  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    [Only registered and activated users can see links. ]
    You could copy this and just take away the moving part.

    & I'm on my phone only till Sunday.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Oct 2012
    Posts
    397
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    Oh god, I have no idea how I could replace that
    Reply With Quote  
     

  6. #6  
    q.q


    Join Date
    Dec 2010
    Posts
    6,535
    Thanks given
    1,072
    Thanks received
    3,534
    Rep Power
    4752
    Code:
    long objectDelay;
    Code:
    case 245:
    if (System.currentTimeMillis() - objectDelay > 5000) {
      c.startAnimation(200); (after the 5 seconds is over)
       objectDelay = System.currentTimeMillis();
    } else {
    c.sendMessage("Wait 5 seconds..");
    }
    break;
    Reply With Quote  
     

  7. #7  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Just write the entire thing but then change the anim and how it moves you to what you want(;

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Oct 2012
    Posts
    397
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    src\server\model\players\packets\ClickObject.java: 96: variable objectDelay might
    not have been initialized
    if (System.currentTimeMillis() - objectDelay > 5
    000) {
    ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Reply With Quote  
     

  9. #9  
    q.q


    Join Date
    Dec 2010
    Posts
    6,535
    Thanks given
    1,072
    Thanks received
    3,534
    Rep Power
    4752
    use common sense pls
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Oct 2012
    Posts
    397
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    Java isn't common sense.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. object actions
    By qpanel in forum Help
    Replies: 2
    Last Post: 06-20-2012, 08:40 AM
  2. when i click on object is says the object ids
    By Obito Uchiha in forum Help
    Replies: 13
    Last Post: 04-19-2012, 01:11 PM
  3. Replies: 7
    Last Post: 12-07-2011, 12:56 AM
  4. Replies: 22
    Last Post: 11-24-2010, 12:34 AM
  5. Object Actions in TestScape (noob-friendly)
    By LandScape in forum Tutorials
    Replies: 0
    Last Post: 05-19-2007, 01:52 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •