OUTDATED - [Realm Relay] Event Notifier script

Posts 16–21 of 21 · Page 2 of 2
Quote Originally Posted by Zasx View Post
That was anything but an angry response. A bit harsh maybe, but not angry. Also I see you are smart enough to write "ignorant" instead of "idiot", or "stupid", or "noob", or whatever. Sort of thanks for that.
Because you were being ignorant to my idea, saying you were a noob to my idea wouldn't make sense.
Quote Originally Posted by IziLife View Post
Oooops !! :3

It works fine now, thanks !
Just as an idea:
Would you possibly look at a script to change skins, dyes and pets like on Odom? but maybe via chat, lets say: /pet 1 or /pet 25 etc etc and same for dyes: /dye x and skins: /skin x :I was thinking maybe the names, but felt it might be a bit quicker with just a number. Might as well throw: /glow on and /glow off :in there too lol. As far as writing these scripts goes, I'm a bit behind the 8 ball...
Where should I add this script to make it work on this proxy?
Quote Originally Posted by Cyeclops View Post
Just as an idea:
Would you possibly look at a script to change skins, dyes and pets like on Odom? but maybe via chat, lets say: /pet 1 or /pet 25 etc etc and same for dyes: /dye x and skins: /skin x :I was thinking maybe the names, but felt it might be a bit quicker with just a number. Might as well throw: /glow on and /glow off :in there too lol. As far as writing these scripts goes, I'm a bit behind the 8 ball...
Hmm i don't need this type of mod, but i'll take a look on this when i'll have free time ( i'm a bit busy these days and this should requiere a lot of time, also i'm not sure to have the knowledge for :3 )
Quote Originally Posted by nominder View Post
Where should I add this script to make it work on this proxy?
Download RealmRelay, go under "scripts" folder, create a new file, rename it as **.js (** : eventnotifier for example) and voila
ps: it will not work with the current version of RR, i need to update it, i'll do it in a bit
I dont know why but i can't edit my post ..

Here is the updated and tweaked code :
 
eventNotif.js

Code:
//EventNotif.js

var ID_TEXT = $.findPacketId("TEXT");
var ID_PLAYER_TEXT = $.findPacketId("PLAYERTEXT");
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");
var ID_UPDATE = $.findPacketId("UPDATE");



var playerObjectId = -1 ;

// colors
	var white = 0xFFFFFF;
	var black = 0x000000;
	var lightGrey = 0xC0C0C0;
	var grey = 0x808080;
	var red = 0xFF0000;
	var orange = 0xF0A804;
	var yellow = 0xFFFF00;
	var green = 0x008000;
	var blue = 0x0000FF;
	var purple = 0x800080;


// Messages
	// Crystal
		var Crystal = [
			"Sweet treasure awaits for powerful adventurers!",
			"I think you need more people...",
			"If you are not very strong, this could kill you"
		];
		var CrystalBroke = [
			"You cracked the crystal! Soon we shall emerge! You might want to BACK AWAY..!!"
		];

	// Sphinx
		var Sphinx = [
			"At last, a Grand Sphinx will teach you to respect!",
		    "A Grand Sphinx is more than a match for this rabble.",
		    "My Grand Sphinxes will bewitch you with their beauty!"
		];

		var lastSphinx = [
			"You festering rat-catchers! A Grand Sphinx will make you doubt your purpose!",
			"Gaze upon the beauty of the Grand Sphinx and feel your last hopes drain away."
		];


		var SphinxDead = [
			 "My Grand Sphinx, she was so beautiful. I will kill you myself",
		     "My Grand Sphinx had lived for thousands of years!",
		     "you up-jumped goat herder! You shall pay for defeating my Grand Sphinx!",
		     "you pestiferous lout! I will not forget what you did to my Grand Sphinx!",
		     "you foul ruffian! Do not think I forget your defiling of my Grand Sphinx!"
		];

	// Hermit
		var Hermit = [
			"My Hermit God's thousand tentacles shall drag you to a watery grave!"
		];
		var HermitDead = [
			"My Hermit God was more than you'll ever be",
	        "Without my Hermit God, Dreadstump is free to roam the seas without fear!"
		];

	// Ship
		var Ship = [
			"My Ghost Ship will terrorize you pathetic peasants!",
			"A Ghost Ship has entered the Realm."
		];
		var ShipDead = [
			"defeat my dreaded Ghost Ship?!",
	        "has crossed me for the last time! My Ghost Ship shall be avenged.",
	        "The spirits of the sea will seek revenge on your worthless soul"
		];

	// Skull Shrine

		var Skull = [
			"Your futile efforts are no match for a Skull Shrine!"
		];
		var SkullDead = [
			"defaced a Skull Shrine! Minions, to arms!",
	        "razed one of my Skull Shrines -- I WILL HAVE MY REVENGE!",
	        "you will rue the day you dared to defile my Skull Shrine!",
	        "you contemptible pig! Ruining my Skull Shrine will be the last mistake you ever make!",
	        "{PLAYER}, you insignificant cur! The penalty for destroying a Skull Shrine is death!"
		];

	// Cube

		var Cube = [
			"Your meager abilities cannot possibly challenge a Cube God!",
			"Worthless mortals! A mighty Cube God defends me!"
		];
		var CubeDead = [
			"You have dispatched my Cube God",
			"I have many more Cube Gods",
			"you wretched dog! You killed my Cube God!",
			"you pathetic swine! How dare you assault my Cube God!"
		];

	// Pentaract

		var Pentaract = [
			"Behold my Pentaract, and despair!",
			"Ignorant fools! A Pentaract guards me still!"
		];
		var PentaractDead = [
			"That was but one of many Pentaracts",
			"you destoryed my Pentaract!",
			"by destroying my Pentaract you have sealed your own doom!"
		];

	// Lord
		var Lord = [
	        "Pathetic fools! My Lord of the Lost Lands will crush you all!",
	        "My Lord of the Lost Lands will make short work of you!",
	        "Cower in fear of my Lord of the Lost Lands!"
		];
		var LordDead = [
			"How dare you foul-mouthed hooligans treat my Lord of the Lost Lands with such indignity!",
	        "What trickery is this?! My Lord of the Lost Lands was invincible!"
		];

	// lich
		var finalLich = [
			"My final Lich shall consume your souls!",
		    "My final Lich will protect me forever!"
		];








function onServerPacket(event) {
	
	var packet = event.getPacket();

	switch (packet.id()) {

		case ID_CREATE_SUCCESS: {
			playerObjectId = packet.objectId;
			break;
		}
	
	
		case ID_TEXT: {
			
		

				var text = packet.text;
				var filteredText = packet.text.toLowerCase();

                                // Print the chat in console ( remove the line if unwanted )
				$.echo(packet.name+"+ "+text);




					// Player calling for something
						if (filteredText.indexOf('lab') >= 0) {

							displayRealmRelayNotification(event, playerObjectId, purple, packet.name +": Called for Lab! : "+ text);
						}

						if (filteredText.indexOf('horse') >= 0) {

							displayRealmRelayNotification(event, playerObjectId, grey, packet.name +": Called for Horse! : "+ text);
						}

						if (filteredText.indexOf('crystal') >= 0) {

							displayRealmRelayNotification(event, playerObjectId, blue, packetname +": Called for Crystal! : "+ text);
							
						}

						if (filteredText.indexOf('cland') >= 0) {

							displayRealmRelayNotification(event, playerObjectId, red, packet.name +": Called for Candy Land!"+ text);
						}
						if (filteredText.indexOf('manor') >= 0) {

							displayRealmRelayNotification(event, playerObjectId, red, packet.name +": Called for Manor!"+ text);
						}


						
					// Events
						// Crystal
							if (text == Crystal) {
								
								displayRealmRelayNotification(event, playerObjectId, blue,"Crystal found!");
					
							}
							if (text == CrystalBroke) {
								
								displayRealmRelayNotification(event, playerObjectId, blue,"Crystal Broke!");
					
							}
						
						// Sphinx
							if (text == Sphinx) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Sphinx Somewhere!");
				
							}
							if (text == SphinxDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Sphinx is Dead!");
				
							}

						// Hermit
							if (text == Hermit) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Hermit Somewhere!");
				
							}
							if (text == HermitDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Hermit is Dead!");
				
							}

						// Ship
							if (text == Ship) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Ghost Ship Somewhere!");
				
							}
							if (text == ShipDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Ghost Ship is Dead!");
				
							}

						// Skull Shrine
							if (text == Skull) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Skull Shrine Somewhere!");
				
							}
							if (text == SkullDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Skull Shrine is Dead!");
				
							}

						// Cube
							if (text == Cube) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Cube Somewhere!");
				
							}
							if (text == CubeDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Cube is Dead!");
				
							}

						// Pentaract
							if (text == Pentaract) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Pentaract Somewhere!");
				
							}
							if (text == PentaractDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Pentaract is Dead!");
				
							}

						// Lord
							if (text == Lord) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"Lord of the Lost Lands Somewhere!");
				
							}
							if (text == LordDead) {
							
							displayRealmRelayNotification(event, playerObjectId, purple,"Lord of the Lost Lands is Dead!");
				
							}

						// lich
							if (text == finalLich) {
							
							displayRealmRelayNotification(event, playerObjectId, orange,"FINAL LICH!!");
				
							}

			
		}

	}
}



function displayRealmRelayNotification(event, playerObjectId, color, text) {
	var notificationPacket = event.createPacket(ID_NOTIFICATION);
	notificationPacket.objectId = playerObjectId;
	notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
	notificationPacket.color = color;
	event.sendToClient(notificationPacket);
}
Thank u! ill try out (:
Posts 16–21 of 21 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us