Thread: [Kronos] Adding Your Own Chat Crowns via RuneLite

Results 1 to 10 of 10
  1. #1 [Kronos] Adding Your Own Chat Crowns via RuneLite 
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,647
    Thanks given
    175
    Thanks received
    257
    Rep Power
    358
    If you wish to add your own chat icons via cache instead of RuneLite see my other thread: https://www.rune-server.ee/runescape...ml#post5731294


    Attached image

    These crowns are found in the runelite client files, you can add your own crowns. Located in (runelite-clientsrcmainresourcesimgiconscrowns)

    As you can see they are labeled with numbers.

    Go to net.runelite.standalone > CustomUtils.java

    Code:
                for (int id = 16; id <= 25; id++) { //16-25 ids
                    //int id = Integer.parseInt(file.getName().replace(".png", "").trim());
                    byte[] data = resourceToBytes("img/icons/crowns/" + id + ".png");
                    if (data != null)
                        iconData.add(new IconData(id, data));
                }

    Looking at this code we can see the number 16 to 25

    Code:
     for (int id = 16; id <= 25; id++) { //16-25 ids
    Change it to this so it can read up to 500 more png files: (You must do this to read new png files from the crowns folder)

    Code:
    for (int id = 16; id <= 500; id++) { //16-500 ids
    Whenever you add another crown you must change the "25" number to the latest crown. Say you add 5 more crowns (26.png,27.png.. etc) You set that number to 30 if the last crown is 30.png (OR 31 if you use the 26 number)

    Now in-game if you type <img=26> it will show the 26.png crown.

    If you would like the crown to show up in chat next to your name you must add it to PlayerGroup.java in io.ruin.model.entity.player

    Code:
    public enum PlayerGroup {
        OWNER(100, 2, 2, 100),
        DEVELOPER(3, 6, 16, 100),
        COMMUNITY_MANAGER(8, 7, 17, "Server Manager"),
        ADMINISTRATOR(5, 2, 1, 0),
        MODERATOR(4, 1, 0, 0),
        FORUM_MODERATOR(7, 0, 0, 0),
        SUPPORT(9, 8, 18, 0),
        YOUTUBER(10, 27, 28, 0),
        BETA_TESTER(6, 0, -1, 0),
        ZENYTE(17, 15, 25, 100),
        ONYX(16, 14, 24, 80),
        DRAGONSTONE(15, 13, 23, 60),
        DIAMOND(14, 12, 22, 40),
        RUBY(13, 11, 21, 25),
        EMERALD(12, 10, 20, 15),
        SAPPHIRE(11, 9, 19, 10),
        REGISTERED(2, 0, 0, 0),
        BANNED(18, 0, -1, 0);
    For example, our new crown 26.png:

    Code:
        RANK_26_NAME(1337, 26, 26, 0),
    - 1337 can be any unused id not set by another group.

    - 26 will be the id that the client sets the icon to. (Same as img icon (26 and 26) ONLY if you fix the bugs see at the bottom of this thread, otherwise they will be 2 different ids.

    - 26 is the img icon.

    - 16 is used for chat icons and 26 is used for <img> icons.

    Lastly after completing this other snippet: https://www.rune-server.ee/runescape...nk-groups.html

    Change your rank in your json file to RANK_26_NAME



    Bugs to fix (Dcing when typing something)
    THESE BUG FIXES ALSO FIXES CLIENT RANK IDS AND IMAGE IDS BEING DIFFERENT, now they will be the same.

    DO THE BELOW IF YOU WANT IMAGE ICON IDS TO BE IDENTICAL TO THE FILE NAME AND IDENTICAL TO THE IMG ICON ID (Client image id and image icon id, 2 different ids will now be the same.)

    For example: in the server files (io.ruin.model.entity.player > PlayerGroup.java)

    You see these usergroups:

    Code:
       OWNER(100, 26, 26, 100),
        DEVELOPER(3, 16, 16, 100),
        COMMUNITY_MANAGER(8, 17, 17, "Server Manager"),
    The layout is RANK(id, clientId, clientImageId, title/dropChance)

    So if it's <img=26> (26.png) you want for the chat icon (Private message, clan chat, public chat)

    OWNER(100, 26, 26, 100),

    Normal chat message error:
    Code:
    java.lang.NullPointerException
    	at net.runelite.standalone.WorldMapManager.method630(WorldMapManager.java:688)
    	at net.runelite.standalone.Client.parsePacket(Client.java:7964)
    	at net.runelite.standalone.Client.method1654(Client.java:5680)
    	at net.runelite.standalone.Client.vmethod1937(Client.java:1677)
    	at net.runelite.standalone.GameShell.method976(GameShell.java:320)
    	at net.runelite.standalone.GameShell.run(GameShell.java:785)
    	at java.lang.Thread.run(Thread.java:748)
    Go to net.runelite.standalone > WorldMapManager.java

    Find
    Code:
    if((var6 & 128) != 0) {
    Replace that whole if statement with:

    Code:
     if((var6 & 128) != 0) {
                            var8 = var0.readUnsignedShort();
                            int rank = var0.readUnsignedByte();
                            PlayerType playerType = (PlayerType) NetSocket.getEnumeratedTypeIndex(class210.getPlayerTypes(), rank);
                            boolean var18 = var0.method5525() == 1;
                            var11 = var0.method5525();
                            var12 = var0.offset;
                            if(var16.username != null && var16.appearance != null) {
                               boolean var13 = false;
                               if(playerType != null) {
                                  if (playerType.isUser && Tiles.friendSystem.method897(var16.username)) {
                                     var13 = true;
                                  }
                               }
    
                               if(!var13 && Client.field842 == 0 && !var16.isHidden) {
                                  Players.field1202.offset = 0;
                                  var0.method5547(Players.field1202.array, 0, var11);
                                  Players.field1202.offset = 0;
                                  String var14 = AbstractFont.method5328(NetSocket.method3456(class65.method1308(Players.field1202)));
                                  var16.overheadText = var14.trim();
                                  var16.overheadTextChanged(-1);
                                  var16.overheadTextColor = var8 >> 8;
                                  var16.overheadTextEffect = var8 & 255;
                                  var16.overheadTextCyclesRemaining = 150;
                                  var16.isAutoChatting = var18;
                                  if (playerType != null) {
                                     var16.field682 = var16 != class215.localPlayer && playerType.isUser && "" != Client.field1115 && var14.toLowerCase().indexOf(Client.field1115) == -1;
                                  }
                                  if(playerType != null) {
                                     if (playerType.isPrivileged) {
                                        var15 = var18 ? 91 : 1;
                                     } else {
                                        var15 = var18 ? 90 : 2;
                                     }
                                  } else {
                                     var15 = var18 ? 90 : 2;
                                  }
    
                                  //if(playerType.modIcon != -1) {
                                  if(rank != 0) {
                                     class217.sendGameMessage(var15, class256.method4655(rank) + var16.username.method5001(), var14);
                                  } else {
                                     class217.sendGameMessage(var15, var16.username.method5001(), var14);
                                  }
                               }
                            }
    
                            var0.offset = var11 + var12;
                         }
    Clan chat message error:
    Code:
    java.lang.NullPointerException
    	at net.runelite.standalone.Client.parsePacket(Client.java:6954)
    	at net.runelite.standalone.Client.method1654(Client.java:5680)
    	at net.runelite.standalone.Client.vmethod1937(Client.java:1677)
    	at net.runelite.standalone.GameShell.method976(GameShell.java:320)
    	at net.runelite.standalone.GameShell.run(GameShell.java:785)
    	at java.lang.Thread.run(Thread.java:748)
    Go to net.runelite.standalone > Client.java

    Find
    Code:
    if(ServerPacket.field2280 == var1.serverPacket) {
    Replace that whole if statement with this:


    Code:
                if(ServerPacket.field2280 == var1.serverPacket) {
                   var36 = var3.readString();
                   String clanName = var3.readString();
                   //var21 = var3.method5502();
                   var23 = (long)var3.readUnsignedShort();
                   var9 = (long)var3.method5500();
    
                   int perm = var3.readUnsignedByte();
    
                   System.out.println(perm);
    
                   PlayerType var11 = (PlayerType)NetSocket.getEnumeratedTypeIndex(class210.getPlayerTypes(), perm);
                   var12 = var9 + (var23 << 32);
                   boolean var44 = false;
    
                   for(int var15 = 0; var15 < 100; ++var15) {
                      if(field1097[var15] == var12) {
                         var44 = true;
                         break;
                      }
                   }
                   if(var11 != null) {
                      if (var11.isUser && Tiles.friendSystem.method897(new Username(var36, WorldMapSection1.loginType))) {
                         var44 = true;
                      }
                   }
    
                   if(!var44 && field842 == 0) {
                      field1097[field1064] = var12;
                      field1064 = (field1064 + 1) % 100;
                      String var25 = AbstractFont.method5328(NetSocket.method3456(class65.method1308(var3)));
                      //if(var11.modIcon != -1) {
                      if(perm != -1) {
                         WorldMapData_1.method514(9, class256.method4655(perm) + var36, var25, clanName);
                      } else {
                         WorldMapData_1.method514(9, var36, var25, clanName);
                      }
                   }
    
                   var1.serverPacket = null;
                   var10000 = true;
                   return var10000;
                }
    Private chat error:

    Code:
    java.lang.NullPointerException
    	at net.runelite.standalone.Client.parsePacket(Client.java:7116)
    	at net.runelite.standalone.Client.method1654(Client.java:5680)
    	at net.runelite.standalone.Client.vmethod1937(Client.java:1677)
    	at net.runelite.standalone.GameShell.method976(GameShell.java:320)
    	at net.runelite.standalone.GameShell.run(GameShell.java:785)
    	at java.lang.Thread.run(Thread.java:748)
    Go to net.runelite.standalone > Client.java

    Find

    Code:
    if(ServerPacket.field2270 == var1.serverPacket) {
    Replace whole if statement:

    Code:
     if(ServerPacket.field2270 == var1.serverPacket) {
                   var36 = var3.readString();
                   var21 = (long)var3.readUnsignedShort();
                   var23 = (long)var3.method5500();
                   int rank = var3.readUnsignedByte();
                   PlayerType var26 = (PlayerType)NetSocket.getEnumeratedTypeIndex(class210.getPlayerTypes(), rank);
                   long var27 = (var21 << 32) + var23;
                   boolean var29 = false;
    
                   for(int var13 = 0; var13 < 100; ++var13) {
                      if(field1097[var13] == var27) {
                         var29 = true;
                         break;
                      }
                   }
    
                   if(Tiles.friendSystem.method897(new Username(var36, WorldMapSection1.loginType))) {
                      var29 = true;
                   }
    
                   if(!var29 && field842 == 0) {
                      field1097[field1064] = var27;
                      field1064 = (field1064 + 1) % 100;
                      String var30 = AbstractFont.method5328(NetSocket.method3456(class65.method1308(var3)));
                      byte var14;
                      if(var26 != null) {
                         if (var26.isPrivileged) {
                            var14 = 7;
                         } else {
                            var14 = 3;
                         }
                      } else {
                         var14 = 3;
                      }
    
                    //  if(var26.modIcon != -1) {
                      if(rank != -1) {
                         class217.sendGameMessage(var14, class256.method4655(rank) + var36, var30);
                      } else {
                         class217.sendGameMessage(var14, var36, var30);
                      }
                   }
    
                   var1.serverPacket = null;
                   var10000 = true;
                   return var10000;
                }
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Blurite

    Corey's Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,491
    Thanks given
    1,245
    Thanks received
    1,729
    Rep Power
    5000
    You should note that the custom crowns won't appear for non-runelite clients, e.g. mobile, vanilla client, and they need to be packed into the cache for that to work.

    Keep up the snippets
    Attached image
    Reply With Quote  
     

  4. Thankful users:


  5. #3  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Would recommend just removing the custom icons from runelite and strictly using the cache for icon changes
    Attached image
    Reply With Quote  
     

  6. #4  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,647
    Thanks given
    175
    Thanks received
    257
    Rep Power
    358
    Quote Originally Posted by Corey View Post
    You should note that the custom crowns won't appear for non-runelite clients, e.g. mobile, vanilla client, and they need to be packed into the cache for that to work.

    Keep up the snippets
    Quote Originally Posted by BoomScape View Post
    Would recommend just removing the custom icons from runelite and strictly using the cache for icon changes
    Edit:

    Quote Originally Posted by Armo
    You can't pack sprites into the cache and read crown icons right now, client is currently reading images from the client resources. I might release cache-reading crown icons later on but for now this is the way to do it.
    Reply With Quote  
     

  7. #5  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    21
    Quote Originally Posted by Armo View Post
    Code:
    public enum PlayerGroup {
        OWNER(100, 100, 100, 100),
        DEVELOPER(3, 6, 16, 100),
        COMMUNITY_MANAGER(8, 7, 17, "Server Manager"),
        ADMINISTRATOR(5, 2, 1, 0),
        MODERATOR(4, 1, 0, 0),
        FORUM_MODERATOR(7, 0, 0, 0),
        SUPPORT(9, 8, 18, 0),
        YOUTUBER(10, 27, 28, 0),
        BETA_TESTER(6, 0, -1, 0),
        ZENYTE(17, 15, 25, 100),
        ONYX(16, 14, 24, 80),
        DRAGONSTONE(15, 13, 23, 60),
        DIAMOND(14, 12, 22, 40),
        RUBY(13, 11, 21, 25),
        EMERALD(12, 10, 20, 15),
        SAPPHIRE(11, 9, 19, 10),
        REGISTERED(2, 0, 0, 0),
        BANNED(18, 0, -1, 0);
    Can you tell me please where exactly I add this? Under which method in Player.java
    Reply With Quote  
     

  8. #6  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,647
    Thanks given
    175
    Thanks received
    257
    Rep Power
    358
    Quote Originally Posted by Ilgaz View Post
    Can you tell me please where exactly I add this? Under which method in Player.java
    It's already in the PlayerGroup.java file in io.ruin.model.entity.player > PlayerGroup.java
    Reply With Quote  
     

  9. Thankful user:


  10. #7  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    21
    Everytime I type something it kicks me out.
    My "primaryGroup":"OWNER"





    [ForkJoinPool.commonPool-worker-4] ERROR rollingErrorFileLogger - Failed to post: https://community.kronos.rip/integration/index.php
    java.io.IOException: Server returned HTTP response code: 522 for URL: https://community.kronos.rip/integration/index.php
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1900)
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1498)
    at sun.net.http://www.protocol.https.HttpsURLCo...Impl.java:268)
    at io.ruin.api.utils.PostWorker.post(PostWorker.java: 65)
    at io.ruin.api.utils.PostWorker.postArray(PostWorker. java:82)
    at io.ruin.api.utils.XenPost.post(XenPost.java:15)
    at io.ruin.model.entity.player.PlayerGroup.lambda$syn c$0(PlayerGroup.java:72)
    at java.util.concurrent.CompletableFuture$AsyncRun.ru n(CompletableFuture.java:1640)
    at java.util.concurrent.CompletableFuture$AsyncRun.ex ec(CompletableFuture.java:1632)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinT ask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTas k(ForkJoinPool.java:1067)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJo inPool.java:1703)
    at java.util.concurrent.ForkJoinWorkerThread.run(Fork JoinWorkerThread.java:172)
    [ForkJoinPool.commonPool-worker-13] ERROR rollingErrorFileLogger - Failed to post: https://community.kronos.rip/integration/index.php
    java.io.IOException: Server returned HTTP response code: 522 for URL: https://community.kronos.rip/integration/index.php
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1900)
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1498)
    at sun.net.http://www.protocol.https.HttpsURLCo...Impl.java:268)
    at io.ruin.api.utils.PostWorker.post(PostWorker.java: 65)
    at io.ruin.api.utils.PostWorker.postArray(PostWorker. java:82)
    at io.ruin.api.utils.XenPost.post(XenPost.java:15)
    at io.ruin.model.entity.player.PlayerGroup.lambda$syn c$0(PlayerGroup.java:72)
    at java.util.concurrent.CompletableFuture$AsyncRun.ru n(CompletableFuture.java:1640)
    at java.util.concurrent.CompletableFuture$AsyncRun.ex ec(CompletableFuture.java:1632)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinT ask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTas k(ForkJoinPool.java:1067)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJo inPool.java:1703)
    at java.util.concurrent.ForkJoinWorkerThread.run(Fork JoinWorkerThread.java:172)
    Reply With Quote  
     

  11. #8  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,647
    Thanks given
    175
    Thanks received
    257
    Rep Power
    358
    Quote Originally Posted by Ilgaz View Post
    Everytime I type something it kicks me out.

    [ForkJoinPool.commonPool-worker-4] ERROR rollingErrorFileLogger - Failed to post: https://community.kronos.rip/integration/index.php
    java.io.IOException: Server returned HTTP response code: 522 for URL: https://community.kronos.rip/integration/index.php
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1900)
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1498)
    at sun.net.http://www.protocol.https.HttpsURLCo...Impl.java:268)
    at io.ruin.api.utils.PostWorker.post(PostWorker.java: 65)
    at io.ruin.api.utils.PostWorker.postArray(PostWorker. java:82)
    at io.ruin.api.utils.XenPost.post(XenPost.java:15)
    at io.ruin.model.entity.player.PlayerGroup.lambda$syn c$0(PlayerGroup.java:72)
    at java.util.concurrent.CompletableFuture$AsyncRun.ru n(CompletableFuture.java:1640)
    at java.util.concurrent.CompletableFuture$AsyncRun.ex ec(CompletableFuture.java:1632)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinT ask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTas k(ForkJoinPool.java:1067)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJo inPool.java:1703)
    at java.util.concurrent.ForkJoinWorkerThread.run(Fork JoinWorkerThread.java:172)
    [ForkJoinPool.commonPool-worker-13] ERROR rollingErrorFileLogger - Failed to post: https://community.kronos.rip/integration/index.php
    java.io.IOException: Server returned HTTP response code: 522 for URL: https://community.kronos.rip/integration/index.php
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1900)
    at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1498)
    at sun.net.http://www.protocol.https.HttpsURLCo...Impl.java:268)
    at io.ruin.api.utils.PostWorker.post(PostWorker.java: 65)
    at io.ruin.api.utils.PostWorker.postArray(PostWorker. java:82)
    at io.ruin.api.utils.XenPost.post(XenPost.java:15)
    at io.ruin.model.entity.player.PlayerGroup.lambda$syn c$0(PlayerGroup.java:72)
    at java.util.concurrent.CompletableFuture$AsyncRun.ru n(CompletableFuture.java:1640)
    at java.util.concurrent.CompletableFuture$AsyncRun.ex ec(CompletableFuture.java:1632)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinT ask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTas k(ForkJoinPool.java:1067)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJo inPool.java:1703)
    at java.util.concurrent.ForkJoinWorkerThread.run(Fork JoinWorkerThread.java:172)

    You can ignore that, pretty sure it's because of no forum integration or worldlist
    Reply With Quote  
     

  12. #9  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    21
    Quote Originally Posted by Armo View Post
    You can ignore that, pretty sure it's because you don't have worldlist setup or it could be forum integration
    Ignore what lol? I told you if I type something in the chatbox my account kicking out

    I mean this tut: https://www.rune-server.ee/runescape...-runelite.html

    Mistake with the topic I mean this topic: https://www.rune-server.ee/runescape...-runelite.html
    After I followed everything there I just got kicked out
    Reply With Quote  
     

  13. #10  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,647
    Thanks given
    175
    Thanks received
    257
    Rep Power
    358
    Quote Originally Posted by Ilgaz View Post
    Ignore what lol? I told you if I type something in the chatbox my account kicking out
    Oh change this line:

    Code:
        OWNER(100, 100, 100, 100),
    To:

    Code:
        OWNER(100, 2, 2, 100),
    Quote Originally Posted by Ilgaz View Post
    Ignore what lol? I told you if I type something in the chatbox my account kicking out

    I mean this tut: https://www.rune-server.ee/runescape...-runelite.html

    Mistake with the topic I mean this topic: https://www.rune-server.ee/runescape...-runelite.html
    After I followed everything there I just got kicked out
    Also change
    Code:
        REGISTERED(2, 0, -1, 0),
    to

    Code:
        REGISTERED(2, 0, 0, 0),
    Reply With Quote  
     

  14. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] adding your own stalls.
    By hontiris1 in forum Tutorials
    Replies: 25
    Last Post: 08-20-2013, 06:16 PM
  2. {-----_Make your own mage spell_-----}
    By Reforced in forum Tutorials
    Replies: 8
    Last Post: 06-20-2007, 03:22 PM
  3. How to Create Your Own Private Server!
    By guthan138 in forum Tutorials
    Replies: 4
    Last Post: 06-14-2007, 01:04 AM
  4. [§] • How to make your own spells on NPC`s • [§]
    By ParasyncheD in forum Tutorials
    Replies: 5
    Last Post: 06-10-2007, 09:12 PM
  5. How to make your own p server (other way)
    By Alex in forum Tutorials
    Replies: 13
    Last Post: 06-10-2007, 10:28 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •