Thread: Hex

Results 1 to 9 of 9
  1. #1 Hex 
    Registered Member
    Join Date
    Nov 2014
    Posts
    64
    Thanks given
    8
    Thanks received
    4
    Rep Power
    0
    So I am just trying to add some color to this global message but whenever I try to do that, the hex code's wont work. I am not too entirely sure. I highlighted and underlined where the issue lies

    Code:
    package com.ruseps.world.content;
    
    import com.ruseps.engine.task.Task;
    import com.ruseps.engine.task.TaskManager;
    import com.ruseps.model.Animation;
    import com.ruseps.model.GameObject;
    import com.ruseps.model.Item;
    import com.ruseps.util.Misc;
    import com.ruseps.world.World;
    import com.ruseps.world.entity.impl.player.Player;
    
    public class DonatorChest {
    	
    	//Author - Gabbe     /     Michael
    
    	public static void handleChest(final Player p, final GameObject chest) {
    		if(!p.getClickDelay().elapsed(3000)) 
    			return;
    		if(!p.getInventory().contains(3457)) {
    			p.getPacketSender().sendMessage("This chest can only be opened with a Key of Fury. Purchase @ ::store");
    			return;
    		}
    		p.performAnimation(new Animation(827));
    		p.getInventory().delete(989, 1);
    		p.getPacketSender().sendMessage("You open the Chest of Fury...");
    		TaskManager.submit(new Task(1, p, false) {
    			int tick = 0;
    			@Override	
    			public void execute() {
    				switch(tick) {
    				case 2:
    					Item[] loot = itemRewards[Misc.getRandom(itemRewards.length - 1)];
    					for(Item item : loot) {
    						p.getInventory().add(item);
    						World.sendMessage(<col=#FF0000>p.getUsername() + " has received " + item.getDefinition().getName());
    					}
    					p.getPacketSender().sendMessage("..And find some items!");
    					
    					CustomObjects.objectRespawnTask(p, new GameObject(375 , chest.getPosition().copy(), 10, 0), chest, 10);
    					stop();
    					break;
    				}
    				tick++;
    			}
    		});
    		p.getClickDelay().reset();
    	}
    Reply With Quote  
     

  2. #2  
    Banned Hex Market Banned

    -3clipse-'s Avatar
    Join Date
    May 2015
    Posts
    839
    Thanks given
    101
    Thanks received
    311
    Rep Power
    389
    Try it without the # symbol.

    If that doesn't work, convert it from hex to decimal.

    If that doesn't work, then you need the new text engine.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2014
    Posts
    64
    Thanks given
    8
    Thanks received
    4
    Rep Power
    0
    Quote Originally Posted by -3clipse- View Post
    Try it without the # symbol.

    If that doesn't work, convert it from hex to decimal.

    If that doesn't work, then you need the new text engine.
    The Hex Codes itself work, I have them working in other classes. it's just whenever I try it there I get errors!

    Reply With Quote  
     

  4. #4  
    Banned Hex Market Banned

    -3clipse-'s Avatar
    Join Date
    May 2015
    Posts
    839
    Thanks given
    101
    Thanks received
    311
    Rep Power
    389
    Quote Originally Posted by EcosiaX View Post
    The Hex Codes itself work, I have them working in other classes. it's just whenever I try it there I get errors!
    Did you try anything I said?

    Ah, you edited in a picture after I quoted your post. Seems Hank fixed you issue though.
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Aug 2010
    Posts
    3,174
    Thanks given
    1,724
    Thanks received
    2,002
    Rep Power
    3837
    Quote Originally Posted by EcosiaX View Post
    The Hex Codes itself work, I have them working in other classes. it's just whenever I try it there I get errors!

    That's wrong.

    Try:

    World.sendMessage("<col=6600CC>" + p.getUsername() + " has received " etc....
    Reply With Quote  
     

  6. Thankful user:


  7. #6  
    Registered Member
    Join Date
    Nov 2014
    Posts
    64
    Thanks given
    8
    Thanks received
    4
    Rep Power
    0
    Quote Originally Posted by -3clipse- View Post
    Did you try anything I said?

    yes I get "The operator > is undefined for the argument types"
    Reply With Quote  
     

  8. #7  
    Donator


    Join Date
    Aug 2010
    Posts
    3,174
    Thanks given
    1,724
    Thanks received
    2,002
    Rep Power
    3837
    Quote Originally Posted by EcosiaX View Post
    yes I get "The operator > is undefined for the argument types"
    Read my post.
    Reply With Quote  
     

  9. Thankful user:


  10. #8  
    Registered Member
    Join Date
    Nov 2014
    Posts
    64
    Thanks given
    8
    Thanks received
    4
    Rep Power
    0
    Quote Originally Posted by Hank View Post
    That's wrong.

    Try:

    World.sendMessage("<col=6600CC>" + p.getUsername() + " has received " etc....
    Thank you Hank, I feel overly stupid now!
    Reply With Quote  
     

  11. #9  
    Donator


    Join Date
    Aug 2010
    Posts
    3,174
    Thanks given
    1,724
    Thanks received
    2,002
    Rep Power
    3837
    Quote Originally Posted by EcosiaX View Post
    Thank you Hank, I feel overly stupid now!
    Not stupid. Just something for you to remember in the future.
    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. Colours in HEX?
    By Snow Cat123 in forum Help
    Replies: 4
    Last Post: 07-26-2009, 12:23 PM
  2. Hex color RuneScape uses..(blue)
    By Paketa in forum Configuration
    Replies: 17
    Last Post: 07-05-2009, 02:41 AM
  3. [548] update keys [not in hex tho (yet)]
    By Nazi Fish in forum Configuration
    Replies: 8
    Last Post: 06-02-2009, 10:59 PM
  4. Hex Numbers [Worth a look]
    By Scu11 in forum Tutorials
    Replies: 10
    Last Post: 06-12-2008, 10:45 PM
  5. Simple way to find a HEX colour?
    By Zee Best in forum General
    Replies: 2
    Last Post: 05-10-2008, 10:37 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
  •