Thread: [PI] Multiple bones on altar.

Results 1 to 10 of 10
  1. #1 [PI] Multiple bones on altar. 
    Registered Member
    Join Date
    Jul 2015
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Hello. i used this snippet http://www.rune-server.org/runescape...altar-gfx.html

    and i get this error please help.
    Code:
    src\server\model\players\packets\ItemOnObject.java :33: error: cannot find symbol
    
    Prayer.useBonesOnAltar(c, objectId, itemId); break;
    ^
    symbol: method useBonesOnAltar(Client,int,int)
    location: class Prayer
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    what to do here i dont understand please help...
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2012
    Posts
    286
    Thanks given
    7
    Thanks received
    49
    Rep Power
    25
    Instead of
    Code:
    Prayer.useBonesOnAltar(c, objectId, itemId); break;
    Use
    Code:
    c.prayer.handleBones(itemId, true)
    and want to create an instance of prayer in your client with
    Code:
    Prayer prayer;
    above the constructor and
    Code:
    prayer = new Prayer(this)
    in the constructor of the client

    Alternatively you can change
    Code:
    public void handleBones(int boneID, boolean altar) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    	}
    to
    Code:
    public static void handleBones(int boneID, boolean altar, Client c) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    	}
    And call
    Code:
    handleBones(itemId, true, c);
    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 juuuuu View Post
    Instead of
    Code:
    Prayer.useBonesOnAltar(c, objectId, itemId); break;
    Use
    Code:
    c.prayer.handleBones(itemId, true)
    and want to create an instance of prayer in your client with
    Code:
    Prayer prayer;
    above the constructor and
    Code:
    prayer = new Prayer(this)
    in the constructor of the client

    Alternatively you can change
    Code:
    public void handleBones(int boneID, boolean altar) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    	}
    to
    Code:
    public static void handleBones(int boneID, boolean altar, Client c) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    	}
    And call
    Code:
    handleBones(itemId, true, c);
    no just no

    import the prayer class
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Dec 2010
    Posts
    1,982
    Thanks given
    174
    Thanks received
    256
    Rep Power
    223
    Oh yes, let's instance a Prayer class, that sounds logical.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member

    Join Date
    Jun 2013
    Posts
    1,083
    Thanks given
    78
    Thanks received
    162
    Rep Power
    104
    import the prayer class
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    May 2012
    Posts
    286
    Thanks given
    7
    Thanks received
    49
    Rep Power
    25
    Quote Originally Posted by Someone View Post
    Oh yes, let's instance a Prayer class, that sounds logical.
    Considering the handleBones method isn't static you have to instance it, or make it static.
    You do understand your comments are probably quite confusing for the people you supposedly are trying to help? I'd recommend you consider to not post your comments when you clearly have no idea what you are talking about
    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Dec 2010
    Posts
    1,982
    Thanks given
    174
    Thanks received
    256
    Rep Power
    223
    Quote Originally Posted by juuuuu View Post
    Considering the handleBones method isn't static you have to instance it, or make it static.
    You do understand your comments are probably quite confusing for the people you supposedly are trying to help? I'd recommend you consider to not post your comments when you clearly have no idea what you are talking about
    Am implying you should make it static, don't make broad statements. A solution was already suggested, I just disagreed with your suggestion of instancing it.

    Code:
    public static void handleBones(int boneID, boolean altar, Client c) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    	}
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    May 2012
    Posts
    286
    Thanks given
    7
    Thanks received
    49
    Rep Power
    25
    Quote Originally Posted by Someone View Post
    Am implying you should make it static, don't make broad statements. A solution was already suggested, I just disagreed with your suggestion of instancing it.

    Code:
    public static void handleBones(int boneID, boolean altar, Client c) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    	}
    Oh I see, misunderstood your message, sorry. Thought you were backing up the Importing Prayer class posts.
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Jul 2015
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    hey guys i still didn't get the solution to my problem first of all import the prayer class. in ItemOnObject.java?

    and secondly
    Code:
    public static void handleBones(int boneID, boolean altar, Client c) {
    		Bones bon = forBone(boneID);
    		if (bon != null) {
    			if (System.currentTimeMillis() - c.buryDelay >= 1200) {
    				c.getItems().deleteItem(bon.getId(), 1);
    				c.getPA().addSkillXP(altar ? bon.getAltarXP() : bon.getBuryXP(), c.playerPrayer);
    				c.buryDelay = System.currentTimeMillis();
    				c.startAnimation(altar ? 896 : 827);
    				c.sendMessage(altar ? "The gods are pleased with your offerings." : "You bury the bones.");
    				if(altar) {
    					c.getPA().createPlayersStillGfx(624, c.objectX, c.objectY, 0, 0);
    				}
    			}
    		}
    i replaced this with myn and i still get these errors
    Code:
     src\server\model\players\skills\Prayer.java:88: error: non-static method forBone
    (int) cannot be referenced from a static context
                    Bones bon = forBone(boneID);
                                ^
    src\server\model\players\packets\ItemOnObject.java:33: error: cannot find symbol
    
                            Prayer.useBonesOnAltar(c, objectId, itemId);
                                  ^
      symbol:   method useBonesOnAltar(Client,int,int)
      location: class Prayer
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  11. #10  
    Registered Member

    Join Date
    Dec 2010
    Posts
    1,982
    Thanks given
    174
    Thanks received
    256
    Rep Power
    223
    You're referencing non-static fields within a static method

    Code:
    	private Bones forBone(int id) {
    		for (Bones b : Bones.values()) {
    			if (b.getId() == id) {
    				return b;
    			}
    		}
    		return null;
    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] All Bones and Bones On Altar
    By Dexter Morgan in forum Snippets
    Replies: 44
    Last Post: 04-20-2014, 05:43 AM
  2. pi bones on altar
    By Raverz in forum Help
    Replies: 15
    Last Post: 07-31-2012, 04:36 AM
  3. [PI] Bone Burying | Bones on Altar
    By L__A in forum Snippets
    Replies: 5
    Last Post: 07-16-2012, 10:54 AM
  4. [PI] Bones on Altar Error
    By Shonx in forum Help
    Replies: 0
    Last Post: 06-22-2012, 06:41 PM
  5. PI Bones on altar
    By walex80 in forum Help
    Replies: 2
    Last Post: 11-23-2011, 11:10 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
  •