Thread: Can someone PLEASE help with a timer [PI]

Results 1 to 10 of 10
  1. #1 Can someone PLEASE help with a timer [PI] 
    Registered Member
    IngeniousPentaSquid's Avatar
    Join Date
    Jun 2011
    Age
    28
    Posts
    993
    Thanks given
    47
    Thanks received
    140
    Rep Power
    79
    Base: PI
    Compiling Errors:None

    Pictures:

    Code: This is all in client.java

    I have declared my summonTime integer here at the top here
    Code:
    	public int currentDamage = 0;
    	public int summonTime = 60;
    	public int followPlayer;
    	public int npcslot;
    Then after a couple of scroll downs I have this code
    Code:
    				public void summonTime() {
    		if(summonTime >= 0 && lastsummon > 0) {
    			summonTime --; 
    			}
    			if(summonTime == 0) {
    			sendMessage("Your summoning pet time has run out...");
    			lastsummon = 0;
    			summonTime = -1;
    			}
    		}

    Yes?

    Now viewing it comes here: with these
    Code:
    			safeTimer = 0;
    			getItems().resetItems(3214);
    			getItems().sendWeapon(playerEquipment[playerWeapon], getItems().getItemName(playerEquipment[playerWeapon]));
    			getItems().resetBonus();
    			getItems().getBonus();
    			getPA().sendFrame126("Combat Level: "+getCombatLevel()+"", 3983);
    			getPA().sendFrame126(""+getCombatLevel()+"", 17025);
    			getPA().sendFrame126(""+summonTime+"", 17021);			
    			getItems().writeBonus();
    with all of that...

    and as you can see in the .gif nothing fucking works this is 5th day trying so annoying now... if anyone could please help:crybaby:
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Nov 2009
    Posts
    1,800
    Thanks given
    7
    Thanks received
    18
    Rep Power
    0
    Where is lastSummon defined?
    Reply With Quote  
     

  3. #3  
    Registered Member
    IngeniousPentaSquid's Avatar
    Join Date
    Jun 2011
    Age
    28
    Posts
    993
    Thanks given
    47
    Thanks received
    140
    Rep Power
    79
    the very top...
    here:
    [code]
    public class Client extends Player {
    public byte buffer[] = null;
    public int cannonTimer = 0;
    public int s;
    public Stream inStream = null, outStream = null;
    private IoSession session;
    public static PlayerSave save;
    public static Client cliento2;
    public int totalstored;
    public int currentDamage = 0;
    public int summonTime = 60;
    public int followPlayer;
    public int npcslot;
    public int summoningnpcid;
    public int timer;
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Nov 2009
    Posts
    1,800
    Thanks given
    7
    Thanks received
    18
    Rep Power
    0
    Quote Originally Posted by trollingfaces View Post
    the very top...
    here:
    [code]
    public class Client extends Player {
    public byte buffer[] = null;
    public int cannonTimer = 0;
    public int s;
    public Stream inStream = null, outStream = null;
    private IoSession session;
    public static PlayerSave save;
    public static Client cliento2;
    public int totalstored;
    public int currentDamage = 0;
    public int summonTime = 60;
    public int followPlayer;
    public int npcslot;
    public int summoningnpcid;
    public int timer;
    I don't see it.
    Reply With Quote  
     

  5. #5  
    Registered Member
    IngeniousPentaSquid's Avatar
    Join Date
    Jun 2011
    Age
    28
    Posts
    993
    Thanks given
    47
    Thanks received
    140
    Rep Power
    79
    wheres the ints are declared @ the top
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Nov 2009
    Posts
    1,800
    Thanks given
    7
    Thanks received
    18
    Rep Power
    0
    Quote Originally Posted by trollingfaces View Post
    wheres the ints are declared @ the top
    Please highlight the integer lastsummon for me.
    Reply With Quote  
     

  7. #7  
    Registered Member
    IngeniousPentaSquid's Avatar
    Join Date
    Jun 2011
    Age
    28
    Posts
    993
    Thanks given
    47
    Thanks received
    140
    Rep Power
    79
    wwwoooops rofl, i thought you meant summonTime stupid dumbass that I am..


    here

    Code:
    	public int summoningslot = 0;
    
    	public int storeditems[] = new int[29];
    
    	public boolean picking = false;
    
    	public int amount[] = new int[29];
    	public boolean occupied[] = new boolean[29];
    
    	public boolean storing = false;
    
    	
    	public int attackingplayer;
    	public int lastsummon;
    	public int summonTime;
    	public boolean summon;
    	
    	
    	public int secs;
    	public int mins;
    	public int hours;
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Nov 2009
    Posts
    1,800
    Thanks given
    7
    Thanks received
    18
    Rep Power
    0
    Quote Originally Posted by trollingfaces View Post
    wwwoooops rofl, i thought you meant summonTime stupid dumbass that I am..


    here

    Code:
    	public int summoningslot = 0;
    
    	public int storeditems[] = new int[29];
    
    	public boolean picking = false;
    
    	public int amount[] = new int[29];
    	public boolean occupied[] = new boolean[29];
    
    	public boolean storing = false;
    
    	
    	public int attackingplayer;
    	public int lastsummon;
    	public int summonTime;
    	public boolean summon;
    	
    	
    	public int secs;
    	public int mins;
    	public int hours;
    As you've written "public int lastsummon;" rather than "public int lastsummon = 0;" it has been given a null value. Try changing that to 1 or 0 (cheaphax) or in the method where the NPC is summoned add this code. (fixing properly)
    Code:
    lastsummon = 1;
    And where the NPC is removed add this code.
    Code:
    lastsummon = 0;
    Reply With Quote  
     

  9. #9  
    Registered Member
    IngeniousPentaSquid's Avatar
    Join Date
    Jun 2011
    Age
    28
    Posts
    993
    Thanks given
    47
    Thanks received
    140
    Rep Power
    79
    Quote Originally Posted by Demise View Post
    As you've written "public int lastsummon;" rather than "public int lastsummon = 0;" it has been given a null value. Try changing that to 1 or 0 (cheaphax) or in the method where the NPC is summoned add this code. (fixing properly)
    Code:
    lastsummon = 1;
    And where the NPC is removed add this code.
    Code:
    lastsummon = 0;
    I don't think I should do that as...
    in clickingbuttons.java and other summoning instances lastsummon; is a main int.

    e.g.
    Code:
    			case 66117://button id 
    				switch(c.lastsummon) {
    					case 6823: //unicorn :D
    						if (c.getItems().playerHasItem(12434, 1)) {
    							c.getItems().deleteItem(12434, 1);
    							c.gfx0(247);
    							c.playerLevel[3] += (c.getLevelForXP(c.playerXP[3]) * .33);
    						if (c.playerLevel[3] > c.getLevelForXP(c.playerXP[3]))
    							c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
    							c.getPA().refreshSkill(3);
    							c.sendMessage("You activate the scroll.");
    							c.getPA().refreshSkill(1);
    							c.getPA().refreshSkill(3);
    							c.getPA().refreshSkill(3);
    							c.sendMessage("You heal yourself...and feel slightly rejuvenated");
    						} else {
    							c.sendMessage("You don't have a summon scroll!");
    						}
    lastsummon is preventing other people from using scrolls on someone els'es nPC
    Reply With Quote  
     

  10. #10  
    Registered Member
    IngeniousPentaSquid's Avatar
    Join Date
    Jun 2011
    Age
    28
    Posts
    993
    Thanks given
    47
    Thanks received
    140
    Rep Power
    79
    48hr bump.

    I managed to get something to work... i guess :L i used theowner's snipper and here is what I get.

    Code:
    		public int secs;
    		public int mins;
    		public int hours;
    
    		public void spawnTimer() {
    		spawnTimer();
    		EventManager.getSingleton().addEvent(new Event() {
    		public void execute(EventContainer b) {
    		secs++;
    		mins = secs/60;
    		hours = secs/3600;
    		getPA().sendFrame126(""+mins+"", 17021);
    
    		if(lastsummon < 0) {
    		b.stop();
    		}
    
    		}
    		}, 1000);
    		}
    do i have to change the
    Code:
     public int secs;
    to
    Code:
     public int secs = 1800; to get 30 mins
    ?

    or do something like this?

    Code:
    		switch(lastsummon) {
    			
    			case 6823:
    			secs = 1800;
    			break;
    			}
    but that does not work for me .. btw I have called the event.

    it just stays like this no matter what D:



    can someone help me?
    ©®
    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. [PI] Pk Timer - Safe Timer [PI]
    By Trivzor in forum Tutorials
    Replies: 43
    Last Post: 06-24-2014, 07:49 AM
  2. Replies: 6
    Last Post: 06-07-2011, 02:10 PM
  3. Pvp Timer Rep++ PI
    By Neekage in forum Help
    Replies: 24
    Last Post: 01-31-2011, 07:42 PM
  4. more then one timer?
    By Balla in forum Help
    Replies: 10
    Last Post: 08-29-2009, 08:24 PM
  5. Pj Timer
    By The Father Squirrel in forum RS2 Server
    Replies: 19
    Last Post: 05-09-2009, 01:49 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •