Thread: [718+] DeathEvent protect/unprotect items

Results 1 to 4 of 4
  1. #1 [718+] DeathEvent protect/unprotect items 
    Registered Member
    Join Date
    Nov 2013
    Posts
    190
    Thanks given
    6
    Thanks received
    7
    Rep Power
    10
    This code:
    Code:
    public boolean processButtonClick(int interfaceId, int componentId, int slotId, int slotId2, int packetId) {
    		if (interfaceId == 18) {
    		    if (componentId == 9) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    unprotect(slotId);
    		    } else if (componentId == 17) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    protect(slotId2);
    		    } else if (componentId == 45) {
    			if (slotId > RESPAWN_LOCATIONS.length)
    			    return false;
    			currentHub = 255 + slotId;
    		    }
    		    return false;
    		}
    		return true;
        }
    Whenever I click on items on that get ready to respawn interface nothing happens (or eclipse buttonhandler click..... message). How do I make so whenever I click on those buttons/items it's getting read from processButtonClick from deathevent and not from buttonhhandler.java.

    I have tried this code;
    Code:
    if (!player.getControlerManager().processButtonClick(interfaceId,
    				componentId, slotId, slotId2, packetId))
    			return;
    Doesnt work either.

    Have tried to make code like this in buttonhandler;
    Code:
    if (interfaceId == 18) {
    		    if (componentId == 9) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    unprotect(slotId);
    		    } else if (componentId == 17) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    protect(slotId2);
    		    } else if (componentId == 45) {
    			if (slotId > RESPAWN_LOCATIONS.length)
    			    return false;
    			currentHub = 255 + slotId;
    		    }
    		    return false;
    		}
    Fixed errors and such, but I still got errors when I clicked on the items.
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by lithuaniia View Post
    This code:
    Code:
    public boolean processButtonClick(int interfaceId, int componentId, int slotId, int slotId2, int packetId) {
    		if (interfaceId == 18) {
    		    if (componentId == 9) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    unprotect(slotId);
    		    } else if (componentId == 17) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    protect(slotId2);
    		    } else if (componentId == 45) {
    			if (slotId > RESPAWN_LOCATIONS.length)
    			    return false;
    			currentHub = 255 + slotId;
    		    }
    		    return false;
    		}
    		return true;
        }
    Whenever I click on items on that get ready to respawn interface nothing happens (or eclipse buttonhandler click..... message). How do I make so whenever I click on those buttons/items it's getting read from processButtonClick from deathevent and not from buttonhhandler.java.

    I have tried this code;
    Code:
    if (!player.getControlerManager().processButtonClick(interfaceId,
    				componentId, slotId, slotId2, packetId))
    			return;
    Doesnt work either.

    Have tried to make code like this in buttonhandler;
    Code:
    if (interfaceId == 18) {
    		    if (componentId == 9) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    unprotect(slotId);
    		    } else if (componentId == 17) {
    			if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
    			    protect(slotId2);
    		    } else if (componentId == 45) {
    			if (slotId > RESPAWN_LOCATIONS.length)
    			    return false;
    			currentHub = 255 + slotId;
    		    }
    		    return false;
    		}
    Fixed errors and such, but I still got errors when I clicked on the items.
    Code:
    if (!player.getControlerManager().processButtonClick(interfaceId,
    				componentId, slotId, slotId2, packetId))
    			return;
    This should normally work. Have you tried putting an out.print in DeathEvent's processButtonClick method to see if it gets called?
    Project thread
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2013
    Posts
    190
    Thanks given
    6
    Thanks received
    7
    Rep Power
    10
    Quote Originally Posted by clem585 View Post
    Code:
    if (!player.getControlerManager().processButtonClick(interfaceId,
    				componentId, slotId, slotId2, packetId))
    			return;
    This should normally work. Have you tried putting an out.print in DeathEvent's processButtonClick method to see if it gets called?
    It only respons to ButtonHandler out.print, processButtonClick in DeathEvent seems to have nothing to do. I cna even delete that whole code, and no errors, not sure if I should get any, but that code does nothing

    Quote Originally Posted by clem585 View Post
    Code:
    if (!player.getControlerManager().processButtonClick(interfaceId,
    				componentId, slotId, slotId2, packetId))
    			return;
    This should normally work. Have you tried putting an out.print in DeathEvent's processButtonClick method to see if it gets called?
    Fixed it, had to get some codes from other sources and change few methods to make it work
    Only unprotect item works tho, when I'm trying to protect nothing happends, I think method protect(slot2); doesn't work, coz when I'm trying to put text there it works
    Reply With Quote  
     

  4. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by lithuaniia View Post
    It only respons to ButtonHandler out.print, processButtonClick in DeathEvent seems to have nothing to do. I cna even delete that whole code, and no errors, not sure if I should get any, but that code does nothing



    Fixed it, had to get some codes from other sources and change few methods to make it work
    Only unprotect item works tho, when I'm trying to protect nothing happends, I think method protect(slot2); doesn't work, coz when I'm trying to put text there it works
    You sure it's slotId2 and not slotId?
    Project thread
    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. [718] Simple protect Item System.
    By Keiron' in forum Snippets
    Replies: 6
    Last Post: 07-30-2013, 01:23 PM
  2. [718] Random Protect Item Prices? Repping!
    By zzzfishstick in forum Help
    Replies: 3
    Last Post: 07-28-2013, 12:38 AM
  3. z508/525 Null glitch protect for item REP++
    By ii attack 66 in forum Help
    Replies: 18
    Last Post: 02-08-2010, 09:18 PM
  4. Protect 3 Item on Death/Protect 1 Item
    By LeBron James in forum Show-off
    Replies: 18
    Last Post: 05-25-2009, 08:48 PM
  5. Protect 1 item
    By m0nkeymadd in forum Requests
    Replies: 1
    Last Post: 02-07-2009, 02:54 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
  •