Thread: Banking from another class [pi][DETAILED]

Results 1 to 7 of 7
  1. #1 Banking from another class [pi][DETAILED] 
    Registered Member
    Join Date
    Apr 2011
    Posts
    270
    Thanks given
    59
    Thanks received
    6
    Rep Power
    0
    i am trying to bank from another class

    Code:
    package server.game.players.Banking;
    
    import server.game.players.Client;
    import server.game.players.Skills.Woodcutting.Woodcutting;
    
    
    public class Bank {
    	
    
    	
    	/**
    	 * Open bank
    	 * Method
    	 * Zack***
    	 */
    	
    	public int bankIds[]={2213,14367,11758};
    	
    	public void clickObject(Client c,int objectType){
    		if (objectType == bankIds.length){
    			openUpBank(c);
    		}
    	}
    	
    	
    	public static void openUpBank(Client c){
    		//synchronized(c) {
    			if(c.getOutStream() != null && c != null) {
    				c.getItems().resetItems(5064);
    				c.getItems().rearrangeBank();
    				c.getItems().resetBank();
    				c.getItems().resetTempItems();
    				c.getOutStream().createFrame(248);
    				c.getOutStream().writeWordA(5292);
    				c.getOutStream().writeWord(5063);
    				c.flushOutStream();
    			}
    		
    	}
    	
    	
    	
    }
    and in action handler just below
    Code:
    public void secondClickObject(int objectType, int obX, int obY) {
    i put in

    Code:
    b.clickObject(c, objectType);
    and about the secondclickobject i got
    Code:
    	public Bank b;
    Reply With Quote  
     

  2. #2  
    Registered Member Quadro's Avatar
    Join Date
    Feb 2010
    Age
    27
    Posts
    552
    Thanks given
    81
    Thanks received
    76
    Rep Power
    37
    To open a bank you would just need to use the method openUpBank(Client c)

    your Client object would be the player I'm guessing, you don;t need clickObject at all

    that bank class is actually pretty pointless though, you should probably delete it and put the openUpBank method somewhere else, also clickObject should probably be named clickBank in this situation, that's probably the reason why your confused
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2011
    Posts
    270
    Thanks given
    59
    Thanks received
    6
    Rep Power
    0
    Quote Originally Posted by Quadro View Post
    To open a bank you would just need to use the method openUpBank(Client c)

    your Client object would be the player I'm guessing, you don;t need clickObject at all

    that bank class is actually pretty pointless though, you should probably delete it and put the openUpBank method somewhere else, also clickObject should probably be named clickBank in this situation, that's probably the reason why your confused
    but its for my packaging .....
    Reply With Quote  
     

  4. #4  
    Extreme Donator


    Join Date
    Nov 2009
    Posts
    1,421
    Thanks given
    559
    Thanks received
    266
    Rep Power
    236
    Your clickObject method wouldn't work.

    Code:
    		public void clickObject(Client c, int objectType) {
    			for(int bank : bankIds) {
    				if (objectType == bank){
    					openUpBank(c);
    				}
    			}
    		}
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Code:
    package server.game.players.Banking;
    
    import server.game.players.Client;
    
    public class Bank {
    
    	public int objectIds[]={2213,14367,11758};
    	
    	public boolean isBank(int objectId) {
    		for (int i : objectIds) {
    			if (objectId == i)
    				return true;
    		return false;
    	}
    	
    	
    	public static void open(Client c, int objectId){
    		if(c.getOutStream() != null && isBank(objectId)) {
    			c.getItems().resetItems(5064);
    			c.getItems().rearrangeBank();
    			c.getItems().resetBank();
    			c.getItems().resetTempItems();
    			c.getOutStream().createFrame(248);
    			c.getOutStream().writeWordA(5292);
    			c.getOutStream().writeWord(5063);
    			c.flushOutStream();
    		}
    	}
    	
    }
    Code:
    Bank.open(c, objectType);
    Quote Originally Posted by Aj View Post
    This is not even a tutorial. It's fail for rep. It's fail for life.
    Reply With Quote  
     

  6. #6  
    Member Banking from another class [pi][DETAILED] Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    ..so, what's the problem here?

    Attached imageAttached image
    Reply With Quote  
     

  7. #7  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    I don't really see a reason to change current method into a class.
    All the best,
    Wiki




    coming soon
    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. [Detailed] Webclient cant find client.class
    By Rar3 Pker in forum Help
    Replies: 2
    Last Post: 09-10-2012, 05:33 PM
  2. [PI] Vote4Cash Help [Detailed]
    By owner will in forum Help
    Replies: 7
    Last Post: 08-08-2012, 01:03 AM
  3. Java:Difference between Abstract class and Interface class ?
    By Snake in forum Application Development
    Replies: 8
    Last Post: 06-12-2012, 07:51 AM
  4. Replies: 19
    Last Post: 05-25-2010, 02:22 PM
  5. More detailed 509
    By Project 503 in forum RS 503+ Client & Server
    Replies: 0
    Last Post: 09-02-2008, 03:03 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
  •