Thread: ::commands interface glitched

Results 1 to 4 of 4
  1. #1 ::commands interface glitched 
    Registered Member Transcending's Avatar
    Join Date
    Apr 2015
    Posts
    61
    Thanks given
    18
    Thanks received
    2
    Discord
    View profile
    Rep Power
    11
    its showing text from whatever last interface I have opened... when i type any commands they start showing up as i put them in.. lol

    [Only registered and activated users can see links. ]

    commands.java
    Code:
    package ethos.model.players.packets.commands.all;
    
    import java.util.Map.Entry;
    
    import ethos.Server;
    import ethos.model.players.Player;
    import ethos.model.players.packets.commands.Command;
    
    import java.util.Optional;
    
    /**
     * Shows a list of commands.
     * 
     * @author Emiel
     *
     */
    public class Commands extends Command {
    
    	@Override
    	public void execute(Player c, String input) {
    		if (Server.getMultiplayerSessionListener().inAnySession(c)) {
    			return;
    		}
    		int counter = 8144;
    		c.getPA().sendFrame126("@[email protected] Commands", counter++);
    		c.getPA().sendFrame126("", counter++);
    		counter++; // 8146 is already being used
    		counter = sendCommands(c, "all", counter);
    		c.getPA().sendFrame126("", counter++);
    		c.getPA().sendFrame126("@[email protected] Only", counter++);
    		//noinspection UnusedAssignment
    		counter = sendCommands(c, "donator", counter);
    		c.getPA().showInterface(8134);
    	}
    
    	public int sendCommands(Player player, String rank, int counter) {
    		for (Entry<String, Command> entry : ethos.model.players.packets.Commands.COMMAND_MAP.entrySet()) {
    			if (entry.getKey().contains("." + rank.toLowerCase() + ".")) {
    				if (entry.getValue().isHidden()) {
    					continue;
    				}
    				String command = entry.getValue().getClass().getSimpleName().toLowerCase();
    				if (entry.getValue().getParameter().isPresent()) {
    					command += " @[email protected]" + entry.getValue().getParameter().get() + "@[email protected]";
    				}
    				String description = entry.getValue().getDescription().orElse("No description");
    				player.getPA().sendFrame126("@[email protected]::" + command + "@[email protected] - " + description, counter);
    				counter++;
    			}
    		}
    		return counter;
    	}
    
    	@Override
    	public Optional<String> getDescription() {
    		return Optional.of("Shows a list of all commands");
    	}
    
    }
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jun 2013
    Posts
    500
    Thanks given
    119
    Thanks received
    69
    Discord
    View profile
    Rep Power
    0
    Create another loop and execute it before sending your commands with the following:

    Code:
    player.getPA().sendFrame126("", widgetId);
    You can't just expect it to clear it's self, you have to do it
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Transcending's Avatar
    Join Date
    Apr 2015
    Posts
    61
    Thanks given
    18
    Thanks received
    2
    Discord
    View profile
    Rep Power
    11
    Quote Originally Posted by ZenithPS View Post
    Create another loop and execute it before sending your commands with the following:

    Code:
    player.getPA().sendFrame126("", widgetId);
    You can't just expect it to clear it's self, you have to do it
    I got that working now.
    I'm just having issues with the commands showing up.. they only show up in the interface after do each command in game.
    Reply With Quote  
     

  5. #4  
    Banned

    Join Date
    Jun 2013
    Posts
    500
    Thanks given
    119
    Thanks received
    69
    Discord
    View profile
    Rep Power
    0
    Quote Originally Posted by Transcending View Post
    I got that working now.
    I'm just having issues with the commands showing up.. they only show up in the interface after do each command in game.
    Well how are your commands stored? If they're in a map as this code suggests couldn't you just do something like this?
    Code:
            AtomicInteger startingLine = new AtomicInteger(8144);
            map.forEach((key, value) -> {
                player.getPA().sendFrame126("@[email protected]::" + value.getClass().getSimpleName() + "@[email protected] - " + value.getDescription(), startingLine.getAndIncrement());
            });
    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. Dynasty interface glitch?
    By daone11 in forum Help
    Replies: 3
    Last Post: 08-19-2009, 01:43 AM
  2. Make-over interface glitched
    By Defeat__ in forum Help
    Replies: 3
    Last Post: 05-29-2009, 08:46 PM
  3. interface glitch
    By Tyler in forum Help
    Replies: 9
    Last Post: 03-31-2009, 01:56 AM
  4. adding "addxp" command without glitched stats.
    By danxyoo in forum Configuration
    Replies: 9
    Last Post: 08-27-2008, 06:41 PM
  5. walk with interface glitch
    By craig903 in forum Tutorials
    Replies: 5
    Last Post: 11-15-2007, 04:43 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •