Thread: Hourly Event Executer Help [718] RESOLVED

Results 1 to 4 of 4
  1. #1 Hourly Event Executer Help [718] RESOLVED 
    Registered Member
    Edimmu's Avatar
    Join Date
    Jun 2012
    Age
    30
    Posts
    1,098
    Thanks given
    37
    Thanks received
    119
    Rep Power
    98
    So I'm trying to execute events hourly (so on the hour just how RS do theirs) and I'm having a bit of an issue and not really understanding why this isn't working. It is placed and called within Launcher.java
    Code:
    public static void eventExecuter() {
    		Date date = new Date();
    		int hours = date.getHours();
    		int minutes = date.getMinutes();
    		int seconds = date.getSeconds();
    		int[][] times = {{ 0, 0, 0 }, { 1, 0, 0 }, { 2, 0, 0 }, { 3, 0, 0 },
    				{ 4, 0, 0 }, { 5, 0, 0 }, {6, 0, 0 }, { 6, 0, 0 }, { 7, 0, 0 },
    				{ 8, 0, 0 }, { 9, 0, 0 }, { 10, 0, 0 }, { 11, 0, 0 }, { 12, 0, 0 },
    				{ 13, 0, 0 }, { 14, 0, 0 }, { 15, 0, 0 }, { 16, 0, 0 }, { 17, 0, 0 },
    				{ 18, 0, 0 }, { 19, 0, 0 }, { 20, 0, 0 }, { 21, 0, 0 }, { 22, 0, 0 },
    				{ 23, 0, 0 } };
    		for (int i = 0; i < times.length; i++) {
    			if (hours == times[i][0] && minutes == times[i][1] && seconds == times[i][2]) {
    				System.out.println("Hi");
    			}
    		}
    	}
    Any help will be greatly appreciated
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Edimmu View Post
    So I'm trying to execute events hourly (so on the hour just how RS do theirs) and I'm having a bit of an issue and not really understanding why this isn't working. It is placed and called within Launcher.java
    Code:
    public static void eventExecuter() {
    		Date date = new Date();
    		int hours = date.getHours();
    		int minutes = date.getMinutes();
    		int seconds = date.getSeconds();
    		int[][] times = {{ 0, 0, 0 }, { 1, 0, 0 }, { 2, 0, 0 }, { 3, 0, 0 },
    				{ 4, 0, 0 }, { 5, 0, 0 }, {6, 0, 0 }, { 6, 0, 0 }, { 7, 0, 0 },
    				{ 8, 0, 0 }, { 9, 0, 0 }, { 10, 0, 0 }, { 11, 0, 0 }, { 12, 0, 0 },
    				{ 13, 0, 0 }, { 14, 0, 0 }, { 15, 0, 0 }, { 16, 0, 0 }, { 17, 0, 0 },
    				{ 18, 0, 0 }, { 19, 0, 0 }, { 20, 0, 0 }, { 21, 0, 0 }, { 22, 0, 0 },
    				{ 23, 0, 0 } };
    		for (int i = 0; i < times.length; i++) {
    			if (hours == times[i][0] && minutes == times[i][1] && seconds == times[i][2]) {
    				System.out.println("Hi");
    			}
    		}
    	}
    Any help will be greatly appreciated
    Just look at an example of a "WorldTask" anywhere in the package and copy that.
    Project thread
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    Attached image
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Registered Member
    Edimmu's Avatar
    Join Date
    Jun 2012
    Age
    30
    Posts
    1,098
    Thanks given
    37
    Thanks received
    119
    Rep Power
    98
    Don't worry resolved. All events now work on the hour
    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. Error with event? please help >.<
    By silabgarza in forum Help
    Replies: 4
    Last Post: 01-30-2010, 09:35 AM
  2. Event manager help - Making it work?
    By Akeid in forum Help
    Replies: 0
    Last Post: 12-21-2009, 04:53 AM
  3. Event manager help
    By Mental Piracy in forum Help
    Replies: 0
    Last Post: 07-18-2009, 06:43 PM
  4. Problem With Events Please HELP!
    By digistr in forum Help
    Replies: 2
    Last Post: 07-07-2009, 08:24 AM
  5. Event Manager help
    By Rabid Butterfly in forum Help
    Replies: 8
    Last Post: 02-01-2009, 05:46 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
  •