Thread: handler

Results 1 to 6 of 6
  1. #1 handler 
    Registered Member austin_gct's Avatar
    Join Date
    Jan 2008
    Posts
    234
    Thanks given
    0
    Thanks received
    0
    Rep Power
    3
    ive made a handler and this is what i put in it
    Code:
    public class Woodcutting {
    
    	public void chop(int objectID, Client c) {
    		switch (c.objectID) {
    
    case 1276:
    c.sM("you swing your axe at the tree.");
    break;
    }
    }
    }
    and in client java under first clicked objects i put
    Code:
    Woodcutting.chop(this);
    and i keep getting these error
    Code:
    .\src\Client.java:8090: chop(int,Client) in Woodcutting cannot be applied to (Cl
    ient)
    Woodcutting.chop(this);
               ^
    .\src\Woodcutting.java:4: cannot find symbol
    symbol  : variable objectID
    location: class Client
                    switch (c.objectID) {
                             ^
    2 errors
    Press any key to continue . . .
    also the npcs arnt moving and after a while the player walks like a step and stops then another and stops how can i fix these? i really need help!
    Spoiler for msn:
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Code:
    public class Woodcutting {
    
    	public client c;
    
    	public Woodcutting(client c) {
    		this.c = c;
    	}
    
    	public void chop(int object) {
    		switch (object) {
    			case 1276:
    				c.sM("you swing your axe at the tree.");
    				break;
    		}
    	}
    }
    Code:
    public Woodcutting woodcutting = new Woodcutting(this);

    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  3. #3  
    Registered Member austin_gct's Avatar
    Join Date
    Jan 2008
    Posts
    234
    Thanks given
    0
    Thanks received
    0
    Rep Power
    3
    k now how do u get actiontimer to work it says it can find symbol but yet i cant figure out how to make one
    Spoiler for msn:
    Reply With Quote  
     

  4. #4  
    Registered Member austin_gct's Avatar
    Join Date
    Jan 2008
    Posts
    234
    Thanks given
    0
    Thanks received
    0
    Rep Power
    3
    Code:
    .\src\Client.java:8071: non-static method chop(int) cannot be referenced from a
    static context
                            Woodcutting.chop(objectID);
                                       ^
    .\src\Server.java:122: cannot find symbol
    symbol  : constructor Woodcutting()
    location: class Woodcutting
                    woodcutting = new Woodcutting();
                                  ^
    2 errors
    Press any key to continue . . .
    Spoiler for msn:
    Reply With Quote  
     

  5. #5  
    Registered Member JeremyM's Avatar
    Join Date
    Apr 2007
    Age
    29
    Posts
    251
    Thanks given
    0
    Thanks received
    3
    Rep Power
    1
    the non-static part means that a variable that is static can't be applied to a non-static variable. So basically find the variable that is non-static and make it static.
    Love the Weed! Don't do it...it will get you hooked.

    Working on life.

    Like a Boss!
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Code:
    public Woodcutting woodcutting = new Woodcutting(this);
    Code:
    woodcutting.chop(objectID);
    Quote Originally Posted by you
    k now how do u get actiontimer to work it says it can find symbol but yet i cant figure out how to make one
    c.variableName

    [Only registered and activated users can see links. ]

    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
  •