Thread: [PI] 1 Object using Cycle event timers

Results 1 to 4 of 4
  1. #1 [PI] 1 Object using Cycle event timers 
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    Hello, I'm trying to add a Hole Teleport going 2 ways, It works great But i'm just trying to figure out how I can add a Timer like This one Other Object I have here.

    here is a example With no timers, the one I want to add timers to.
    Code:
    		case 14922:
    			if (c.objectX == 2344 && c.objectY == 3654) {
    				c.startAnimation(2589)	
    				c.getPA().movePlayer(2344, 3650, 0);
    			} else if (c.objectX == 2344 && c.objectY == 3651) {
    				c.startAnimation(2589);
    					c.getPA().movePlayer(2344, 3655, 0);	
    			}
    			break;
    And The Object At Ge that has timers, but also has 2 seperate id's for for teleporting.
    Code:
    		case 9312:
    			c.startAnimation(2589);
    			CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    				@Override
    				public void execute(CycleEventContainer e) {
    					c.getPA().movePlayer(3138, 3516, 0);
    					e.stop();
    				}
    
    				public void stop() {}	
    			}, 2);
    			break;
    If anyone can paste below a code for me to use, repp++
    Reply With Quote  
     

  2. #2  
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,499
    Thanks given
    204
    Thanks received
    324
    Rep Power
    588
    Im confused on what your asking you want a timer added to this code? And how long of a timer. 400ms?

    Code:
    		case 14922:
    			if (c.objectX == 2344 && c.objectY == 3654) {
    				c.startAnimation(2589)	
    				c.getPA().movePlayer(2344, 3650, 0);
    			} else if (c.objectX == 2344 && c.objectY == 3651) {
    				c.startAnimation(2589);
    					c.getPA().movePlayer(2344, 3655, 0);	
    			}
    			break;
    If you want to just add a timer to it make it a teleport instead of move player.

    Just live life at its fullest.

    LOL
    Reply With Quote  
     

  3. #3  
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    Quote Originally Posted by Organic View Post
    Im confused on what your asking you want a timer added to this code? And how long of a timer. 400ms?

    Code:
    		case 14922:
    			if (c.objectX == 2344 && c.objectY == 3654) {
    				c.startAnimation(2589)	
    				c.getPA().movePlayer(2344, 3650, 0);
    			} else if (c.objectX == 2344 && c.objectY == 3651) {
    				c.startAnimation(2589);
    					c.getPA().movePlayer(2344, 3655, 0);	
    			}
    			break;
    If you want to just add a timer to it make it a teleport instead of move player.
    Yes I would like a timer under case 14922, and 400 ms is fine.
    Reply With Quote  
     

  4. #4  
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,499
    Thanks given
    204
    Thanks received
    324
    Rep Power
    588
    Code:
    c.startAnimation(2589);
    			CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    				@Override
    				public void execute(CycleEventContainer e) {
    			if (c.objectX == 2344 && c.objectY == 3654) {
    				c.startAnimation(2589)	
    				c.getPA().movePlayer(2344, 3650, 0);
    			} else if (c.objectX == 2344 && c.objectY == 3651) {
    				c.startAnimation(2589);
    					c.getPA().movePlayer(2344, 3655, 0);	
    			}
    					e.stop();
    				}
    
    				public void stop() {}	
    			}, 1)
    If this isn't what you wanted play around with the cycle events, maybe even add 2 cycle events to achieve what you want.

    Just live life at its fullest.

    LOL
    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. My EP gaining in wild (Uses Cycle Events)
    By Revival in forum Snippets
    Replies: 23
    Last Post: 09-15-2012, 09:19 PM
  2. [PI] Basic Use Item on Object Distance Check
    By Aleksandr in forum Snippets
    Replies: 1
    Last Post: 09-18-2011, 12:56 AM
  3. [PI] Object Training Timer [Rep+ & Thanks]
    By FreekySteve69 in forum Help
    Replies: 4
    Last Post: 07-19-2011, 12:42 PM
  4. [PI] Object timer to spawn an object
    By gunnar in forum Help
    Replies: 4
    Last Post: 07-15-2011, 11:53 AM
  5. Replies: 0
    Last Post: 03-05-2009, 08:34 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •