Governor

Custom Chat Channel Creation

Recommended Posts

YOu Edit it with notepad, and put it in scriptrunnt -> scripts->playersLogin 

Edited by Elsa

Share this post


Link to post
Share on other sites

Is there a way to use that PM script that @Elsa shared, but for a second tab?  I tried copying the original and editing it, but it still chose only one of the files.

Share this post


Link to post
Share on other sites
9 hours ago, Batta said:

Is there a way to use that PM script that @Elsa shared, but for a second tab?  I tried copying the original and editing it, but it still chose only one of the files.

Just copy the file and rename it. And rename  the tab name inside the file. 

Edited by Elsa

Share this post


Link to post
Share on other sites
4 hours ago, Elsa said:

Just copy the file and rename it. And rename  the tab name inside the file. 

When I do this, it just cancels the first one, and I still have only one new tab.

Oh wait, rename the file itself?  What would you call it, if not greet.js?

Edited by Batta

Share this post


Link to post
Share on other sites
1 hour ago, Batta said:

Oh wait, rename the file itself?  What would you call it, if not greet.js?

You can call it whatever you want as long as you keep the file extension .js

  • Like 1

Share this post


Link to post
Share on other sites
On 9/2/2018 at 6:43 PM, Batta said:

Oh wait, rename the file itself?  What would you call it, if not greet.js?

Depends on what you want the tab to be. The name of file doesn't matter, 

Quote

var titleWindow = "Donators";

this will change the name of the tab ingame. 

Edited by Elsa
  • Like 1

Share this post


Link to post
Share on other sites
On 9/4/2018 at 2:30 PM, Elsa said:

Depends on what you want the tab to be. The name of file doesn't matter, 

this will change the name of the tab ingame. 

Hello. I tried this and only the first showed up. I copied the file inside of the same folder and changed the contents, renamed it to rules.js. Am I missing something somewhere? Maybe need to edit another file to get it to pick up the second file??

Share this post


Link to post
Share on other sites
15 minutes ago, Etheria said:

Hello. I tried this and only the first showed up. I copied the file inside of the same folder and changed the contents, renamed it to rules.js. Am I missing something somewhere? Maybe need to edit another file to get it to pick up the second file??

Did you change the var titleWindow = " " ?

Share this post


Link to post
Share on other sites
4 hours ago, Elsa said:

Did you change the var titleWindow = " " ?

Yes- one is "Server Info" the other is "Rules". 

Share this post


Link to post
Share on other sites
24 minutes ago, Etheria said:

Yes- one is "Server Info" the other is "Rules". 

 

I'm having the same problem.  If I add a second one, only the second one shows up.

Share this post


Link to post
Share on other sites

Did you try to restart the server?

Should help to restart it, so the scripts gets loaded.

Share this post


Link to post
Share on other sites
10 hours ago, Elsa said:

Did you try to restart the server?

Should help to restart it, so the scripts gets loaded.

Restarted twice- same results. I think we're missing something. 

Share this post


Link to post
Share on other sites
8 hours ago, Etheria said:

Restarted twice- same results. I think we're missing something. 

Make sure you haven't missed a any symbole or somthing. If you miss and '"' or somthing the scripts wont run.

Share this post


Link to post
Share on other sites

Notepad++ shows no errors. Normally there would be a visual anomaly in the pattern of colours if something wasn't "closed". I've checked both files. Both check out.

Edited by Etheria
spelling

Share this post


Link to post
Share on other sites

Question, can this scriptrunner also pop open the alliance and village tabs on longin? If yes, could someone help me figure out exactly how to do this ? I know how to do it client side, but now server side.

Share this post


Link to post
Share on other sites
Posted (edited)
On 1/24/2018 at 1:18 AM, bdew said:

I don't have a readymade mod for this, but if anyone wants to write one...

 

In your mod class you'll need to implement PlayerLoginListener and from there send your stuff to the player like this:


player.getCommunicator().sendMessage(new Message(player, (byte) 0, "ChannelName", "text goes here", r, g, b));

 

Also for good measure, implement PlayerMessageListener and do something like this to prevent sending messages to this channel:

 


    @Override
    public MessagePolicy onPlayerMessage(Communicator communicator, String message, String title) {
        if (title.equals("ChannelName") && !message.startsWith("#") && !message.startsWith("/")) {
            return MessagePolicy.DISCARD;
        } else {
            return MessagePolicy.PASS;
        }
    }

 

Could someone please make or share the mod for this, I have no idea how to make mods yet.

Edited by Darkness1990

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.