LightbulbFame- Realm Relay Script

Posts 1–11 of 11 · Page 1 of 1
Fame- Realm Relay Script
When Oryx Domination was around, it had a feature that showed when you got fame. I was wondering if that's possible to make again. If it is possible to make then It would be great if someone would post it.
I was thinking of that earlier today.

Ask @Nisuxen, I'm pretty sure he will do it faster than me
Quote Originally Posted by Alde. View Post
I was thinking of that earlier today.

Ask @Nisuxen, I'm pretty sure he will do it faster than me
ok I will thanks for da info
shameless abuse of Nisuxen's autoloot code and the RealmRelayEnabled message
+ thanks to DatCoder for listing the StatData IDs in the stickied thread

i take no responsibility if you die using this script, lol

feel free to improve it, i have no real idea of coding at all, i just tried and it worked.

 
fame.js
Code:
// fame.js

var ID_NEW_TICK = $.findPacketId("NEW_TICK");
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");

var player_id = -1;
var currentFame = 0;

function onServerPacket(event) {
	var packet = event.getPacket();
	switch (packet.id()) {
		case ID_CREATE_SUCCESS: {
			player_id = packet.objectId;
			break;
		}

		case ID_NEW_TICK: {
			for (var i = 0; i < packet.statuses.length; i++) {
				var status = packet.statuses[i];


				if(status.objectId == player_id){
					for (var j = 0; j < status.data.length; j++){
						var statData = status.data[j];

						if(statData.obf0 == 57){
							if(currentFame != status.data[j].obf1){
								currentFame = status.data[j].obf1;
								$.scheduleEvent(0.1, "displayFame", player_id);			
							}
						}
					}
				}
			}
			break;
		}
	}
}


function displayFame(event, playerObjectId) {
	var notificationPacket = $.createPacket(ID_NOTIFICATION);
	notificationPacket.objectId = playerObjectId;
	notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\""+ currentFame +"\"}}";
	notificationPacket.color = 0xFFFFFF;
	$.sendToClient(notificationPacket);
}
Quote Originally Posted by infern000 View Post
i take no responsibility if you die using this script, lol
is u serius
Quote Originally Posted by infern000 View Post
shameless abuse of Nisuxen's autoloot code and the RealmRelayEnabled message
+ thanks to DatCoder for listing the StatData IDs in the stickied thread

i take no responsibility if you die using this script, lol

feel free to improve it, i have no real idea of coding at all, i just tried and it worked.

 
fame.js
Code:
// fame.js

var ID_NEW_TICK = $.findPacketId("NEW_TICK");
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");

var player_id = -1;
var currentFame = 0

function onServerPacket(event) {
	var packet = event.getPacket();
	switch (packet.id()) {
		case ID_CREATE_SUCCESS: {
			player_id = packet.objectId;
			break;
		}

		case ID_NEW_TICK: {
			for (var i = 0; i < packet.statuses.length; i++) {
				var status = packet.statuses[i];


				if(status.objectId == player_id){
					for (var j = 0; j < status.data.length; j++){
						var statData = status.data[j];

						if(statData.obf0 == 57){
							if(currentFame != status.data[j].obf1){
								currentFame = status.data[j].obf1;
								$.scheduleEvent(0.1, "displayFame", player_id);			
							}
						}
					}
				}
			}
			break;
		}
	}
}


function displayFame(event, playerObjectId) {
	var notificationPacket = $.createPacket(ID_NOTIFICATION);
	notificationPacket.objectId = playerObjectId;
	notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\""+ currentFame +"\"}}";
	notificationPacket.color = 0xFFFFFF;
	$.sendToClient(notificationPacket);
}

Weird question ; why do you use "$.scheduleEvent(0.1, "displayFame", player_id);" instead of "displayFame(player_id); "
Quote Originally Posted by Alde. View Post



Weird question ; why do you use "$.scheduleEvent(0.1, "displayFame", player_id);" instead of "displayFame(player_id); "
read the last line i wrote in the post :/
Quote Originally Posted by infern000 View Post
shameless abuse of Nisuxen's autoloot code and the RealmRelayEnabled message
+ thanks to DatCoder for listing the StatData IDs in the stickied thread

i take no responsibility if you die using this script, lol

feel free to improve it, i have no real idea of coding at all, i just tried and it worked.

 
fame.js
Code:
// fame.js

var ID_NEW_TICK = $.findPacketId("NEW_TICK");
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");

var player_id = -1;
var currentFame = 0;

function onServerPacket(event) {
	var packet = event.getPacket();
	switch (packet.id()) {
		case ID_CREATE_SUCCESS: {
			player_id = packet.objectId;
			break;
		}

		case ID_NEW_TICK: {
			for (var i = 0; i < packet.statuses.length; i++) {
				var status = packet.statuses[i];


				if(status.objectId == player_id){
					for (var j = 0; j < status.data.length; j++){
						var statData = status.data[j];

						if(statData.obf0 == 57){
							if(currentFame != status.data[j].obf1){
								currentFame = status.data[j].obf1;
								$.scheduleEvent(0.1, "displayFame", player_id);			
							}
						}
					}
				}
			}
			break;
		}
	}
}


function displayFame(event, playerObjectId) {
	var notificationPacket = $.createPacket(ID_NOTIFICATION);
	notificationPacket.objectId = playerObjectId;
	notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\""+ currentFame +"\"}}";
	notificationPacket.color = 0xFFFFFF;
	$.sendToClient(notificationPacket);
}
This script works but isn't what people are looking for. We want it to say "+1 Fame" or just "+1" Everytime we get fame instead of just telling us how much fame we have now. Also some color would be great!
Why did you say that this worked for you?

Because I copied what you have posted and it doesnt tell me when I got +1 fame
I have the same question. Oryx domination was the only client i used, because it was very good.
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?