Thread: mining timer help

Results 1 to 9 of 9
  1. #1 mining timer help 
    Registered Member
    Join Date
    Nov 2010
    Posts
    53
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Code:
     public int getMiningTimer(int ore) {
    		int time = Misc.random(5);
    		if (ore == 451) {
    			time += 15;
    		}
    		return time;

    how do i make a timer for copper,tin,iron,mith,addy?

    also what dose int time = misc.random (5); mean? dose it mean takes 5 hits to get 1 ore?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jun 2012
    Posts
    66
    Thanks given
    2
    Thanks received
    6
    Rep Power
    13
    Quote Originally Posted by barrag3 View Post
    Code:
     public int getMiningTimer(int ore) {
    		int time = Misc.random(5);
    		if (ore == 451) {
    			time += 15;
    		}
    		return time;



    how do i make a timer for copper,tin,iron,mith,addy?

    also what dose int time = misc.random (5); mean? dose it mean takes 5 hits to get 1 ore?
    The
    Code:
     if (ore == 451)
    is the ID of the iron ore. Copy and paste all of it and change the 451 to whatever the ID of addy ore ect is
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by b I l l y View Post
    The
    Code:
     if (ore == 451)
    is the ID of the iron ore. Copy and paste all of it and change the 451 to whatever the ID of addy ore ect is
    just do this
    Code:
     if (ore == 451 || ID || ID || ID)
    Reply With Quote  
     

  4. #4  
    Ignorance is always an excuse

    Mikee's Avatar
    Join Date
    Nov 2009
    Posts
    2,370
    Thanks given
    732
    Thanks received
    490
    Rep Power
    656
    Misc.random(5) will return a number from 0-5 so every ore will take from 0-5 ticks for you to receive your ore unless the ore is 451 then it will be 15-20 ticks.



    The day Aj repped me, my life changed forever
    Quote Originally Posted by Aj View Post
    Rep++ for you
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2010
    Posts
    53
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by ipkmills View Post
    just do this
    Code:
     if (ore == 451 || ID || ID || ID)
    if i add iron n etc like that time += 15; isn't it going to follow one timer?
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    May 2013
    Posts
    1,169
    Thanks given
    28
    Thanks received
    133
    Rep Power
    53
    Quote Originally Posted by barrag3 View Post
    if i add iron n etc like that time += 15; isn't it going to follow one timer?
    It'll use the same formula, but since time = Misc.random(5) it could be different or similar depending on what number is drawn from Misc.random(5) which is a number 0-5 I believe
    If only I hadn't given you up, my life could've been different.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2010
    Posts
    53
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by True Faith View Post
    It'll use the same formula, but since time = Misc.random(5) it could be different or similar depending on what number is drawn from Misc.random(5) which is a number 0-5 I believe
    could i add brackets so it follows different misc random?
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    May 2013
    Posts
    1,169
    Thanks given
    28
    Thanks received
    133
    Rep Power
    53
    Quote Originally Posted by barrag3 View Post
    could i add brackets so it follows different misc random?
    Can change your if statement into a switch statement or you can leave it as an if statement

    switch (ore) {
    case 451:
    return time += 15;
    case NEXTOREID:
    return TIMEYOUWANT;
    }

    if (ore == 451) {
    time += 15;
    } else if (ore == NEXTOREID) {
    TIMEYOUWANT;
    }
    If only I hadn't given you up, my life could've been different.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Nov 2010
    Posts
    53
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by True Faith View Post
    Can change your if statement into a switch statement or you can leave it as an if statement

    switch (ore) {
    case 451:
    return time += 15;
    case NEXTOREID:
    return TIMEYOUWANT;
    }

    if (ore == 451) {
    time += 15;
    } else if (ore == NEXTOREID) {
    TIMEYOUWANT;
    }

    thanks so much!!
    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. [DELTA] Log out timers? [HELP]
    By :-:Jack:-: in forum Help
    Replies: 2
    Last Post: 08-08-2009, 07:21 PM
  2. fight pits timer help
    By Ramsin in forum Help
    Replies: 0
    Last Post: 07-13-2009, 10:43 PM
  3. Castle wars timer help please
    By ~tehpk~ in forum Requests
    Replies: 1
    Last Post: 06-05-2009, 07:12 PM
  4. [508] Timer help[508]
    By Glabay in forum Requests
    Replies: 4
    Last Post: 10-15-2008, 02:20 PM
  5. Delay Timer Help Tutorial
    By Ian... in forum Tutorials
    Replies: 15
    Last Post: 05-12-2008, 02:56 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
  •