Thread: Interface Component Settings (A.K.A. Access Masks ) 100%

Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23
  1. #21  
    Номер 1


    Leanbow's Avatar
    Join Date
    Feb 2008
    Posts
    5,895
    Thanks given
    1,564
    Thanks received
    2,624
    Rep Power
    5000
    Quote Originally Posted by Savions View Post
    sorry for the bump but i can confirm that teemuzz is right on this one

    correct shift is 11 and in 731 the optionmask consists of 6 bits instead of 5 still figuring out what the last bit is used for will update when i find it

    proof (directly taken from 731 client)

    Code:
      static final int method5837(int var0) {
          return var0 >> 11 & 127;
       }
    0x1 - ground object
    0x2 - npc
    0x4 - location
    0x8 - player
    0x10 - if1 inventory(type 2)
    0x20 - if3 component
    0x40 - tiles(minimap and 3dscreen)

    If that's what u asking
    Reply With Quote  
     

  2. Thankful users:


  3. #22  
    Registered Member
    Join Date
    May 2017
    Posts
    124
    Thanks given
    41
    Thanks received
    43
    Rep Power
    56
    Here to to anyone trying to figure it out. Below is an example of using it on the Bank interface

    Code:
    SettingsBuilder settings = new SettingsBuilder();
    settings.setSecondaryOption(0, true);
    settings.setSecondaryOption(1, true);
    settings.setSecondaryOption(2, true);
    settings.setSecondaryOption(3, player.getBank().getCustomWithdrawValue() > 0); // this value is for the custom withdraw X, only visible AFTER they have set a custom withdraw value
    settings.setSecondaryOption(4, true);
    settings.setSecondaryOption(5, true);
    settings.setSecondaryOption(6, true);
    settings.setSecondaryOption(9, true);
    settings.setInterfaceDepth(2);
    settings.setCanDragOnto(true);
    
    // 762 = bank child ID
    // 0 = starting index/slot
    // 516 = ending index/slot
    // 93 = component ID
    // settings.getValue() is the value from the settings
    player.getGamePane().sendAccessMask(762, settings.getValue(), 0, 516, 93); // otherwise known as sendIComponentSettings(childID, settings, start, end, componentID)

    The 21st and 23rd bit, I don't actually know what they are called...sooooooooooooo whatever
    Code:
    /**
     * A class used to configure the bitwise settings for an interface. The settings
     * available include enabling/disabling the primary left click, or right click
     * options, using items/spells/interface components on ground
     * items/npcs/objects/players/yourself/interface components, configuring the
     * interface event height (how high up the hierarchy parents are notified of
     * clicks), and whether the interface components itself can be the target of a
     * 'use with' action
     * 
     * @author Mangis
     */
    public class SettingsBuilder {
    
    	/**
    	 * Contains the value which should be sent in access mask packet.
    	 */
    	private int value;
    
    	/**
    	 * True if the settings have a left click entityOption
    	 * 
    	 * @Return True if the settings have a left click entityOption
    	 */
    	public boolean hasPrimaryOption() {
    		return (value & 0x1) != 0;
    	}
    
    	/**
    	 * True if the settings have the right click entityOption for the given id.
    	 * 
    	 * @Param optionId the entityOption id, value is 0-9
    	 * @Return True if the settings have the right click entityOption for the given
    	 *         id.
    	 */
    	public boolean hasSecondaryOption(int optionId) {
    		if (optionId < 0 || optionId > 9)
    			throw new IllegalArgumentException("Bad entityOption requested: " + optionId);
    		return (value & (0x1 << (optionId + 1))) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with items on the ground
    	 * 
    	 * @Return True if the settings allow use with items on the ground
    	 */
    	public boolean canUseOnGroundItems() {
    		return (value & (0x1 << 11)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with npcs
    	 * 
    	 * @Return True if the settings allow use with npcs
    	 */
    	public boolean canUseOnNPCs() {
    		return (value & (0x1 << 12)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with objects
    	 * 
    	 * @Return True if the settings allow use with objects
    	 */
    	public boolean canUseOnObjects() {
    		return (value & (0x1 << 13)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with other players (not necessarily yourself)
    	 * 
    	 * @Return True if the settings allow use with other players (not necessarily
    	 *         yourself)
    	 */
    	public boolean canUseOnOtherPlayers() {
    		return (value & (0x1 << 14)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use on themselves
    	 * 
    	 * @Return True if the settings allow use on themselves
    	 */
    	public boolean canUseOnSelf() {
    		return (value & (0x1 << 15)) != 0;
    	}
    
    	/**
    	 * True if the settings allow interface components to be dragged
    	 * 
    	 * @Return True if the settings allow interface components to be dragged
    	 */
    	public boolean canDrag() {
    		return (value & (0x1 << 23)) != 0;
    	}
    
    	/**
    	 * True if the settings allow items to be dragged onto interface components
    	 * 
    	 * @Return True if the settings allow items to be dragged onto interface
    	 *         components
    	 */
    	public boolean canDragOnto() {
    		return (value & (0x1 << 21)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use on other interface components, eg, high
    	 * alchemy is used on items.
    	 * 
    	 * @Return True if the settings allow use on other interface components, eg,
    	 *         high alchemy is used on items.
    	 */
    	public boolean canUseOnInterfaceComponent() {
    		return (value & (0x1 << 16)) != 0;
    	}
    
    	/**
    	 * 0-7, the height up the chain to notify parent containers when a button is
    	 * clicked.
    	 * 
    	 * @Return 0-7, the height up the chain to notify parent containers when a
    	 *         button is clicked. The higher the height, the further back the
    	 *         parent.
    	 */
    	public int getInterfaceDepth() {
    		int bits = (value & (0x7 << 18));
    		return bits >> 18;
    	}
    
    	/**
    	 * True if components can be a catalyst in the 'Use With' functionality. For
    	 * example, items should set this to true when in the inventory to allow for
    	 * alchemy, while items in the bank should not.
    	 * 
    	 * @Return true if the components can be a catalyst in teh 'Use With'
    	 *         functionality
    	 */
    	public boolean isUseOnTarget() {
    		return (value & (0x1 << 22)) != 0;
    	}
    
    	/**
    	 * Set's standard entityOption settings. Great example of standard click
    	 * entityOption is the Continue button in dialog interface. If the entityOption
    	 * is not allowed the packet won't be send to server.
    	 * 
    	 * @Param allowed
    	 */
    	public SettingsBuilder setPrimaryOption(boolean allowed) {
    		value &= ~(0x1);
    		if (allowed)
    			value |= 0x1;
    		return this;
    	}
    
    	/**
    	 * Set's right click entityOption settings. Great example of right click
    	 * entityOption is the Dismiss entityOption in summoning orb. If specified
    	 * entityOption is not allowed , it will not appear in right click menu and the
    	 * packet will not be send to server when clicked.
    	 */
    	public SettingsBuilder setSecondaryOption(int optionID, boolean allowed) {
    		if (optionID < 0 || optionID > 9)
    			throw new IllegalArgumentException("optionID must be 0-9.");
    		value &= ~(0x1 << (optionID + 1)); // disable
    		if (allowed)
    			value |= (0x1 << (optionID + 1));
    		return this;
    	}
    
    	/**
    	 * Sets use on settings. By use on , I mean the options such as Cast in
    	 * spellbook or use in inventory. If nothing is allowed then 'use' entityOption
    	 * will not appear in right click menu.
    	 */
    	public SettingsBuilder setUseOnSettings(boolean canUseOnGroundItems, boolean canUseOnNpcs, boolean canUseOnObjects, boolean canUseOnNonselfPlayers, boolean canUseOnSelfPlayer, boolean canUseOnInterfaceComponent) {
    		int useFlag = 0;
    		if (canUseOnGroundItems)
    			useFlag |= 0x1;
    		if (canUseOnNpcs)
    			useFlag |= 0x2;
    		if (canUseOnObjects)
    			useFlag |= 0x4;
    		if (canUseOnNonselfPlayers)
    			useFlag |= 0x8;
    		if (canUseOnSelfPlayer)
    			useFlag |= 0x10;
    		if (canUseOnInterfaceComponent)
    			useFlag |= 0x20;
    		value &= ~(0x7F << 11); // disable
    		value |= useFlag << 11;
    		return this;
    	}
    
    	/**
    	 * Set's interface events height. For example, we have inventory interface which
    	 * is opened on gameframe interface (548 or 746). If height is 1 , then the
    	 * clicks in inventory will also invoke click event handler scripts on gameframe
    	 * interface.
    	 */
    	public SettingsBuilder setInterfaceDepth(int depth) {
    		if (depth < 0 || depth > 7)
    			throw new IllegalArgumentException("height must be 0-7.");
    		value &= ~(0x7 << 18);
    		value |= (depth << 18);
    		return this;
    	}
    
    	/**
    	 * Set's canUseOnFlag. if it's true then other interface components can do use
    	 * on this interface component. Example would be using High alchemy spell on the
    	 * inventory item. If inventory component where items are stored doesn't allow
    	 * the canUseOn , it would not be possible to use High Alchemy on that item.
    	 */
    	public SettingsBuilder setIsUseOnTarget(boolean allow) {
    		value &= ~(1 << 22);
    		if (allow)
    			value |= (1 << 22);
    		return this;
    	}
    
    	/**
    	 * Set's canDragOnto. if it's true items can be dragged onto interface
    	 * components. An example would be dragging an item in the bank onto a bank tab.
    	 */
    	public SettingsBuilder setCanDragOnto(boolean allow) {
    		value &= ~(1 << 21);
    		if (allow)
    			value |= (1 << 21);
    		return this;
    	}
    
    	/**
    	 * Set's canUseOnFlag. if it's true, then interface components can be dragged
    	 */
    	public SettingsBuilder setCanDrag(boolean allow) {
    		value &= ~(1 << 23);
    		if (allow)
    			value |= (1 << 23);
    		return this;
    	}
    
    	/**
    	 * Returns the value constructed by this {@code SettingsBuilder}.
    	 * 
    	 * @Return the value
    	 */
    	public int getValue() {
    		return value;
    	}
    
    }
    Reply With Quote  
     

  4. #23  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Quote Originally Posted by Dragonsevery View Post
    Here to to anyone trying to figure it out. Below is an example of using it on the Bank interface

    Code:
    SettingsBuilder settings = new SettingsBuilder();
    settings.setSecondaryOption(0, true);
    settings.setSecondaryOption(1, true);
    settings.setSecondaryOption(2, true);
    settings.setSecondaryOption(3, player.getBank().getCustomWithdrawValue() > 0); // this value is for the custom withdraw X, only visible AFTER they have set a custom withdraw value
    settings.setSecondaryOption(4, true);
    settings.setSecondaryOption(5, true);
    settings.setSecondaryOption(6, true);
    settings.setSecondaryOption(9, true);
    settings.setInterfaceDepth(2);
    settings.setCanDragOnto(true);
    
    // 762 = bank child ID
    // 0 = starting index/slot
    // 516 = ending index/slot
    // 93 = component ID
    // settings.getValue() is the value from the settings
    player.getGamePane().sendAccessMask(762, settings.getValue(), 0, 516, 93); // otherwise known as sendIComponentSettings(childID, settings, start, end, componentID)

    The 21st and 23rd bit, I don't actually know what they are called...sooooooooooooo whatever
    Code:
    /**
     * A class used to configure the bitwise settings for an interface. The settings
     * available include enabling/disabling the primary left click, or right click
     * options, using items/spells/interface components on ground
     * items/npcs/objects/players/yourself/interface components, configuring the
     * interface event height (how high up the hierarchy parents are notified of
     * clicks), and whether the interface components itself can be the target of a
     * 'use with' action
     * 
     * @author Mangis
     */
    public class SettingsBuilder {
    
    	/**
    	 * Contains the value which should be sent in access mask packet.
    	 */
    	private int value;
    
    	/**
    	 * True if the settings have a left click entityOption
    	 * 
    	 * @Return True if the settings have a left click entityOption
    	 */
    	public boolean hasPrimaryOption() {
    		return (value & 0x1) != 0;
    	}
    
    	/**
    	 * True if the settings have the right click entityOption for the given id.
    	 * 
    	 * @Param optionId the entityOption id, value is 0-9
    	 * @Return True if the settings have the right click entityOption for the given
    	 *         id.
    	 */
    	public boolean hasSecondaryOption(int optionId) {
    		if (optionId < 0 || optionId > 9)
    			throw new IllegalArgumentException("Bad entityOption requested: " + optionId);
    		return (value & (0x1 << (optionId + 1))) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with items on the ground
    	 * 
    	 * @Return True if the settings allow use with items on the ground
    	 */
    	public boolean canUseOnGroundItems() {
    		return (value & (0x1 << 11)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with npcs
    	 * 
    	 * @Return True if the settings allow use with npcs
    	 */
    	public boolean canUseOnNPCs() {
    		return (value & (0x1 << 12)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with objects
    	 * 
    	 * @Return True if the settings allow use with objects
    	 */
    	public boolean canUseOnObjects() {
    		return (value & (0x1 << 13)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use with other players (not necessarily yourself)
    	 * 
    	 * @Return True if the settings allow use with other players (not necessarily
    	 *         yourself)
    	 */
    	public boolean canUseOnOtherPlayers() {
    		return (value & (0x1 << 14)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use on themselves
    	 * 
    	 * @Return True if the settings allow use on themselves
    	 */
    	public boolean canUseOnSelf() {
    		return (value & (0x1 << 15)) != 0;
    	}
    
    	/**
    	 * True if the settings allow interface components to be dragged
    	 * 
    	 * @Return True if the settings allow interface components to be dragged
    	 */
    	public boolean canDrag() {
    		return (value & (0x1 << 23)) != 0;
    	}
    
    	/**
    	 * True if the settings allow items to be dragged onto interface components
    	 * 
    	 * @Return True if the settings allow items to be dragged onto interface
    	 *         components
    	 */
    	public boolean canDragOnto() {
    		return (value & (0x1 << 21)) != 0;
    	}
    
    	/**
    	 * True if the settings allow use on other interface components, eg, high
    	 * alchemy is used on items.
    	 * 
    	 * @Return True if the settings allow use on other interface components, eg,
    	 *         high alchemy is used on items.
    	 */
    	public boolean canUseOnInterfaceComponent() {
    		return (value & (0x1 << 16)) != 0;
    	}
    
    	/**
    	 * 0-7, the height up the chain to notify parent containers when a button is
    	 * clicked.
    	 * 
    	 * @Return 0-7, the height up the chain to notify parent containers when a
    	 *         button is clicked. The higher the height, the further back the
    	 *         parent.
    	 */
    	public int getInterfaceDepth() {
    		int bits = (value & (0x7 << 18));
    		return bits >> 18;
    	}
    
    	/**
    	 * True if components can be a catalyst in the 'Use With' functionality. For
    	 * example, items should set this to true when in the inventory to allow for
    	 * alchemy, while items in the bank should not.
    	 * 
    	 * @Return true if the components can be a catalyst in teh 'Use With'
    	 *         functionality
    	 */
    	public boolean isUseOnTarget() {
    		return (value & (0x1 << 22)) != 0;
    	}
    
    	/**
    	 * Set's standard entityOption settings. Great example of standard click
    	 * entityOption is the Continue button in dialog interface. If the entityOption
    	 * is not allowed the packet won't be send to server.
    	 * 
    	 * @Param allowed
    	 */
    	public SettingsBuilder setPrimaryOption(boolean allowed) {
    		value &= ~(0x1);
    		if (allowed)
    			value |= 0x1;
    		return this;
    	}
    
    	/**
    	 * Set's right click entityOption settings. Great example of right click
    	 * entityOption is the Dismiss entityOption in summoning orb. If specified
    	 * entityOption is not allowed , it will not appear in right click menu and the
    	 * packet will not be send to server when clicked.
    	 */
    	public SettingsBuilder setSecondaryOption(int optionID, boolean allowed) {
    		if (optionID < 0 || optionID > 9)
    			throw new IllegalArgumentException("optionID must be 0-9.");
    		value &= ~(0x1 << (optionID + 1)); // disable
    		if (allowed)
    			value |= (0x1 << (optionID + 1));
    		return this;
    	}
    
    	/**
    	 * Sets use on settings. By use on , I mean the options such as Cast in
    	 * spellbook or use in inventory. If nothing is allowed then 'use' entityOption
    	 * will not appear in right click menu.
    	 */
    	public SettingsBuilder setUseOnSettings(boolean canUseOnGroundItems, boolean canUseOnNpcs, boolean canUseOnObjects, boolean canUseOnNonselfPlayers, boolean canUseOnSelfPlayer, boolean canUseOnInterfaceComponent) {
    		int useFlag = 0;
    		if (canUseOnGroundItems)
    			useFlag |= 0x1;
    		if (canUseOnNpcs)
    			useFlag |= 0x2;
    		if (canUseOnObjects)
    			useFlag |= 0x4;
    		if (canUseOnNonselfPlayers)
    			useFlag |= 0x8;
    		if (canUseOnSelfPlayer)
    			useFlag |= 0x10;
    		if (canUseOnInterfaceComponent)
    			useFlag |= 0x20;
    		value &= ~(0x7F << 11); // disable
    		value |= useFlag << 11;
    		return this;
    	}
    
    	/**
    	 * Set's interface events height. For example, we have inventory interface which
    	 * is opened on gameframe interface (548 or 746). If height is 1 , then the
    	 * clicks in inventory will also invoke click event handler scripts on gameframe
    	 * interface.
    	 */
    	public SettingsBuilder setInterfaceDepth(int depth) {
    		if (depth < 0 || depth > 7)
    			throw new IllegalArgumentException("height must be 0-7.");
    		value &= ~(0x7 << 18);
    		value |= (depth << 18);
    		return this;
    	}
    
    	/**
    	 * Set's canUseOnFlag. if it's true then other interface components can do use
    	 * on this interface component. Example would be using High alchemy spell on the
    	 * inventory item. If inventory component where items are stored doesn't allow
    	 * the canUseOn , it would not be possible to use High Alchemy on that item.
    	 */
    	public SettingsBuilder setIsUseOnTarget(boolean allow) {
    		value &= ~(1 << 22);
    		if (allow)
    			value |= (1 << 22);
    		return this;
    	}
    
    	/**
    	 * Set's canDragOnto. if it's true items can be dragged onto interface
    	 * components. An example would be dragging an item in the bank onto a bank tab.
    	 */
    	public SettingsBuilder setCanDragOnto(boolean allow) {
    		value &= ~(1 << 21);
    		if (allow)
    			value |= (1 << 21);
    		return this;
    	}
    
    	/**
    	 * Set's canUseOnFlag. if it's true, then interface components can be dragged
    	 */
    	public SettingsBuilder setCanDrag(boolean allow) {
    		value &= ~(1 << 23);
    		if (allow)
    			value |= (1 << 23);
    		return this;
    	}
    
    	/**
    	 * Returns the value constructed by this {@code SettingsBuilder}.
    	 * 
    	 * @Return the value
    	 */
    	public int getValue() {
    		return value;
    	}
    
    }
    If you're looking for 718-742 banking events. Here's the class in question with my refactoring if it helps: https://github.com/DarkanRS/core/blo.../IFEvents.java
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

Page 3 of 3 FirstFirst 123

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. Access Masks
    By Titandino in forum Help
    Replies: 5
    Last Post: 01-28-2011, 02:16 AM
  2. Settings/Features Interface
    By NICKname in forum Show-off
    Replies: 22
    Last Post: 10-17-2010, 08:11 AM
  3. [614] Withdraw Access Masks - Paying
    By .alycia in forum Help
    Replies: 2
    Last Post: 08-18-2010, 08:01 PM
  4. [614] Need Access Masks
    By Mr Bill in forum Help
    Replies: 3
    Last Post: 08-18-2010, 12:25 PM
  5. Access Masks
    By thedoom in forum Requests
    Replies: 0
    Last Post: 09-29-2009, 06:33 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
  •