Thread: Yell

Results 1 to 10 of 10
  1. #1 Yell 
    Registered Member
    Join Date
    Nov 2012
    Posts
    299
    Thanks given
    14
    Thanks received
    5
    Rep Power
    29
    I've posted about yell chat before and i've worked most things out. My yell method goes through clan chat, thats the way I want it, it has crowns and correct capitalization. What I need help with is making the message red. Trying to use @[email protected] is certain locations didn't work. Here is commands.java:

    Code:
    if (playerCommand.startsWith("Yell")) {
    			String m = playerCommand.substring(4).toLowerCase();
    			if (Connection.isMuted(c)) {
    				c.sendMessage("You cannot yell you are muted.");
    			} else if (c.playerRights >= 0) {
    				c.getPA().sendYell(Misc.optimizeText(m));
    			}
    		}
    PlayerAssistant.java:

    Code:
    public void sendYell(String message) {
    		for (int i = 0; i < PlayerHandler.players.length; i++) {
    			if (PlayerHandler.players[i] == null)
    				continue;
    			Client client = (Client) PlayerHandler.players[i];
    			client.sendClan(Misc.optimizeText(c.playerName), message, "Yell", c.playerRights);
    		}
    	}
    Thanks.
    Spoiler for Respected Users:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Thanks for your help and support!
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Sep 2013
    Posts
    479
    Thanks given
    154
    Thanks received
    101
    Rep Power
    0
    It may be depending on your text engine post your rsfont.java & client.java & textdrawingarea.java
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2012
    Posts
    299
    Thanks given
    14
    Thanks received
    5
    Rep Power
    29
    Okay are RSFont and Textdrawingarea client sided? Cause I don't have them in my server files.

    Client.java:
    Code:
    Apackage server.game.players;
    
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.LinkedList;
    
    
    
    
    import java.util.Queue;
    import java.util.concurrent.Future;
    
    import server.content.quests.CooksAssistant;
    import server.content.quests.DesertTreasure;
    import server.content.quests.DoricsQuest;
    import server.content.quests.HorrorFromTheDeep;
    import server.content.quests.RecipeForDisaster;
    import server.content.skills.Prayer;
    import org.apache.mina.common.IoSession;
    import server.event.CycleEventHandler;
    import server.Config;
    import server.Server;
    import core.util.*;
    import server.game.items.ItemAssistant;
    
    import server.game.players.combat.CombatAssistant;
    import server.game.shops.ShopAssistant;
    import server.content.skills.Farming;
    import core.net.HostList;
    import core.net.Packet;
    import core.net.StaticPacketBuilder;
    import core.util.Misc;
    import core.util.Stream;
    import server.content.skills.*;
    import server.content.skills.misc.SkillInterfaces;
    import server.content.skills.misc.SmithingInterface;
    import server.event.EventManager;
    import server.event.Event;
    import server.event.EventContainer;
    import server.content.quests.*;
    
    public class Client extends Player {
    
    	public byte buffer[] = null;
    	public Stream inStream = null, outStream = null;
    	private IoSession session;
    	private ItemAssistant itemAssistant = new ItemAssistant(this);
    	private ShopAssistant shopAssistant = new ShopAssistant(this);
    	private TradeAndDuel tradeAndDuel = new TradeAndDuel(this);
    	private PlayerAssistant playerAssistant = new PlayerAssistant(this);
    	private CombatAssistant combatAssistant = new CombatAssistant(this);
    	private ActionHandler actionHandler = new ActionHandler(this);
    	private PlayerKilling playerKilling = new PlayerKilling(this);
    	private DialogueHandler dialogueHandler = new DialogueHandler(this);
    	private Queue<Packet> queuedPackets = new LinkedList<Packet>();
    	private Potions potions = new Potions(this);
    	private Fishing fish = new Fishing(this);
    	private PotionMixing potionMixing = new PotionMixing(this);
    	private Food food = new Food(this);
    	private ActionAssistant2 actionAssistant2 = new ActionAssistant2(this);
    	//private TutorialIsland tutorialIsland = new TutorialIsland(this);
    
    	private SkillInterfaces skillInterfaces = new SkillInterfaces(this);
    
    	/**
    	 * Quests
    	 */
    	private DesertTreasure desertTreasure = new DesertTreasure(this);
    	private HorrorFromTheDeep horrorFromTheDeep = new HorrorFromTheDeep(this);
    	private RecipeForDisaster recipeForDisaster = new RecipeForDisaster(this);
    	private CooksAssistant cooksAssistant = new CooksAssistant(this);
    	private DoricsQuest doricsQuest = new DoricsQuest(this);
    
    	/**
    	 * Skill instances
    	 */
    	private Slayer slayer = new Slayer(this);
    	private Runecrafting runecrafting = new Runecrafting(this);
    	private Agility agility = new Agility(this);
    	//private Cooking cooking = new Cooking(this);
    	private Crafting crafting = new Crafting(this);
    	//private Fletching fletching = new Fletching(this);
    	private Farming farming = new Farming(this);
    	private Prayer prayer = new Prayer(this);
    	private SmithingInterface smithInt = new SmithingInterface(this);
    	private Smithing smith = new Smithing(this);
    	private Thieving thieving = new Thieving(this);
    	private Magic magic = new Magic(this);
    	private Herblore herblore = new Herblore(this);
    
    	//private int somejunk;
    	public int lowMemoryVersion = 0;
    	public int timeOutCounter = 0;		
    	public int returnCode = 2; 
    	private Future<?> currentTask;
    	public int currentRegion = 0;
    	public boolean attackSkill = false;
    	public boolean usingLevel = false;
    	public boolean strengthSkill = false;
    	public boolean defenceSkill = false;
    	public boolean mageSkill = false;
    	public boolean rangeSkill = false;
    	public boolean prayerSkill = false;
    	public boolean healthSkill = false;
    
    	public Client(IoSession s, int _playerId) {
    		super(_playerId);
    		this.session = s;
    		//synchronized(this) {
    			outStream = new Stream(new byte[Config.BUFFER_SIZE]);
    			outStream.currentOffset = 0;
    
    			inStream = new Stream(new byte[Config.BUFFER_SIZE]);
    			inStream.currentOffset = 0;
    			buffer = new byte[Config.BUFFER_SIZE];
    		//}
    	}
    
    	/**
    	 * Shakes the player's screen.
    	 * Parameters 1, 0, 0, 0 to reset.
    	 * @param verticleAmount How far the up and down shaking goes (1-4).
    	 * @param verticleSpeed How fast the up and down shaking is.
    	 * @param horizontalAmount How far the left-right tilting goes.
    	 * @param horizontalSpeed How fast the right-left tiling goes..
    	 */
    
    	public void shakeScreen(int verticleAmount, int verticleSpeed, int horizontalAmount, int horizontalSpeed) {
    		outStream.createFrame(35); // Creates frame 35.
    		outStream.writeByte(verticleAmount);
    		outStream.writeByte(verticleSpeed);
    		outStream.writeByte(horizontalAmount);
    		outStream.writeByte(horizontalSpeed);
    	}
    
    	/**
    	 * Resets the shaking of the player's screen.
    	 */
    	public void resetShaking() {
    		shakeScreen(1, 0, 0, 0);
    	}
    
    	public void flushOutStream() {	
    		if(disconnected || outStream.currentOffset == 0) return;
    		//synchronized(this) {	
    			StaticPacketBuilder out = new StaticPacketBuilder().setBare(true);
    			byte[] temp = new byte[outStream.currentOffset]; 
    			System.arraycopy(outStream.buffer, 0, temp, 0, temp.length);
    			out.addBytes(temp);
    			session.write(out.toPacket());
    			outStream.currentOffset = 0;
    		//}
    	}
    	
    	/**
    	 * Automated server message to send reminders to people
    	 */
    	public void sMessage() {
    		EventManager.getSingleton().addEvent(new Event() {
    			public void execute(EventContainer c) {
    				if(Config.LAST_MESSAGE == 0) {
    					sendMessage("@[email protected][Server]@[email protected] can now @[email protected]::vote @[email protected] 25m + 25 TPK Points. ");
    					Config.LAST_MESSAGE = 1;
    				} else if(Config.LAST_MESSAGE == 1) {
    					sendMessage("@[email protected][Hint]@[email protected] you invite 5 friends you will receive free @[email protected] @[email protected]!");
    					Config.LAST_MESSAGE = 2;
    				} else if(Config.LAST_MESSAGE == 2);
    					sendMessage("@[email protected][Notice]@[email protected] is still under construction.");
    					Config.LAST_MESSAGE = 0;
    			}
    		}, 300000);//the yell timer - 5 minutes
    	}
    	
    	public Fishing getFishing() {
    		return fish;
    	}
    
    	public void sendClan(String name, String message, String clan, int rights) {
    		outStream.createFrameVarSizeWord(217);
    		outStream.writeString(name);
    		outStream.writeString(message);
    		outStream.writeString(clan);
    		outStream.writeWord(rights);
    		outStream.endFrameVarSize();
    	}
    
    	public static final int PACKET_SIZES[] = {
    		0, 0, 0, 1, -1, 0, 0, 0, 0, 0, //0
    		0, 0, 0, 0, 8, 0, 6, 2, 2, 0,  //10
    		0, 2, 0, 6, 0, 12, 0, 0, 0, 0, //20
    		0, 0, 0, 0, 0, 8, 4, 0, 0, 2,  //30
    		2, 6, 0, 6, 0, -1, 0, 0, 0, 0, //40
    		0, 0, 0, 12, 0, 0, 0, 8, 8, 12, //50
    		8, 8, 0, 0, 0, 0, 0, 0, 0, 0,  //60
    		6, 0, 2, 2, 8, 6, 0, -1, 0, 6, //70
    		0, 0, 0, 0, 0, 1, 4, 6, 0, 0,  //80
    		0, 0, 0, 0, 0, 3, 0, 0, -1, 0, //90
    		0, 13, 0, -1, 0, 0, 0, 0, 0, 0,//100
    		0, 0, 0, 0, 0, 0, 0, 6, 0, 0,  //110
    		1, 0, 6, 0, 0, 0, -1, 0, 2, 6, //120
    		0, 4, 6, 8, 0, 6, 0, 0, 0, 2,  //130
    		0, 0, 0, 0, 0, 6, 0, 0, 0, 0,  //140
    		0, 0, 1, 2, 0, 2, 6, 0, 0, 0,  //150
    		0, 0, 0, 0, -1, -1, 0, 0, 0, 0,//160
    		0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  //170
    		0, 8, 0, 3, 0, 2, 0, 0, 8, 1,  //180
    		0, 0, 12, 0, 0, 0, 0, 0, 0, 0, //190
    		2, 0, 0, 0, 0, 0, 0, 0, 4, 0,  //200
    		4, 0, 0, 0, 7, 8, 0, 0, 10, 0, //210
    		0, 0, 0, 0, 0, 0, -1, 0, 6, 0, //220
    		1, 0, 0, 0, 6, 0, 6, 8, 1, 0,  //230
    		0, 4, 0, 0, 0, 0, -1, 0, -1, 4,//240
    		0, 0, 6, 6, 0, 0, 0            //250
    	};
    
    	public void destruct() {
    		if(session == null) 
    			return;
    		//PlayerSaving.getSingleton().requestSave(playerId);
    		getPA().removeFromCW();
    		if (inPits)
    			Server.fightPits.removePlayerFromPits(playerId);
    		if (clanId >= 0)
    			Server.clanChat.leaveClan(playerId, clanId);
    		Misc.println("[OFFLINE]: "+ Misc.capitalize(playerName) +"");
    		CycleEventHandler.getSingleton().stopEvents(this);
    		HostList.getHostList().remove(session);
    		disconnected = true;
    		session.close();
    		session = null;
    		inStream = null;
    		outStream = null;
    		isActive = false;
    		buffer = null;
    		super.destruct();
    	}
    
    
    	public void sendMessage(String s) {
    		//synchronized (this) {
    		if(getOutStream() != null) {
    			outStream.createFrameVarSize(253);
    			outStream.writeString(s);
    			outStream.endFrameVarSize();
    		}
    
    	}
    
    	public void setSidebarInterface(int menuId, int form) {
    		//synchronized (this) {
    		if(getOutStream() != null) {
    			outStream.createFrame(71);
    			outStream.writeWord(form);
    			outStream.writeByteA(menuId);
    		}
    
    	}	
    	
    	//needs our own check script
    	public boolean checkVotes(String playerName) {
    		try {
    			String urlString = "http://www.acquittalrsps.net/vote/php/callback.php?callback="+playerName;
    			urlString = urlString.replaceAll(" ", "%20");
    			URL url = new URL(urlString);
    			BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
    			String results = reader.readLine();
    			if(results.length() > 0) {
    				if(results.equals("1.5M Gold coins."))
    					return true;
    				else 
    					return false;
    			}
    		} catch (MalformedURLException e) {
    			System.out.println("Malformed URL Exception in checkVotes(String playerName)");
    		} catch (IOException e) {
    			System.out.println("IO Exception in checkVotes(String playerName)");
    		}
    		return false;
    	}
    
    	public void initialize() {
    		//synchronized (this) 
    		//welcomeScreenInterface();
    		//getPA().loadQuests();
    		MadTurnipConnection.addDonateItems(this,playerName);
    		outStream.createFrame(249);
    		outStream.writeByteA(1);		// 1 for members, zero for free
    		outStream.writeWordBigEndianA(playerId);
    		for (int j = 0; j < Server.playerHandler.players.length; j++) {
    			if (j == playerId)
    				continue;
    			if (Server.playerHandler.players[j] != null) {
    				if (Server.playerHandler.players[j].playerName.equalsIgnoreCase(playerName))
    					disconnected = true;
    			}
    		}
    		//getPA().setSidebarInterfaces(this);
    		//if(showWelcomeScreen){
    		//getPA().showInterface(15244);
    		//}
    		for (int i = 0; i < 25; i++) {
    			getPA().setSkillLevel(i, playerLevel[i], playerXP[i]);
    			getPA().refreshSkill(i);
    		}
    		for(int p = 0; p < PRAYER.length; p++) { // reset prayer glows 
    			prayerActive[p] = false;
    			getPA().sendFrame36(PRAYER_GLOW[p], 0);	
    		}
    		getPA().handleWeaponStyle();
    		getPA().handleLoginText();
    		accountFlagged = getPA().checkForFlags();
    		//getPA().sendFrame36(43, fightMode-1);
    		getPA().sendFrame36(108, 0);//resets autocast button
    		getPA().sendFrame36(172, 1);
    		getPA().sendFrame107(); // reset screen
    		getPA().setChatOptions(0, 0, 0); // reset private messaging options
    		setSidebarInterface(1, 3917);
    		setSidebarInterface(2, 638);
    		setSidebarInterface(3, 3213);
    		setSidebarInterface(4, 1644);
    		setSidebarInterface(5, 5608);
    		if(playerMagicBook == 0) {
    			setSidebarInterface(6, 1151); //modern
    		} else if (playerMagicBook == 1){
    			setSidebarInterface(6, 12855); // ancient
    		} else if (playerMagicBook == 2){
    			setSidebarInterface(6, 29999);
    		}
    		correctCoordinates();
    		setSidebarInterface(7, 18128);		
    		setSidebarInterface(8, 5065);
    		setSidebarInterface(9, 5715);
    		setSidebarInterface(10, 2449);
    		//setSidebarInterface(11, 4445); // wrench tab
    		setSidebarInterface(11, 904); // wrench tab
    		setSidebarInterface(12, 147); // run tab
    		setSidebarInterface(13, -1);
    		setSidebarInterface(0, 2423);
    		/**
    		 * The server double exp events - return the boolean
    		 * condition as true for the weekend from 01200 to 0100
    		 */
    		sendMessage("Welcome to @[email protected]"+Config.SERVER_NAME+".");
    		if(playerRights == 4) {
    			if(Config.WEEKEND_DOUBLE_EXP == true) {
    				sendMessage("@[email protected] the double EXP weekend event!");
    			}
    			sendMessage("You are currently a @[email protected]!");
    			sendMessage("Thank you for contributing to us, and enjoy your day playing @[email protected]!");
    		} else {
    			sendMessage("You are currently @[email protected] a donator.");
    			sendMessage("You can donate by typing @[email protected]::donate @[email protected], then proceed with the instructions given.");
    		}
    		getPA().showOption(4, 0,"Follow", 4);
    		getPA().showOption(5, 0,"Trade With", 3);
    		safeTimer = 0;
    		getItems().resetItems(3214);
    		getItems().sendWeapon(playerEquipment[playerWeapon], getItems().getItemName(playerEquipment[playerWeapon]));
    		getItems().resetBonus();
    		getItems().getBonus();
    		getItems().writeBonus();
    		getItems().setEquipment(playerEquipment[playerHat],1,playerHat);
    		getItems().setEquipment(playerEquipment[playerCape],1,playerCape);
    		getItems().setEquipment(playerEquipment[playerAmulet],1,playerAmulet);
    		getItems().setEquipment(playerEquipment[playerArrows],playerEquipmentN[playerArrows],playerArrows);
    		getItems().setEquipment(playerEquipment[playerChest],1,playerChest);
    		getItems().setEquipment(playerEquipment[playerShield],1,playerShield);
    		getItems().setEquipment(playerEquipment[playerLegs],1,playerLegs);
    		getItems().setEquipment(playerEquipment[playerHands],1,playerHands);
    		getItems().setEquipment(playerEquipment[playerFeet],1,playerFeet);
    		getItems().setEquipment(playerEquipment[playerRing],1,playerRing);
    		getItems().setEquipment(playerEquipment[playerWeapon],playerEquipmentN[playerWeapon],playerWeapon);
    		getCombat().getPlayerAnimIndex(getItems().getItemName(playerEquipment[playerWeapon]).toLowerCase());
    		getPA().logIntoPM();
    		getItems().addSpecialBar(playerEquipment[playerWeapon]);
    		saveTimer = Config.SAVE_TIMER;
    		saveCharacter = true;
    		Misc.println("[ONLINE]: "+Misc.capitalize(playerName)+"");
    		handler.updatePlayer(this, outStream);
    		handler.updateNPC(this, outStream);
    		flushOutStream();
    		sMessage();
    		getPA().clearClanChat();
    		getPA().resetFollow();
    		if (addStarter)
    			getPA().addStarter();
    		if (autoRet == 1)
    			getPA().sendFrame36(172, 1);
    		else
    			getPA().sendFrame36(172, 0);
    		totalLevel = getPA().totalLevel();
    		xpTotal = getPA().xpTotal();
    		HighscoresConfig.updateHighscores(this);
    	}
    
    	private Highscores highscores = new Highscores(this);
    
    	public Highscores getHighscores() {
    		return highscores;
    	}
    
    
    
    
    	public void update() {
    		//synchronized (this) {
    		handler.updatePlayer(this, outStream);
    		handler.updateNPC(this, outStream);
    		flushOutStream();
    
    	}
    
    	public void logout() {
    		//synchronized (this) {
    		if(System.currentTimeMillis() - logoutDelay > 10000) {
    			outStream.createFrame(109);
    			CycleEventHandler.getSingleton().stopEvents(this);
    			properLogout = true;
    		} else {
    			sendMessage("You must wait a few seconds from being out of combat to logout.");
    		}
    
    	}
    
    	public int packetSize = 0, packetType = -1;
    	public int totalPlaytime(){
    		return (pTime / 2);}
    	public String getPlaytime(){
    		int DAY = (totalPlaytime() / 86400);
    		int HR = (totalPlaytime() / 3600) - (DAY * 24);
    		int MIN = (totalPlaytime() / 60) - (DAY * 1440) - (HR * 60);
    		return (DAY+" days "+HR+" hours "+MIN+" minutes");
    	}
    	public String getSmallPlaytime(){
    		int DAY = (totalPlaytime() / 86400);
    		int HR = (totalPlaytime() / 3600) - (DAY * 24);
    		int MIN = (totalPlaytime() / 60) - (DAY * 1440) - (HR * 60);
    		return ("Day:"+DAY+"/Hr:"+HR+"/Min:"+MIN+"");
    	}
    
    	public void process() {
    		if (overloadcounter > 0) {
    			startAnimation(2383);//if loading 602 (3170)
    			dealDamage(10);
    			handleHitMask(10);
    			overloadcounter -= 1;
    			getPA().refreshSkill(3);	
    		}
    		if (smeltTimer > 0 && smeltType > 0) {
    			smeltTimer--;
    		} else if (smeltTimer == 0 && smeltType > 0) {
    			getSmithing().smelt(smeltType);
    		}
    		if(inWild()) {
    			safeTimer = 5;
    		}
    		if(safeTimer > 0 && !inWild()) {
    			safeTimer--;
    		}
    		if(!isResting) {
    			if (playerEnergy < 100 && System.currentTimeMillis() - lastIncrease >= getPA().raiseTimer()) {
    				playerEnergy += 1;
    				lastIncrease = System.currentTimeMillis();
    			}
    		}
    		if(isResting) {
    			if (playerEnergy < 100 && System.currentTimeMillis() - lastIncrease >= getPA().raiseTimer2()) {
    				playerEnergy += 1;
    				lastIncrease = System.currentTimeMillis();
    			}
    		}
    		getPA().writeEnergy();
    		if(System.currentTimeMillis() - specDelay > Config.INCREASE_SPECIAL_AMOUNT) {
    			specDelay = System.currentTimeMillis();
    			if(specAmount < 10) {
    				specAmount += .5;
    				if (specAmount > 10)
    					specAmount = 10;
    				getItems().addSpecialBar(playerEquipment[playerWeapon]);
    			}
    		}
    
    		if(followId > 0) {
    			getPA().followPlayer();
    		} else if (followId2 > 0) {
    			getPA().followNpc();
    		}
    		getFishing().FishingProcess();
    		getCombat().handlePrayerDrain();
    		if(System.currentTimeMillis() - singleCombatDelay >  3300) {
    			underAttackBy = 0;
    		}
    		if (System.currentTimeMillis() - singleCombatDelay2 > 3300) {
    			underAttackBy2 = 0;
    		}
    
    		if(System.currentTimeMillis() - restoreStatsDelay >  60000) {
    			restoreStatsDelay = System.currentTimeMillis();
    			for (int level = 0; level < playerLevel.length; level++)  {
    				if (playerLevel[level] < getLevelForXP(playerXP[level])) {
    					if(level != 5) { // prayer doesn't restore
    						playerLevel[level] += 1;
    						getPA().setSkillLevel(level, playerLevel[level], playerXP[level]);
    						getPA().refreshSkill(level);
    					}
    				} else if (playerLevel[level] > getLevelForXP(playerXP[level])) {
    					playerLevel[level] -= 1;
    					getPA().setSkillLevel(level, playerLevel[level], playerXP[level]);
    					getPA().refreshSkill(level);
    				}
    			}
    		}
    
    		if(inWild()) {
    			int modY = absY > 6400 ?  absY - 6400 : absY;
    			wildLevel = (((modY - 3520) / 8) + 1);
    			getPA().walkableInterface(197);
    			if(Config.SINGLE_AND_MULTI_ZONES) {
    				if(inMulti()) {
    					getPA().sendFrame126("@[email protected]: "+wildLevel, 199);
    				} else {
    					getPA().sendFrame126("@[email protected]: "+wildLevel, 199);
    				}
    			} else {
    				getPA().multiWay(-1);
    				getPA().sendFrame126("@[email protected]: "+wildLevel, 199);
    			}
    			getPA().showOption(3, 0, "Attack", 1);
    		} else if (inDuelArena()) {
    			getPA().walkableInterface(201);
    			if(duelStatus == 5) {
    				getPA().showOption(3, 0, "Attack", 1);
    			} else {
    				getPA().showOption(3, 0, "Challenge", 1);
    			}
    		} else if (!inWild() && safeTimer > 0){
    			getPA().walkableInterface(197);
    			wildLevel = (60);
    			getPA().showOption(3, 0, "Attack", 1);
    			getPA().sendFrame126("@[email protected]"+safeTimer, 199);
    		} else if(inPcBoat()) {
    			getPA().walkableInterface(21119);
    		} else if(inPcGame()) {
    			getPA().walkableInterface(21100);
    		} else if(inBarrows()){
    			//getPA().sendFrame99(2);
    			getPA().sendFrame126("Kill Count: "+barrowsKillCount, 4536);
    			getPA().walkableInterface(4535);
    		} else if (inCwGame || inPits) {
    			getPA().showOption(3, 0, "Attack", 1);	
    		} else if (getPA().inPitsWait()) {
    			getPA().showOption(3, 0, "Null", 1);
    		}else if (!inCwWait) {
    			getPA().sendFrame99(0);
    			getPA().walkableInterface(-1);
    			getPA().showOption(3, 0, "Null", 1);
    		}
    
    		if(!hasMultiSign && inMulti()) {
    			hasMultiSign = true;
    			getPA().multiWay(1);
    		}
    
    		if(hasMultiSign && !inMulti()) {
    			hasMultiSign = false;
    			getPA().multiWay(-1);
    		}
    
    		if(skullTimer > 0) {
    			skullTimer--;
    			if(skullTimer == 1) {
    				isSkulled = false;
    				attackedPlayers.clear();
    				headIconPk = -1;
    				skullTimer = -1;
    				getPA().requestUpdates();
    			}	
    		}
    
    		if(isDead && respawnTimer == -6) {
    			getPA().applyDead();
    		}
    
    		if(respawnTimer == 7) {
    			respawnTimer = -6;
    			getPA().giveLife();
    		} else if(respawnTimer == 12) {
    			respawnTimer--;
    			startAnimation(0x900);
    			poisonDamage = -1;
    		}	
    
    		if(respawnTimer > -6) {
    			respawnTimer--;
    		}
    		if(freezeTimer > -6) {
    			freezeTimer--;
    			if (frozenBy > 0) {
    				if (Server.playerHandler.players[frozenBy] == null) {
    					freezeTimer = -1;
    					frozenBy = -1;
    				} else if (!goodDistance(absX, absY, Server.playerHandler.players[frozenBy].absX, Server.playerHandler.players[frozenBy].absY, 20)) {
    					freezeTimer = -1;
    					frozenBy = -1;
    				}
    			}
    		}
    
    		if(hitDelay > 0) {
    			hitDelay--;
    		}
    		if(pTime != 2147000000){
    			pTime++;}
    		if(teleTimer > 0) {
    			teleTimer--;
    			if (!isDead) {
    				if(teleTimer == 1 && newLocation > 0) {
    					teleTimer = 0;
    					getPA().changeLocation();
    				}
    				if(teleTimer == 5) {
    					teleTimer--;
    					getPA().processTeleport();
    				}
    				if(teleTimer == 9 && teleGfx > 0) {
    					teleTimer--;
    					gfx100(teleGfx);
    				}
    			} else {
    				teleTimer = 0;
    			}
    		}	
    
    		if(hitDelay == 1) {
    			if(oldNpcIndex > 0) {
    				getCombat().delayedHit(oldNpcIndex);
    			}
    			if(oldPlayerIndex > 0) {
    				getCombat().playerDelayedHit(oldPlayerIndex);				
    			}		
    		}
    
    		if(attackTimer > 0) {
    			attackTimer--;
    		}
    
    		if(attackTimer == 1){
    			if(npcIndex > 0 && clickNpcType == 0) {
    				getCombat().attackNpc(npcIndex);
    			}
    			if(playerIndex > 0) {
    				getCombat().attackPlayer(playerIndex);
    			}
    		} else if (attackTimer <= 0 && (npcIndex > 0 || playerIndex > 0)) {
    			if (npcIndex > 0) {
    				attackTimer = 0;
    				getCombat().attackNpc(npcIndex);
    			} else if (playerIndex > 0) {
    				attackTimer = 0;
    				getCombat().attackPlayer(playerIndex);
    			}
    		}
    
    		if(timeOutCounter > Config.TIMEOUT) {
    			disconnected = true;
    		}
    
    		timeOutCounter++;
    
    		if(inTrade && tradeResetNeeded){
    			Client o = (Client) Server.playerHandler.players[tradeWith];
    			if(o != null){
    				if(o.tradeResetNeeded){
    					getTradeAndDuel().resetTrade();
    					o.getTradeAndDuel().resetTrade();
    				}
    			}
    		}
    	}
    
    	public void setCurrentTask(Future<?> task) {
    		currentTask = task;
    	}
    
    	public Future<?> getCurrentTask() {
    		return currentTask;
    	}
    
    	public synchronized Stream getInStream() {
    		return inStream;
    	}
    
    	public synchronized int getPacketType() {
    		return packetType;
    	}
    
    	public synchronized int getPacketSize() {
    		return packetSize;
    	}
    
    	public synchronized Stream getOutStream() {
    		return outStream;
    	}
    
    	public ItemAssistant getItems() {
    		return itemAssistant;
    	}
    
    	public PlayerAssistant getPA() {
    		return playerAssistant;
    	}
    
    	public DialogueHandler getDH() {
    		return dialogueHandler;
    	}
    
    	public ShopAssistant getShops() {
    		return shopAssistant;
    	}
    
    	public TradeAndDuel getTradeAndDuel() {
    		return tradeAndDuel;
    	}
    
    	public CombatAssistant getCombat() {
    		return combatAssistant;
    	}
    
    	public ActionHandler getActions() {
    		return actionHandler;
    	}
    
    	public PlayerKilling getKill() {
    		return playerKilling;
    	}
    
    	public IoSession getSession() {
    		return session;
    	}
    
    	public Potions getPotions() {
    		return potions;
    	}
    
    	public PotionMixing getPotMixing() {
    		return potionMixing;
    	}
    
    	public Food getFood() {
    		return food;
    	}
    
    	private boolean isBusy = false;
    	private boolean isBusyHP = false;
    	public boolean isBusyFollow = false;
    
    	public boolean checkBusy() {
    		/*if (getCombat().isFighting()) {
    			return true;
    		}*/
    		if (isBusy) {
    			//actionAssistant.sendMessage("You are too busy to do that.");
    		}
    		return isBusy;
    	}
    
    	public boolean checkBusyHP() {
    		return isBusyHP;
    	}
    
    	public boolean checkBusyFollow() {
    		return isBusyFollow;
    	}
    
    	public void setBusy(boolean isBusy) {
    		this.isBusy = isBusy;
    	}
    
    	public boolean isBusy() {
    		return isBusy;
    	}
    
    	public void setBusyFollow(boolean isBusyFollow) {
    		this.isBusyFollow = isBusyFollow;
    	}
    
    	public void setBusyHP(boolean isBusyHP) {
    		this.isBusyHP = isBusyHP;
    	}
    
    	public boolean isBusyHP() {
    		return isBusyHP;
    	}
    	public boolean isBusyFollow() {
    		return isBusyFollow;
    	}	
    
    	private boolean canWalk = true;
    	public long waitTime;
    
    	public boolean canWalk() {
    		return canWalk;
    	}
    
    	public void setCanWalk(boolean canWalk) {
    		this.canWalk = canWalk;
    	}
    
    	public PlayerAssistant getPlayerAssistant() {
    		return playerAssistant;
    	}
    
    	public ActionAssistant2 getAA2() {
    		return actionAssistant2;
    	}
    
    	public DesertTreasure getDT() {
    		return desertTreasure;
    	}
    
    	public HorrorFromTheDeep getHfd() {
    		return horrorFromTheDeep;
    	}
    
    	public RecipeForDisaster getRfd() {
    		return recipeForDisaster;
    	}
    
    	public CooksAssistant getCA() {
    		return cooksAssistant;
    	}
    
    	public DoricsQuest getDQ() {
    		return doricsQuest;
    	}
    
    	public SkillInterfaces getSI() {
    		return skillInterfaces;
    	}
    
    	/**
    	 * Skill Constructors
    	 */
    	public Slayer getSlayer() {
    		return slayer;
    	}
    
    	public Runecrafting getRunecrafting() {
    		return runecrafting;
    	}
    
    
    
    	/*public Cooking getCooking() {
    		return cooking;
    	}*/
    
    	public Agility getAgil() {
    		return agility;
    	}
    
    
    	public Crafting getCrafting() {
    		return crafting;
    	}
    
    	public SmithingInterface getSmithingInt() {
    		return smithInt;
    	}
    
    	public Smithing getSmithing() {
    		return smith;
    	}
    
    	public Farming getFarming() {
    		return farming;
    	}
    
    	public Thieving getThieving() {
    		return thieving;
    	}
    
    	public Herblore getHerblore() {
    		return herblore;
    	}
    
    	/*public Fletching getFletching() { 
    		return fletching;
    	}*/
    
    	public Magic getMagic() {
    		return magic;
    	}
    
    	public Prayer getPrayer() { 
    		return prayer;
    	}
    
    	/**
    	 * End of Skill Constructors
    	 */
    
    	public void queueMessage(Packet arg1) {
    		synchronized(queuedPackets) {
    			//if (arg1.getId() != 41)
    			queuedPackets.add(arg1);
    			//else
    			//processPacket(arg1);
    		}
    	}
    
    	public synchronized boolean processQueuedPackets() {
    		Packet p = null;
    		synchronized(queuedPackets) {
    			p = queuedPackets.poll();
    		}
    		if(p == null) {
    			return false;
    		}
    		inStream.currentOffset = 0;
    		packetType = p.getId();
    		packetSize = p.getLength();
    		inStream.buffer = p.getData();
    		if(packetType > 0) {
    			//sendMessage("PacketType: " + packetType);
    			PacketHandler.processPacket(this, packetType, packetSize);
    		}
    		timeOutCounter = 0;
    		return true;
    	}
    
    	public synchronized boolean processPacket(Packet p) {
    		synchronized (this) {
    			if(p == null) {
    				return false;
    			}
    			inStream.currentOffset = 0;
    			packetType = p.getId();
    			packetSize = p.getLength();
    			inStream.buffer = p.getData();
    			if(packetType > 0) {
    				//sendMessage("PacketType: " + packetType);
    				PacketHandler.processPacket(this, packetType, packetSize);
    			}
    			timeOutCounter = 0;
    			return true;
    		}
    	}
    
    
    
    
    
    	public void correctCoordinates() {
    		if (inPcGame()) {
    			getPA().movePlayer(2657, 2639, 0);
    		}
    		if (inFightCaves()) {
    			getPA().movePlayer(absX, absY, playerId * 4);
    			sendMessage("Your wave will start in 10 seconds.");
    			EventManager.getSingleton().addEvent(new Event() {
    				public void execute(EventContainer c) {
    					Server.fightCaves.spawnNextWave((Client)Server.playerHandler.players[playerId]);
    					c.stop();
    				}
    			}, 10000);
    
    		}
    
    	}
    
    }
    Spoiler for Respected Users:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Thanks for your help and support!
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Aug 2007
    Posts
    4,143
    Thanks given
    0
    Thanks received
    64
    Rep Power
    0
    You have to add a new text engine if you don't have @[email protected] or <col>
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Sep 2013
    Posts
    479
    Thanks given
    154
    Thanks received
    101
    Rep Power
    0
    I need all your classes from the client side

    And yeah firstly word its better to check if he has the <col tag implemented if not he will probably need to add a new text engine
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2012
    Posts
    299
    Thanks given
    14
    Thanks received
    5
    Rep Power
    29
    I have @[email protected] I just don't know where it should be placed in order to make the yell message red?
    Spoiler for Respected Users:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Thanks for your help and support!
    Reply With Quote  
     

  7. #7  
    Extreme Donator

    cloak's Avatar
    Join Date
    Sep 2007
    Posts
    86
    Thanks given
    29
    Thanks received
    42
    Rep Power
    105
    Quote Originally Posted by Drewski View Post
    I have @[email protected] I just don't know where it should be placed in order to make the yell message red?
    There is an edit required client-sided to enable sendMessage's use of colours. [Only registered and activated users can see links. ] Pretty simple tutorial, thank Unborn & sigex. If you get stuck send me a PM.
    ;-;
    Reply With Quote  
     

  8. #8  
    Aspiring Physicist

    Cartilage's Avatar
    Join Date
    Feb 2014
    Age
    19
    Posts
    501
    Thanks given
    377
    Thanks received
    359
    Rep Power
    5000
    Quote Originally Posted by Drewski View Post
    I have @[email protected] I just don't know where it should be placed in order to make the yell message red?
    In your command, change
    Code:
    c.getPA().sendYell(Misc.optimizeText(m));
    to
    Code:
    String xd = new StringBuilder().append("@[email protected]").append(Misc.optimizeText(m)).toString();
    c.getPA().sendYell(xd);
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Nov 2012
    Posts
    299
    Thanks given
    14
    Thanks received
    5
    Rep Power
    29
    Ill try both your solutions. Thanks.

    Cartilage it didn't work I get this:


    010253 My client has sendmessage's use of color.
    Spoiler for Respected Users:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Thanks for your help and support!
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Nov 2012
    Posts
    299
    Thanks given
    14
    Thanks received
    5
    Rep Power
    29
    Still need help? Bump-
    Spoiler for Respected Users:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Thanks for your help and support!
    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. Replies: 18
    Last Post: 03-19-2008, 12:43 PM
  2. Guy yelling at cat
    By Numbers in forum Videos
    Replies: 4
    Last Post: 03-16-2008, 07:22 PM
  3. Making Yell command log to a seperate file
    By DegeneralizationX in forum Tutorials
    Replies: 8
    Last Post: 10-04-2007, 05:20 AM
  4. Censoring yell
    By Bushido in forum Tutorials
    Replies: 6
    Last Post: 09-17-2007, 01:49 PM
  5. How to add a good logging system [CHAT,CMDS,YELL]
    By Shawn101 in forum Tutorials
    Replies: 8
    Last Post: 08-16-2007, 02:10 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
  •