Thread: Cycle Events Problem

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 Cycle Events Problem 
    Registered Member
    Join Date
    Apr 2013
    Posts
    102
    Thanks given
    5
    Thanks received
    3
    Rep Power
    11
    I seem to have an issue with my Cycle Events. I do have the modified Cycle Event Handler btw. Ok anyways here is the problem. I have setup an earning potential system for players in the wilderness. Tje problem though is that after every (cycle?) The timers seem to count down faster and faster. For example: The timer takes roughly about 3 minutes to complete and give the player some earning potential. However, the next time the timer reaches the said amount, it has happened much faster than the first time, as it takes no where near that 3 minutes. This continues to happen and every time its faster than the time before. Sorry if this is hard to understand it's just really hard for me to explain. I also use cycle events for my overloads, and the same issues happen. After the first time the overload wears off after 5 minutes, and seems to work perfectly, but then the next does doesn't last as long, and the one after that even less, and so on and so forth. Does anyone know what causes this, or where I could look to sort this out?
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Check how the timer is being handled and also what the codes inside look alike and check if you've done something wierd. If you need further help I suggest post relevant code to your issue, so we can address it better.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2013
    Posts
    102
    Thanks given
    5
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    Check how the timer is being handled and also what the codes inside look alike and check if you've done something wierd. If you need further help I suggest post relevant code to your issue, so we can address it better.

    Alright. I still have not figured this out. but here is my code for it.
    Code:
    	public static void addEarningPotential(final Client c) {
    		CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer container) {
    				if (!c.inWild() || c.inFunPk() || c == null) {
    					container.stop();
    					return;
    				}
    				if (c.inWild()) {
    					if (c.epTimer >= 2500) {
    							if (c.earningPotential < 100) {
    								c.earningPotential += 10;
    								c.epTimer = 0;
    								c.sendMessage("<img=1><shad=16718084>Your Earning Potential has increased! It is now at "+ c.earningPotential +"%!");
    							} else  if (c.earningPotential > 90 && c.earningPotential < 100) {
    								c.earningPotential = 100;
    								c.sendMessage("<img=1><shad=16718084>Your Earning Potential is now at 100%!");
    							} else if (c.earningPotential >= 100) {
    								c.earningPotential = 100;
    							}
    						c.epTimer = 0;
    					} else {
    						c.epTimer += 1;
    					}
    				}
    			}
    		
    		@Override
    		public void stop() {
    				
    			}
    		}, 1);
    	}
    One thing I did tamper with though was the
    Code:
    c.epTimer +=1;
    Before it was
    Code:
    c.epTimer++;
    That seemed to keep it a little better but the same thing does happen just after a longer period of time.
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    I do not recommend using 1 ms but rather 600ms since that's rs timing. Then add it respective like 4 or 5 ticks to the time. TEst and see if that'll help better or if it's still the same issue.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Apr 2013
    Posts
    102
    Thanks given
    5
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    I do not recommend using 1 ms but rather 600ms since that's rs timing. Then add it respective like 4 or 5 ticks to the time. TEst and see if that'll help better or if it's still the same issue.
    Ok I see what you are trying to say. Though I am a little confused on how to do this. I am probably just over thinking it, is it just as simple as changing
    Code:
    c.epTimer +=1
    or the
    Code:
    if (c.epTimer >= 2500) {
    ? Or does this need to be completely rewritten?
    Reply With Quote  
     

  6. #6  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by Project-Divine View Post
    Ok I see what you are trying to say. Though I am a little confused on how to do this. I am probably just over thinking it, is it just as simple as changing
    Code:
    c.epTimer +=1
    or the
    Code:
    if (c.epTimer >= 2500) {
    ? Or does this need to be completely rewritten?
    Code:
    	public static void addEarningPotential(final Client c) {
    		CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer container) {
    				if (!c.inWild() || c.inFunPk() || c == null) {
    					container.stop();
    					return;
    				}
    				if (c.inWild()) {
    					if (c.epTimer >= 4) {
    							if (c.earningPotential < 100) {
    								c.earningPotential += 10;
    								c.epTimer = 0;
    								c.sendMessage("<img=1><shad=16718084>Your Earning Potential has increased! It is now at "+ c.earningPotential +"%!");
    							} else  if (c.earningPotential > 90 && c.earningPotential < 100) {
    								c.earningPotential = 100;
    								c.sendMessage("<img=1><shad=16718084>Your Earning Potential is now at 100%!");
    							} else if (c.earningPotential >= 100) {
    								c.earningPotential = 100;
    							}
    System.out.print("pass time = "+c.epTimer);
    						c.epTimer = 0;
    					} else {
    						c.epTimer += 1;
    					}
    				}
    			}
    		
    		@Override
    		public void stop() {
    				
    			}
    		}, 600);
    	}


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Apr 2013
    Posts
    102
    Thanks given
    5
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    Code:
    	public static void addEarningPotential(final Client c) {
    		CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer container) {
    				if (!c.inWild() || c.inFunPk() || c == null) {
    					container.stop();
    					return;
    				}
    				if (c.inWild()) {
    					if (c.epTimer >= 4) {
    							if (c.earningPotential < 100) {
    								c.earningPotential += 10;
    								c.epTimer = 0;
    								c.sendMessage("<img=1><shad=16718084>Your Earning Potential has increased! It is now at "+ c.earningPotential +"%!");
    							} else  if (c.earningPotential > 90 && c.earningPotential < 100) {
    								c.earningPotential = 100;
    								c.sendMessage("<img=1><shad=16718084>Your Earning Potential is now at 100%!");
    							} else if (c.earningPotential >= 100) {
    								c.earningPotential = 100;
    							}
    System.out.print("pass time = "+c.epTimer);
    						c.epTimer = 0;
    					} else {
    						c.epTimer += 1;
    					}
    				}
    			}
    		
    		@Override
    		public void stop() {
    				
    			}
    		}, 600);
    	}
    Ah yes will try this lol. Completely forgot about that.

    Edit: This code seems to be working better. However there are still times when the timer goes faster, and then the next time doesn't seem to go as fast. I'm not sure if it's just me or not but this is working a lot better. If you have any other suggestions please let me know.
    Last edited by Project-Divine; 06-20-2015 at 04:04 AM. Reason: More information
    Reply With Quote  
     

  8. #8  
    Banned Cycle Events Problem Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by arch337 View Post
    I do not recommend using 1 ms but rather 600ms since that's rs timing. Then add it respective like 4 or 5 ticks to the time. TEst and see if that'll help better or if it's still the same issue.
    What... that isn't 1ms it's 1 tick which is equivalent to 600ms lol
    Reply With Quote  
     

  9. Thankful users:


  10. #9  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by lare96 View Post
    What... that isn't 1ms it's 1 tick which is equivalent to 600ms lol
    I can tell that his is an old event timer which uses a set ms cycle.

    Quote Originally Posted by Project-Divine View Post
    Ah yes will try this lol. Completely forgot about that.

    Edit: This code seems to be working better. However there are still times when the timer goes faster, and then the next time doesn't seem to go as fast. I'm not sure if it's just me or not but this is working a lot better. If you have any other suggestions please let me know.
    Probely cause your using quite an old event timer and could be some errors with it. Either that or how you've starting the event.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Apr 2013
    Posts
    102
    Thanks given
    5
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    I can tell that his is an old event timer which uses a set ms cycle.



    Probely cause your using quite an old event timer and could be some errors with it. Either that or how you've starting the event.
    The event is started when a player enters the wilderness, One thing I've noticed now after testing it out more is that sometimes the timer will reach said amount twice in rapid succession. And then it will carry on as normal for a couple of cycles and do it again. All while the timer still seems to be going faster and faster again. It must be something just wrong with the cycle events lol.. Any ideas?
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. Replies: 0
    Last Post: 12-03-2011, 02:47 AM
  2. Replies: 2
    Last Post: 05-22-2011, 06:17 AM
  3. Replies: 5
    Last Post: 11-11-2010, 03:52 AM
  4. Event Problem
    By digistr in forum Help
    Replies: 0
    Last Post: 07-10-2009, 02:47 AM
  5. agility event problem
    By Knova in forum Help
    Replies: 36
    Last Post: 06-11-2009, 05: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
  •