Thread: getting interface frame ids.

Results 1 to 6 of 6
  1. #1 getting interface frame ids. 
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    103
    Rep Power
    14
    solved
    Reply With Quote  
     

  2. #2  
    Community Veteran

    Songoty's Avatar
    Join Date
    Dec 2007
    Posts
    2,735
    Thanks given
    206
    Thanks received
    1,019
    Rep Power
    2326
    in your client, in RSInterface (may be different depending on the client naming), under something like

    Code:
    if(interfaceType == 8/9/??)
         class.message= string
    write out all the ids and messages to a text file

    Code:
    write.writeLine(class.id + " "+class.message)
    then search that.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    103
    Rep Power
    14
    Quote Originally Posted by Songoty View Post
    in your client, in RSInterface (may be different depending on the client naming), under something like

    Code:
    if(interfaceType == 8/9/??)
         class.message= string
    write out all the ids and messages to a text file

    Code:
    write.writeLine(class.id + " "+class.message)
    then search that.
    worked, thanks
    Reply With Quote  
     

  5. #4  
    Ex RuneScape Pioneer

    Join Date
    Jun 2008
    Posts
    3,538
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1015
    Don't do this server-sided, because you're gonna flood your client with 20,000 packets. Do what Songoty said. It's easier to go to RSInterface class and print all the messages and their indices upon startup.

    Your naming will be different than mine, but go into your Interface class and look for this.

    Code:
    			if (widget.type == TYPE_TEXT) {
    				widget.defaultText = buffer.readString().replaceAll("RuneScape", "Project Aeolus");
    				if (widget.id == 19209) {
    					widget.defaultText.replaceAll("Total", "");
    				}
    				widget.secondaryText = buffer.readString();
    				//System.out.println("Id: " + rsInterface.id + " - " + rsInterface.message + "\n");
    			}
    You can print them to the console using this

    Code:
    System.out.println("Id: " + rsInterface.id + " - " + rsInterface.message + "\n");
    but you won't get all interface ids in the console so what you have to do is use the output stream to place them in a file.

    In the method you load the interfaces you create your PrintWriter object.

    Code:
    		try {
    			PrintWriter writer = new PrintWriter(new File("./interface_messages.txt"));

    at the very bottom you need to close the stream and catch the exception PrintWriter throws

    Code:
    		writer.close();
    		} catch (IOException ex) {
    			ex.printStackTrace();
    		}
    Then you can print what you want

    Code:
    			if (widget.type == TYPE_TEXT) {
    				widget.defaultText = buffer.readString().replaceAll("RuneScape", "Project Aeolus");
    				if (widget.id == 19209) {
    					widget.defaultText.replaceAll("Total", "");
    				}
    				widget.secondaryText = buffer.readString();
    				writer.write("Id: " + widget.id + " - " + widget.defaultText + "\n");
    			}
    If you have no idea what to do use this as a reference.

    Code:
    	public static void load(CacheArchive interfaces, GameFont textDrawingAreas[], CacheArchive graphics) {
    		spriteCache = new ReferenceCache(50000);
    		Buffer buffer = new Buffer(interfaces.getEntry("data"));
    		int defaultParentId = -1;
    		buffer.readUShort();
    		interfaceCache = new Widget[31000];
    		
    		try {
    			PrintWriter writer = new PrintWriter(new File("./interface_messages.txt"));		
    		
    		while (buffer.currentPosition < buffer.payload.length) {
    			int interfaceId = buffer.readUShort();
    			if (interfaceId == 65535) {
    				defaultParentId = buffer.readUShort();
    				interfaceId = buffer.readUShort();
    			}
    			
    			Widget widget = interfaceCache[interfaceId] = new Widget();
    			widget.id = interfaceId;
    			widget.parent = defaultParentId;
    			widget.type = buffer.readUnsignedByte();
    			widget.optionType = buffer.readUnsignedByte();
    			widget.contentType = buffer.readUShort();
    			widget.width = buffer.readUShort();
    			widget.height = buffer.readUShort();
    			widget.opacity = (byte) buffer.readUnsignedByte();
    			widget.hoverType = buffer.readUnsignedByte();
    			if (widget.hoverType != 0)
    				widget.hoverType = (widget.hoverType - 1 << 8) + buffer.readUnsignedByte();
    			else
    				widget.hoverType = -1;
    			int operators = buffer.readUnsignedByte();
    			if (operators > 0) {
    				widget.scriptOperators = new int[operators];
    				widget.scriptDefaults = new int[operators];
    				for (int index = 0; index < operators; index++) {
    					widget.scriptOperators[index] = buffer.readUnsignedByte();
    					widget.scriptDefaults[index] = buffer.readUShort();
    				}
    
    			}
    			int scripts = buffer.readUnsignedByte();
    			if (scripts > 0) {
    				widget.scripts = new int[scripts][];
    				for (int script = 0; script < scripts; script++) {
    					int instructions = buffer.readUShort();
    					widget.scripts[script] = new int[instructions];
    					for (int instruction = 0; instruction < instructions; instruction++)
    						widget.scripts[script][instruction] = buffer.readUShort();
    
    				}
    
    			}
    			if (widget.type == TYPE_CONTAINER) {
    				widget.drawsTransparent = false;
    				widget.scrollMax = buffer.readUShort();
    				widget.hoverOnly = buffer.readUnsignedByte() == 1;
    				int i2 = buffer.readUShort();
    				widget.children = new int[i2];
    				widget.childX = new int[i2];
    				widget.childY = new int[i2];
    				for (int index = 0; index < i2; index++) {
    					widget.children[index] = buffer.readUShort();
    					widget.childX[index] = buffer.readShort();
    					widget.childY[index] = buffer.readShort();
    				}
    			}
    			if (widget.type == TYPE_MODEL_LIST) {
    				buffer.readUShort();
    				buffer.readUnsignedByte();
    			}
    			if (widget.type == TYPE_INVENTORY) {
    				widget.inventoryItemId = new int[widget.width * widget.height];
    				widget.invStackSizes = new int[widget.width * widget.height];
    				widget.aBoolean259 = buffer.readUnsignedByte() == 1;
    				widget.hasActions = buffer.readUnsignedByte() == 1;
    				widget.usableItems = buffer.readUnsignedByte() == 1;
    				widget.replaceItems = buffer.readUnsignedByte() == 1;
    				widget.spritePaddingX = buffer.readUnsignedByte();
    				widget.spritePaddingY = buffer.readUnsignedByte();
    				widget.spritesX = new int[20];
    				widget.spritesY = new int[20];
    				widget.sprites = new Sprite[20];
    				for (int j2 = 0; j2 < 20; j2++) {
    					int k3 = buffer.readUnsignedByte();
    					if (k3 == 1) {
    						widget.spritesX[j2] = buffer.readShort();
    						widget.spritesY[j2] = buffer.readShort();
    						String s1 = buffer.readString();
    						if (graphics != null && s1.length() > 0) {
    							int i5 = s1.lastIndexOf(",");
    							widget.sprites[j2] = method207(Integer.parseInt(s1.substring(i5 + 1)), graphics, s1.substring(0, i5));
    						}
    					}
    				}
    				widget.actions = new String[5];
    				for (int actionIndex = 0; actionIndex < 5; actionIndex++) {
    					widget.actions[actionIndex] = buffer.readString();
    					if (widget.actions[actionIndex].length() == 0)
    						widget.actions[actionIndex] = null;
    					if (widget.parent == 1644)
    						widget.actions[2] = "Operate";
    				}
    			}
    			if (widget.type == TYPE_RECTANGLE)
    				widget.filled = buffer.readUnsignedByte() == 1;
    			if (widget.type == TYPE_TEXT || widget.type == TYPE_MODEL_LIST) {
    				widget.centerText = buffer.readUnsignedByte() == 1;
    				int k2 = buffer.readUnsignedByte();
    				if (textDrawingAreas != null)
    					widget.textDrawingAreas = textDrawingAreas[k2];
    				widget.textShadow = buffer.readUnsignedByte() == 1;
    			}
    			
    			if (widget.type == TYPE_TEXT) {
    				widget.defaultText = buffer.readString().replaceAll("RuneScape", "Project Aeolus");
    				if (widget.id == 19209) {
    					widget.defaultText.replaceAll("Total", "");
    				}
    				widget.secondaryText = buffer.readString();
    				writer.write("Id: " + widget.id + " - " + widget.defaultText + "\n");
    			}
    
    			if (widget.type == TYPE_MODEL_LIST || widget.type == TYPE_RECTANGLE || widget.type == TYPE_TEXT)
    				widget.textColor = buffer.readInt();
    			if (widget.type == TYPE_RECTANGLE || widget.type == TYPE_TEXT) {
    				widget.secondaryColor = buffer.readInt();
    				widget.defaultHoverColor = buffer.readInt();
    				widget.secondaryHoverColor = buffer.readInt();
    			}
    			if (widget.type == TYPE_SPRITE) {
    				widget.drawsTransparent = false;
    				String name = buffer.readString();
    				if (graphics != null && name.length() > 0) {
    					int index = name.lastIndexOf(",");
    					widget.disabledSprite = method207(Integer.parseInt(name.substring(index + 1)), graphics, name.substring(0, index));
    				}
    				name = buffer.readString();
    				if (graphics != null && name.length() > 0) {
    					int index = name.lastIndexOf(",");
    					widget.enabledSprite = method207(Integer.parseInt(name.substring(index + 1)), graphics, name.substring(0, index));
    				}
    			}
    			if (widget.type == TYPE_MODEL) {
    				int content = buffer.readUnsignedByte();
    				if (content != 0) {
    					widget.defaultMediaType = 1;
    					widget.defaultMedia = (content - 1 << 8) + buffer.readUnsignedByte();
    				}
    				content = buffer.readUnsignedByte();
    				if (content != 0) {
    					widget.anInt255 = 1;
    					widget.anInt256 = (content - 1 << 8) + buffer.readUnsignedByte();
    				}
    				content = buffer.readUnsignedByte();
    				if (content != 0)
    					widget.anInt257 = (content - 1 << 8) + buffer.readUnsignedByte();
    				else
    					widget.anInt257 = -1;
    				content = buffer.readUnsignedByte();
    				if (content != 0)
    					widget.anInt258 = (content - 1 << 8) + buffer.readUnsignedByte();
    				else
    					widget.anInt258 = -1;
    				widget.modelZoom = buffer.readUShort();
    				widget.modelRotation1 = buffer.readUShort();
    				widget.modelRotation2 = buffer.readUShort();
    			}
    			if (widget.type == TYPE_ITEM_LIST) {
    				widget.inventoryItemId = new int[widget.width * widget.height];
    				widget.invStackSizes = new int[widget.width * widget.height];
    				widget.centerText = buffer.readUnsignedByte() == 1;
    				int l2 = buffer.readUnsignedByte();
    				if (textDrawingAreas != null)
    					widget.textDrawingAreas = textDrawingAreas[l2];
    				widget.textShadow = buffer.readUnsignedByte() == 1;
    				widget.textColor = buffer.readInt();
    				widget.spritePaddingX = buffer.readShort();
    				widget.spritePaddingY = buffer.readShort();
    				widget.hasActions = buffer.readUnsignedByte() == 1;
    				widget.actions = new String[5];
    				for (int actionCount = 0; actionCount < 5; actionCount++) {
    					widget.actions[actionCount] = buffer.readString();
    					if (widget.actions[actionCount].length() == 0)
    						widget.actions[actionCount] = null;
    				}
    
    			}
    			if (widget.optionType == OPTION_USABLE || widget.type == TYPE_INVENTORY) {
    				widget.selectedActionName = buffer.readString();
    				widget.spellName = buffer.readString();
    				widget.spellUsableOn = buffer.readUShort();
    			}
    
    			if (widget.type == 8)
    				widget.defaultText = buffer.readString();
    
    			if (widget.optionType == OPTION_OK || widget.optionType == OPTION_TOGGLE_SETTING || widget.optionType == OPTION_RESET_SETTING || widget.optionType == OPTION_CONTINUE) {
    				widget.tooltip = buffer.readString();
    				if (widget.tooltip.length() == 0) {
    					//TODO
    					if (widget.optionType == OPTION_OK)
    						widget.tooltip = "Ok";
    					if (widget.optionType == OPTION_TOGGLE_SETTING)
    						widget.tooltip = "Select";
    					if (widget.optionType == OPTION_RESET_SETTING)
    						widget.tooltip = "Select";
    					if (widget.optionType == OPTION_CONTINUE)
    						widget.tooltip = "Continue";
    				}
    			}
    		}
    		writer.close();
    		} catch (IOException ex) {
    			ex.printStackTrace();
    		}
    		interfaceLoader = interfaces;
    		clanChatTab(textDrawingAreas);
    		//clanChatSetup(textDrawingAreas);
    		configureLunar(textDrawingAreas);
    		quickCurses(textDrawingAreas);
    		quickPrayers(textDrawingAreas);
    		edgevilleHomeTeleport(textDrawingAreas);
    		equipmentScreen(textDrawingAreas);
    		equipmentTab(textDrawingAreas);
    		questTab(textDrawingAreas);
    		itemsOnDeathDATA(textDrawingAreas);
    		itemsKeptOnDeath(textDrawingAreas);
    		itemsOnDeath(textDrawingAreas);
    			
    		repositionModernSpells();
    	
    		spriteCache = null;		
    	}
    output:

    Code:
    Id: 12224 - % Done
    Id: 12225 - Tutorial Island Progress
    Id: 12229 - Please follow the instructions below
    Id: 12230 - to advance in the tutorial.
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    103
    Rep Power
    14
    Quote Originally Posted by SeVen View Post
    Don't do this server-sided, because you're gonna flood your server with 20,000 packets which if you have players on they are going to lag. Do what Songoty said. It's easier to go to RSInterface class and print all the messages and their indices.

    Your naming will be different than mine, but go into your Interface class and look for this.

    Code:
    			if (widget.type == TYPE_TEXT) {
    				widget.defaultText = buffer.readString().replaceAll("RuneScape", "Project Aeolus");
    				if (widget.id == 19209) {
    					widget.defaultText.replaceAll("Total", "");
    				}
    				widget.secondaryText = buffer.readString();
    				//System.out.println("Id: " + rsInterface.id + " - " + rsInterface.message + "\n");
    			}
    You can print them to the console using this

    Code:
    System.out.println("Id: " + rsInterface.id + " - " + rsInterface.message + "\n");
    but you won't get all interface ids in the console so what you have to do is use the output stream to place them in a file.


    output:

    Code:
    Id: 12224 - % Done
    Id: 12225 - Tutorial Island Progress
    Id: 12229 - Please follow the instructions below
    Id: 12230 - to advance in the tutorial.
    yeap, did that, but simply copied all the stuff in the console, pasted to notepad and ctr+f
    Reply With Quote  
     

  7. #6  
    Ex RuneScape Pioneer

    Join Date
    Jun 2008
    Posts
    3,538
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1015
    Quote Originally Posted by Our Promise View Post
    yeap, did that, but simply copied all the stuff in the console, pasted to notepad and ctr+f
    I just updated my post, please post your original question again because I'm sure many others don't know how to do this. If they search the forums and come across this thread these posts will help them.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 12-20-2014, 07:05 AM
  2. Replies: 1
    Last Post: 04-06-2013, 03:57 AM
  3. How to get interface string ids?
    By eskrow in forum Help
    Replies: 2
    Last Post: 04-09-2011, 07:37 PM
  4. [525]Interface frames/ids
    By Anthony-| in forum Requests
    Replies: 13
    Last Post: 01-13-2009, 04:32 AM
  5. Frame ID Finder
    By flash214 in forum Configuration
    Replies: 10
    Last Post: 02-21-2008, 08:27 AM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •