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

Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1 Interface Component Settings (A.K.A. Access Masks ) 100% 
    Renown Programmer


    Join Date
    Jul 2009
    Posts
    1,846
    Thanks given
    69
    Thanks received
    1,113
    Rep Power
    3170
    Noob warning
    Don't ask how to use, those who understand this will be able to make use of this.


    Code:
    /**
     * A.K.A. access mask builder.
     * @author Mangis
     *
     */
    public class InterfaceComponentSettingsBuilder {
    
    	
    	/**
    	 * Contains the value which should be sended in access mask packet.
    	 */
    	private int value;
    	
    	
    	
    	
    	/**
    	 * Set's standart option settings.
    	 * Great example of standart click option is the Continue button in dialog interface.
    	 * If the option is not allowed the packet won't be send to server.
    	 * @param allowed
    	 */
    	public void setStandartClickOptionSettings(boolean allowed) {
    		value &= ~(0x1);
    		if (allowed)
    			value |= 0x1;
    	}
    	
    	
    	/**
    	 * Set's right click option settings.
    	 * Great example of right click option is the Dismiss option in summoning orb.
    	 * If specified option is not allowed , it will not appear in right click menu and the packet will not be send 
    	 * to server when clicked.
    	 */
    	public void setRightClickOptionSettings(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));
    	}
    	
    	
    	/**
    	 * 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' option will not appear in right click menu.
    	 */
    	public void 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 &= ~(127 << 11); // disable
    		value |= useFlag << 11;
    	}
    	
    	/**
    	 * Set's interface events depth.
    	 * For example, we have inventory interface which is opened 
    	 * on gameframe interface (548 or 746).
    	 * If depth is 1 , then the clicks in inventory will also invoke click event handler scripts 
    	 * on gameframe interface.
    	 */
    	public void setInterfaceEventsDepth(int depth) {
    		if (depth < 0 || depth > 7)
    			throw new IllegalArgumentException("depth must be 0-7.");
    		value &= ~(0x7 << 18);
    		value |= (depth << 18);
    	}
    	
    	/**
    	 * 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 void setCanUseOn(boolean allow) {
    		value &= ~(1 << 22);
    		if (allow)
    			value |= (1 << 22);
    	}
    	
    	public int getValue() {
    		return value;
    	}
    	
    }

    Packet structure (for 666)

    ushort - maxSettingID
    int_v1 - interfaceID+componentID(interfaceID << 16 | componentID)
    leshort - value ( see builder code )
    ushort minSettingID

    the settingID is the only value that you have to guess or dump from cs2 scripts.
    packet effect is something like this
    for (int settingID = minSettingID; settingID <= maxSettingID; settingID++)
    addInterfaceComponentSettings(interfaceID,componen tID,settingID,value);

    Enjoy
    Reply With Quote  
     


  2. #2  
    Renown Programmer and Respected Member
    Maxi's Avatar
    Join Date
    Jun 2008
    Posts
    3,197
    Thanks given
    281
    Thanks received
    1,095
    Rep Power
    1366
    Great work.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Polish Civil's Avatar
    Join Date
    May 2010
    Age
    28
    Posts
    1,345
    Thanks given
    484
    Thanks received
    191
    Rep Power
    463
    Suppp ;] Thanks


    Reply With Quote  
     

  5. #4  
    Registered Member Glabay's Avatar
    Join Date
    Jul 2008
    Age
    33
    Posts
    1,301
    Thanks given
    261
    Thanks received
    105
    Rep Power
    595
    Nice Thanks for the snippet this should be usefull
    PI * 13.37 = 42
    Attached image
    Attached image
    Reply With Quote  
     

  6. #5  
    Gfx/Coder


    Join Date
    Dec 2008
    Posts
    1,965
    Thanks given
    38
    Thanks received
    48
    Rep Power
    320
    Rly easy to understand tbh even for noobs, great job will help a lot and very well explained!
    Reply With Quote  
     

  7. #6  
    Registered Member
    Emily's Avatar
    Join Date
    Jul 2010
    Age
    30
    Posts
    622
    Thanks given
    67
    Thanks received
    215
    Rep Power
    271
    When commenting your code, you should try with your up most ability to use proper grammar and spelling.

    Contains the value which should be sended in access mask packet.
    sent.

    You constantly use the word
    standart
    Not sure if you mean standard or not.

    Set's
    What you are saying is that "Set is standart option setting"
    That makes no sense.

    You miss use "set's" quite a bit.

    Other then the English issues, the code is great. Thanks for the information.
    Reply With Quote  
     

  8. #7  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,146
    Thanks given
    256
    Thanks received
    1,252
    Rep Power
    3714
    Quote Originally Posted by Emily View Post
    When commenting your code, you should try with your up most ability to use proper grammar and spelling.



    sent.

    You constantly use the word

    Not sure if you mean standard or not.


    What you are saying is that "Set is standart option setting"
    That makes no sense.

    You miss use "set's" quite a bit.

    Other then the English issues, the code is great. Thanks for the information.
    He's foreign, leave him alone lol

    Anyways thanks for the info, I could of used this earlier when doing summoning but thanks anyways



    Reply With Quote  
     

  9. #8  
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,746
    Thanks given
    354
    Thanks received
    1,370
    Rep Power
    3032
    Code:
        enum ApplicationSetting {
            GROUND_ITEMS, NPCS, OBJECTS,
            OTHER_PLAYERS, SELF, INTERFACE_COMPONENTS
        }
    
        public void setApplicationSettings(ApplicationSetting... settings) {
            int flags = 0;
            for (ApplicationSetting setting : settings) {
                flags |= 1 << setting.ordinal();
            }
    
            value &= ~(0x7f << 7);
            value |= flags << 7;
        }
    vs

    Code:
    	/**
    	 * 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' option will not appear in right click menu.
    	 */
    	public void 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 &= ~(127 << 7); // disable
    		value |= useFlag << 7;
    	}
    isn't that prettier? and more readable too?

    from experience, method with multiple non-trivial boolean parameters are indescript, confusing, and generally bad
    http://brixomatic.wordpress.com/2010...olean-harmful/
    http://stackoverflow.com/questions/1...-do-they-smell
    Reply With Quote  
     


  10. #9  
    Reverse engineering enthousiast
    peterbjornx's Avatar
    Join Date
    Feb 2008
    Age
    29
    Posts
    1,910
    Thanks given
    88
    Thanks received
    539
    Rep Power
    1307
    bump with additional information: 0x40 allows using on minimap, not sure what this is used for though
    Reply With Quote  
     

  11. Thankful users:


  12. #10  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    Quote Originally Posted by peterbjornx View Post
    bump with additional information: 0x40 allows using on minimap, not sure what this is used for though
    Elaborate?
    Reply With Quote  
     

Page 1 of 3 123 LastLast

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
  •