Thread: herb cleaning not working.

Results 1 to 7 of 7
  1. #1 herb cleaning not working. 
    Banned

    Join Date
    Jul 2010
    Age
    34
    Posts
    773
    Thanks given
    39
    Thanks received
    83
    Rep Power
    0
    Here is my cleaning class.

    Spoiler for herb cleaning class:
    package server.content.skills;

    import server.Config;
    import server.game.players.Client;



    public class Cleaning {

    private static Client c;

    public Cleaning(Client c) {
    Cleaning.c = c;
    }

    public static int[][] HERBS = {

    {199, 249, 1, 3},
    {201, 251, 5, 4},
    {203, 253, 11, 5},
    {205, 255, 20, 6},
    {207, 257, 25, 8},
    {209, 259, 30, 8},
    {211, 261, 40, 9},
    {213, 263, 54, 11},
    {215, 265, 59, 12},
    {217, 267, 65, 13},
    {219, 269, 67, 13},
    {3049, 2998, 70, 14},
    {3051, 3000, 75, 15}
    };

    public boolean Dirty(int itemId) {
    for (int j = 0; j < HERBS.length; j++)
    if (HERBS[j][0] == itemId)
    return true;
    return false;
    }

    public boolean Clean(int item) {
    for (int w = 0; w < HERBS.length; w++)
    if (HERBS[w][1] == item)
    return true;
    return false;
    }

    public static void cleanHerb(int i) {
    for(i = 0; i > HERBS.length; i++) {
    if (c.getItems().playerHasItem(HERBS[i][0])) {
    if(c.playerLevel[c.playerHerblore] >= HERBS[i][2]) {
    c.getItems().deleteItem(HERBS[i][0], c.getItems().getItemSlot(HERBS[i][0]),1);
    c.getItems().addItem(HERBS[i][1],1);
    c.getPA().addSkillXP(HERBS[i][3] * Config.HERBLORE_EXPERIENCE,c.playerHerblore);
    c.sendMessage("You identify the herb");
    } else {
    c.sendMessage("You need a Herblore level of " +HERBS[i][2] + " to clean this herb");
    }
    }
    }
    }
    public static void handleHerbClick(int herbId) {
    for (int i = 0; i < HERBS.length; i++) {
    if(HERBS[i][0] == herbId)
    cleanHerb(i);
    }
    }
    }


    Here is my clickitem method.

    Spoiler for herb cleaning clickitem method:
    case 199:
    case 201:
    case 203:
    case 205:
    case 207:
    case 209:
    case 211:
    case 213:
    case 215:
    case 217:
    case 219:
    case 3049:
    case 3051:
    Cleaning.handleHerbClick(itemId);
    break;
    Reply With Quote  
     

  2. #2  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Any errors or it just doesn't work when you click it.

    Edit: Your loop is messed up in the cleanherb method. Take a look there.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jul 2010
    Age
    34
    Posts
    773
    Thanks given
    39
    Thanks received
    83
    Rep Power
    0
    just doesnt work when you click it.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2010
    Age
    34
    Posts
    773
    Thanks given
    39
    Thanks received
    83
    Rep Power
    0
    no idea what it could be.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Quote Originally Posted by Hideki Ryuga View Post
    no idea what it could be.
    Code:
    for(i = 0; i > HERBS.length; i++) {
    Reply With Quote  
     

  6. #6  
    Ignorance is always an excuse

    Mikee's Avatar
    Join Date
    Nov 2009
    Posts
    2,370
    Thanks given
    732
    Thanks received
    490
    Rep Power
    656
    Try adding debug messages to help. Also post the whole clickitem class, something before the herb cleaning method could be stopping the code from reaching the herb cleaning.



    The day Aj repped me, my life changed forever
    Quote Originally Posted by Aj View Post
    Rep++ for you
    Reply With Quote  
     

  7. #7  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Rewrote the entire thing for him, works perfectly.
    Reply With Quote  
     

  8. Thankful user:



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. Client not working for You? READ!
    By Edge in forum Tutorials
    Replies: 59
    Last Post: 02-06-2020, 09:27 AM
  2. [CLEANED V4] Commands not working?
    By Unity in forum Help
    Replies: 4
    Last Post: 06-29-2009, 02:20 AM
  3. NPCs not working.
    By FateJiki in forum Configuration
    Replies: 2
    Last Post: 02-17-2008, 02:40 PM
  4. Kevins floor editor not working.. 2 errors :(
    By newservermaker in forum RS2 Client
    Replies: 0
    Last Post: 01-03-2008, 06:47 AM
  5. Replies: 17
    Last Post: 11-30-2007, 04:15 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
  •