Snippets Latest Topicshttps://runelist.io/forums/forum/49-snippets/Snippets Latest TopicsenCustom - stop preloading custom modelshttps://runelist.io/forums/topic/190-custom-stop-preloading-custom-models/ A lot of customs nowadays have a 'raw' folder in their cache, and a preload method during client startup, caching thousands of models will heavily increase your memory usage.

 

First, remove the method your using to preload your models, this is usually found in Client.java and is usually called void preloadModels()

 

Next, go to Model.java and place the changes or methods yourself - WARNING THAT THIS IS ON A RUSE CLIENT AND VARIABLE NAMES AND/OR METHOD NAMES MAY BE DIFFERENT TO YOURS

 

public static Model fetchModel(int j) 
{
   if (modelHeader == null)
      return null;
   if (j == 0)
      return null;
   ModelHeader class21 = modelHeader[j];
   if (class21 == null) {
      File file = new File(signlink.findcachedir() + "data/raw/" + j + ".dat");
      if(file.exists()) {
         byte[] buffer = ReadFile(signlink.findcachedir() + "data/raw/" + j + ".dat");
         readFirstModelData(buffer, j);
         return new Model(j);
      }
      resourceManager.get(j);
      return null;
   } else {
      return new Model(j);
   }
}
public static boolean modelIsFetched(int i) {
   if (modelHeader == null)
      return false;
   ModelHeader class21 = modelHeader[i];
   if (class21 == null) {
      File file = new File(signlink.findcachedir() + "data/raw/" + i + ".dat");
      if(file.exists()) {
         byte[] buffer = ReadFile(signlink.findcachedir() + "data/raw/" + i + ".dat");
         readFirstModelData(buffer, i);
         return true;
      }
      resourceManager.get(i);
      return false;
   } else {
      return true;
   }
}

 

This will now only load the models as you need them.

]]>
190Sat, 08 May 2021 17:36:09 +0000
.gitignore - how to usehttps://runelist.io/forums/topic/189-gitignore-how-to-use/ I've recently been messaged a lot, as people have added things to their .gitignore file however changes are still picking up, this is because you need to remove files to match from the git cache

 

I will be showing you how to do this using GitHub Desktop

 

First find your repo, click 'Repository' at the top then select the option 'Open in Command Prompt'

 

If you get a notice to install git, do that and restart your pc before carrying on

 

write in the following command, replacing *.bin with your file

 

git rm -r --cached *.bin

 

 

If you see some files pop up, it worked and you'll see them as removed files on to commit. DONT PANIC, THESE FILES WILL STILL REMAIN ON YOUR LOCAL MACHINE

 

If you see the following message:

fatal: pathspec '*.bin' did not match any files

 

You have no pushes containing the file/file type, and the file will be ignored like normal.

 

]]>
189Sat, 08 May 2021 17:31:04 +0000
Ruse - fix right click walk herehttps://runelist.io/forums/topic/188-ruse-fix-right-click-walk-here/ Head too Client.java and search for '== 516'

You should see something like this:

if (l == 516) {
    if (!menuOpen) {
        worldController.request2DTrace(super.saveClickY - 4, super.saveClickX - 4);
    } else {
        worldController.request2DTrace(interfaceId - 4, slot - 4);
    }
}

Head too the worldController method, may be called something else in your client and it'll appear something like this

public void request2DTrace(int x, int y) {
   isClicked = true;
   clickX = y;
   clickY = x;
   clickedTileX = -1;
   clickedTileY = -1;
}

You'll notice a few things like clickX is pointing too the y variable..

 

Change it to match this:

Changes:

clickX = x;

clickY = y;

parameters swapped around..

public void request2DTrace(int y, int x) {
   isClicked = true;
   clickX = x;
   clickY = y;
   clickedTileX = -1;
   clickedTileY = -1;
}

Load up your client and both left click + right click walk here options should be fixed.

 

]]>
188Sat, 08 May 2021 17:24:35 +0000
Implementing RuneLite on your clienthttps://runelist.io/forums/topic/158-implementing-runelite-on-your-client/ Download the packaged zip found at: https://mega.nz/file/jNIFiCLR#OdcnZ-z4QMXOnp1Gjkur4wHgS66z74YENGqRlIBOCzA, import project into intellij(this is a gradle project) place your client package in src/main/ then refactor it into src/main/java(this will sort your imports ect out), once this is done you're ready to follow:

 

First head too ClientLoader.java and find the following code:

	private static Applet loadVanilla() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
		Class<Client> clientClass = Client.class;
		return ClientLoader.loadFromClass(clientClass);
	}

Replace Client.class with your normal clients Client.java

 

Now head too Client.java(your clients version) and implement the file as follows:

public class Client extends GameApplet implements net.runelite.api.Client {

and import all the required methods, once this has loaded place the following anywhere in the file:

@Inject
private Hooks callbacks;

then replace the newly imported method found in the file so it looks like this:

    @Inject
    private Hooks callbacks;

    @Override
    public Callbacks getCallbacks() {
        return callbacks;
    }

 

Now you can post events for runelite to use using 

callbacks.post(event);

 

Now run using RuneLite.java

 

You will need to implement runelite hooks yourself to make use of events, I can do this for you, thread will be updated with link regarding that.

 

Store Link:

 

]]>
158Tue, 13 Apr 2021 14:29:45 +0000
Snippets Section Ruleshttps://runelist.io/forums/topic/19-snippets-section-rules/ 3Qommdf.png
This section is specifically dedicated towards snippets of RS2 Runescape Private Servers to the community of RuneList. Down below you will find rules on what a topic must contain, and what you are not allowed to do as a member of the community. Please read them from top to bottom to avoid potential punishments. 

In order to create a topic in the snippets section, please ensure that your topic does not contain the following;

  • Lots of Code: Do not create snippets that contain medium to massive amounts of code
    • This can be done in the tutorials section
  • Uncredited/Stolen Work: Do not create snippets that contain uncredited or stolen code
  • Implementation: Do not create snippets that have no information about the implementation of said tutorial

In addition, the snippet must include code that you as an author understand and can stand for. Do not submit snippets that can not be used by others. Make sure you follow through with the snippets that are submitted.

If a thread does not fit the section or if it contains any of the aforementioned points, it will be locked and/or moved to the correct section of the community. Community Rules apply to all sections. Please read them here.

]]>
19Sat, 10 Oct 2020 18:27:57 +0000