|
Just made this for fun, you guys can have it.
Spoiler for Media:
Enjoy.
Sprites: mega.nz
Add this to your desired location:
Add this class to server:Code:ActivityFeed.sumbit(other, player);
Add this code to client in RSInterface:Code:package org.kelda.node.content; import java.util.ArrayList; import java.util.List; import org.kelda.node.entity.World; import org.kelda.node.entity.mobile.player.Player; import org.kelda.node.entity.mobile.player.net.out.impl.SendString; /** * Activity feed * @author snowman5069 x trees */ public class ActivityFeed { private static short time = 100; static int ids[] = { 25358, 25359, 25360 }; public static final List<String> entries = new ArrayList<String>(); public static void update() { //System.out.println("[Activity HUD] : Update() - sending announcements.. size = " + entries.size()); for (int j = 0; j < World.getPlayers().length; j++) { if (World.getPlayers()[j] != null) { Player player = World.getPlayers()[j]; if ((player != null) && (entries != null)) { updateInterface(player, entries); } } } // shift(); } public static void sumbit(Player other, Player player) { if (entries.size() >= 3) { shift(); } entries.add("" + other.getPlayer().getUsername() + " has killed " + player.getPlayer().getUsername() + "!"); update(); } private static void sendGlocalAnnouncement(String entry, int id) { for (Player i : World.getPlayers()) if (i != null) i.send(new SendString(entry, id)); } public static void tick() { time--; if (time == 0) { shift(); update(); time = 100; } } private static void shift() { if (entries.isEmpty()) { return; } entries.remove(0); } private static void updateInterface(Player player, List<String> entries2) { sendGlocalAnnouncement(entries.size() > 0 ? entries.get(0).toString() : "", ids[0]); sendGlocalAnnouncement(entries.size() > 1 ? entries.get(1).toString() : "", ids[1]); sendGlocalAnnouncement(entries.size() > 2 ? entries.get(2).toString() : "", ids[2]); } }
Code:public static void bountyHunter(TextDrawingArea[] tda) { RSInterface tab = addInterface(25347); tab.totalChildren(13); addText(25349, "Bounty Target:", 0xffcccc, true, true, -1, tda, 1); addText(25350, "snowman5069", 0xff6666, true, true, -1, tda, 2); addText(25351, "@or1@2147m", 0xff3333, false, true, -1, tda, 1); addText(25352, "+Timer Sec", 0xff6666, true, true, -1, tda, 2); addTransparentSprite(25348, 0, "BountyHunter/IMAGE"); addSprite(25353, 1, "BountyHunter/SKULL"); addSprite(25354, 1, "BountyHunter/VALUE"); addSprite(25355, 0, "BountyHunter/TROPHY"); addText(25356, "@or1@k/d", 0xff3333, false, true, -1, tda, 1); addText(25357, "Dangerous", tda, 0, 0xff9040, true, true); addText(25358, "@or1@Snowman5069@whi@ has killed @yel@ Hercul3s007@whi@!", tda, 0, 0xff9040, true, true); addText(25359, "@bla@Snaajkn5069@whi@ has killed @cya@ Haaer0a07@whi@!", tda, 0, 0xff9040, true, true); addText(25360, "@dre@larryfish@whi@ has killed @yel@ likong45@whi@!", tda, 0, 0xff9040, true, true); tab.child(0, 25348, 290, 10); tab.child(1, 25349, 340, 13); tab.child(2, 25350, 452, 13); tab.child(3, 25351, 320, 34); tab.child(4, 25352, 470, 34); tab.child(5, 25353, 476, 254); tab.child(6, 25354, 300, 34); tab.child(7, 25355, 370, 34); tab.child(8, 25356, 388, 34); tab.child(9, 25357, 485, 278); tab.child(10, 25358, 100, 15); tab.child(11, 25359, 100, 25); tab.child(12, 25360, 100, 35); } public static void addTransparentSprite(int id, int spriteId, String spriteName) { RSInterface tab = interfaceCache[id] = new RSInterface(); tab.id = id; tab.parentID = id; tab.type = 5; tab.atActionType = 0; tab.contentType = 0; tab.aByte254 = (byte) 0; tab.hoverType = 52; tab.sprite1 = imageLoader(spriteId, spriteName); tab.sprite2 = imageLoader(spriteId, spriteName); tab.width = 512; tab.height = 334; tab.drawsTransparent = true; }Spoiler for Media:
if you want them to disappear over time like above... add this somewhere..
Code:ActivityFeed.tick();
Actually a cool idea. Will implement my own version of this into the Elvarg project.
That's pretty dope, you could actually make a osrs pvp server based on bh craters system, since your interface kinda looks like the bh crater interface
ex. if you get a target(anywhere in the runescape world) can tele, then youll able to tele back to safe zone,
if you went on a rouge, youll get a 180 sec penalty, avoiding you from able to tele or go to a safe zone
I used the feed idea to make a "Server feed" kind of thingy. It will have kills, announcements and more. Thanks pal.
Nice i like, Thanks.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |