Thread: [Delta] Fishing Timer

Results 1 to 6 of 6
  1. #1 [Delta] Fishing Timer 
    Registered Member rockin's Avatar
    Join Date
    Oct 2007
    Posts
    43
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    I'm adding fishing to my delta source. But, as of now it can be massed clicked, and I don't know how to get a timer for delta. Here's my fishing code:

    Code:
    else if (NPCID == 1399) { // lobs
    for(int lob = 0; lob < 28; lob++);
    if(playerLevel[10] >= 40);
    if(timer <= 0); 
    timer -= 5;
    addItem(377, 1);
    startAnimation(619);
    addSkillXP(250, 10);
    sM("You catch a Lobster");
    updateRequired = true; 
    appearanceUpdateRequired = true;
    } else if(playerLevel[10] <= 40) {
    sM("You need a fishing level of 40 to catch Lobsters");
    }
    The timer I put it in there doesn't work.

    Also, I have some ints declared.

    Code:
    public static int timer = 0;
    Thanks in advance.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Dec 2007
    Age
    32
    Posts
    551
    Thanks given
    0
    Thanks received
    2
    Rep Power
    503
    Code:
    else if (NPCID == 1399) { // lobs
    for(int lob = 0; lob < 28; lob++);
    if(playerLevel[10] >= 40);
    if(timer <= 0); 
    addItem(377, 1);
    startAnimation(619);
    addSkillXP(250, 10);
    sM("You catch a Lobster");
    timer = 10;
    updateRequired = true; 
    appearanceUpdateRequired = true;
    } else if(playerLevel[10] <= 40) {
    sM("You need a fishing level of 40 to catch Lobsters");
    }
    Reply With Quote  
     

  3. #3  
    Registered Member rockin's Avatar
    Join Date
    Oct 2007
    Posts
    43
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Quote Originally Posted by BlessTheFall View Post
    Code:
    else if (NPCID == 1399) { // lobs
    for(int lob = 0; lob < 28; lob++);
    if(playerLevel[10] >= 40);
    if(timer <= 0); 
    addItem(377, 1);
    startAnimation(619);
    addSkillXP(250, 10);
    sM("You catch a Lobster");
    timer = 10;
    updateRequired = true; 
    appearanceUpdateRequired = true;
    } else if(playerLevel[10] <= 40) {
    sM("You need a fishing level of 40 to catch Lobsters");
    }
    I just put that in, and it can still be mass clicked.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Dec 2007
    Age
    32
    Posts
    551
    Thanks given
    0
    Thanks received
    2
    Rep Power
    503
    Quote Originally Posted by rockin View Post
    I just put that in, and it can still be mass clicked.
    Declare,

    Code:
    public long fishTimer = 0;
    An then,

    Code:
    else if (NPCID == 1399) { // lobs
    for(int lob = 0; lob < 28; lob++);
    if(playerLevel[10] >= 40) {
        if (System.currentTimeMillis() - fishTimer >= 1000) {
            timer -= 5;
            addItem(377, 1);
            startAnimation(619);
            addSkillXP(250, 10);
            sM("You catch a Lobster");
            updateRequired = true; 
            appearanceUpdateRequired = true;
            fishTimer = System.currentTimeMillis();
        }
    } else if(playerLevel[10] <= 40) {
    sM("You need a fishing level of 40 to catch Lobsters");
    }
    Reply With Quote  
     

  5. #5  
    Registered Member rockin's Avatar
    Join Date
    Oct 2007
    Posts
    43
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Ok, well I put that new code in, got 100 errors. Then I switched it to look like this.

    Code:
    else if (NPCID == 1399) { // lobs
    for(int lob = 0; lob < 28; lob++);
    if(playerLevel[10] >= 40) {
        if (System.currentTimeMillis() - fishTimer >= 1000);
            timer -= 5;
            addItem(377, 1);
            startAnimation(619);
            addSkillXP(250, 10);
            sM("You catch a Lobster");
            updateRequired = true; 
            appearanceUpdateRequired = true;
            fishTimer = System.currentTimeMillis();
        }
    } else if(playerLevel[10] <= 40) {
    sM("You need a fishing level of 40 to catch Lobsters");
    }
    Took out the "{" on the end of "if (System.currentTimeMillis() - fishTimer >= 1000)" and it still isn't working.

    Sorry if I'm not getting it.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Hunter's Avatar
    Join Date
    Jun 2009
    Age
    33
    Posts
    857
    Thanks given
    3
    Thanks received
    23
    Rep Power
    216
    Quote Originally Posted by rockin View Post
    Ok, well I put that new code in, got 100 errors. Then I switched it to look like this.

    Code:
    else if (NPCID == 1399) { // lobs
    for(int lob = 0; lob < 28; lob++);
    if(playerLevel[10] >= 40) {
        if (System.currentTimeMillis() - fishTimer >= 1000);
            timer -= 5;
            addItem(377, 1);
            startAnimation(619);
            addSkillXP(250, 10);
            sM("You catch a Lobster");
            updateRequired = true; 
            appearanceUpdateRequired = true;
            fishTimer = System.currentTimeMillis();
        }
    } else if(playerLevel[10] <= 40) {
    sM("You need a fishing level of 40 to catch Lobsters");
    }
    Took out the "{" on the end of "if (System.currentTimeMillis() - fishTimer >= 1000)" and it still isn't working.

    Sorry if I'm not getting it.
    Well I can see your problem .. you have a semi-colon after the for() statement where there should be a {

    Code:
    else if (NPCID == 1399) { // lobs
    	for(int lob = 0; lob < 28; lob++) {
    		if(playerLevel[10] >= 40) {
    			if (System.currentTimeMillis() - fishTimer >= 1000) {
    				timer -= 5;
    				addItem(377, 1);
    				startAnimation(619);
    				addSkillXP(250, 10);
    				sM("You catch a Lobster");
    				updateRequired = true; 
    				appearanceUpdateRequired = true;
    				fishTimer = System.currentTimeMillis();
    			}
    		}
    		else if(playerLevel[10] <= 40) {
    			sM("You need a fishing level of 40 to catch Lobsters");
    		}
    	}
    }
    Also, make sure your brackets add up.. 1 } for each {
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •