GMBazUK
May 28th, 2012, 17:02
With reference to Trenloe's earlier post in the RMC forum:
I've also found it quite handy to add a startup message to the chat window (so you know which extensions are loaded - and which versions) when you start. Good for us checking what version we're running and also good for other's reporting issues!
It's pretty simple code, create a new .lua file (I usually call it "manager_extension.lua"), put the following onInit function in the file and call this file in the scripts section of your extension.
function onInit()
--Send extension startup text
RMCConstants.CopyrightText[#RMCConstants.CopyrightText+1]="*** Put your startup text here! ***";
end
Using #RMCConstants.CopyrightText+1 will add this to any existing copyright text and so allow multiple extensions to all add their own startup text to the chat window.
I've successfully completed an extension to modify the look of my CoC ruleset and, in a similar vein to the RMC ruleset extension I've begun, I wanted to display the version of my CoCskin in the chat box on start up. Unfortunately... I'm stumped.
I think it has something to do with the "addmessage instruction" as used in the chatmanger lua, but whilst I can call my cocskin.lua in the cocskin extension.xml, I cannot figure out what to put after function oninit(). Clever people... help!
Thanks in advance,
Baz
I've also found it quite handy to add a startup message to the chat window (so you know which extensions are loaded - and which versions) when you start. Good for us checking what version we're running and also good for other's reporting issues!
It's pretty simple code, create a new .lua file (I usually call it "manager_extension.lua"), put the following onInit function in the file and call this file in the scripts section of your extension.
function onInit()
--Send extension startup text
RMCConstants.CopyrightText[#RMCConstants.CopyrightText+1]="*** Put your startup text here! ***";
end
Using #RMCConstants.CopyrightText+1 will add this to any existing copyright text and so allow multiple extensions to all add their own startup text to the chat window.
I've successfully completed an extension to modify the look of my CoC ruleset and, in a similar vein to the RMC ruleset extension I've begun, I wanted to display the version of my CoCskin in the chat box on start up. Unfortunately... I'm stumped.
I think it has something to do with the "addmessage instruction" as used in the chatmanger lua, but whilst I can call my cocskin.lua in the cocskin extension.xml, I cannot figure out what to put after function oninit(). Clever people... help!
Thanks in advance,
Baz