Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

[HELP] How to speed up loading modules into GUI ?

charon

New member
Joined
Jun 22, 2022
Messages
49
Reaction score
3
Points
0
Hi so my problem si basically that I have all modules stored in CopyOnWriteArrayList and each time player opens gui on RSHIFT it has to go through each category of modules and then for each module in category and it does take some seconds for it to load so does anyone have some better way of storing modules rather than this ?
 
maybe initialize all modules on game startup?
 
you mean that i should put them in that arraylist when my client is being initialized ?

you could initialize them in your Main Class. Your Main Class is getting registered anyways on every Startup
 
you could initialize them in your Main Class. Your Main Class is getting registered anyways on every Startup
Yes in my main class i have init method where i put each module to that array list and it still is not working properly the thing is if i use CopyOnWriteArrayList then on each opening of clickgui it takes some time to open click gui and even freezes and crashes game
 
Now i have even change how my modules are working and everything and i get ConcurrentModificationException just from playing lmao
 
Now i have even change how my modules are working and everything and i get ConcurrentModificationException just from playing lmao
1. You don't get the exception just by playing. (It's probably because you copied some code that you don't even understand.)
2. No one can help you without seeing your spaghetti code.
3. Learn Java before you even think about making a modification.
 
1. You don't get the exception just by playing. (It's probably because you copied some code that you don't even understand.)
2. No one can help you without seeing your spaghetti code.
3. Learn Java before you even think about making a modification.
I didnt mean that I get exception just from playing but for example i would turn on module and change some settings turn off gui play for a bit and it would get me to exception... Sure i will how you my code but which part of it do you want... I do know java quite good to make modification.
 
I didnt mean that I get exception just from playing but for example i would turn on module and change some settings turn off gui play for a bit and it would get me to exception... Sure i will how you my code but which part of it do you want... I do know java quite good to make modification.
if you cant even do OOP i am pretty sure you cant write java
 
Hi so my problem si basically that I have all modules stored in CopyOnWriteArrayList and each time player opens gui on RSHIFT it has to go through each category of modules and then for each module in category and it does take some seconds for it to load so does anyone have some better way of storing modules rather than this ?
Try making a cache of all of the modules stored in a new Array List that is only filled the first time you open your ClickGUI
 
How to write bad code:
Personally whenever I render my arraylist I first create a new compyonwritearraylist (nef code is amazing bro his tutorial is p) then I look through every module in my main copyonwritearraylist in my cheat class to add it to my cache copyonwritearraylist. Then I sort them using code I pasted from nef (it's tutorial so it doesn't count as a paste). And finally I create a new third final arraylist (final keyword means java will just use that variable instead of doing the above steps next method call right?), and I populate this final arraylist by looping through every module in my sorted copyonwritearraylist. Then to render I call toarray(new Module[3621]) and loop over this array (arrays have 50x less read time than arraylists right?)
 
Last edited:
Personally whenever I render my arraylist I first create a new compyonwritearraylist (nef code is amazing bro his tutorial is p) then I look through every module in my main copyonwritearraylist in my cheat class to add it to my cache copyonwritearraylist. Then I sort them using code I pasted from nef (it's tutorial so it doesn't count as a paste). And finally I create a new third final arraylist (final keyword means java will just use that variable instead of doing the above steps next method call right?), and I populate this final arraylist by looping through every module in my sorted copyonwritearraylist. Then to render I call toarray(new Module[3621]) and loop over this array (arrays have 50x less read time than arraylists right?)
Got 3k fps now, thx
 
Personally whenever I render my arraylist I first create a new compyonwritearraylist (nef code is amazing bro his tutorial is p) then I look through every module in my main copyonwritearraylist in my cheat class to add it to my cache copyonwritearraylist. Then I sort them using code I pasted from nef (it's tutorial so it doesn't count as a paste). And finally I create a new third final arraylist (final keyword means java will just use that variable instead of doing the above steps next method call right?), and I populate this final arraylist by looping through every module in my sorted copyonwritearraylist. Then to render I call toarray(new Module[3621]) and loop over this array (arrays have 50x less read time than arraylists right?)
ong works thanks! my client now running at 1k fps
 
To come back to your original question @charon ...
What you probably must do is create an instance that you e.g. save in the ClickGui class. That way you dont have to initialize a new Gui that will load all modules etc. but rather have it loaded once.
You can create this instance by moving your code that should look sth. like this:
mc.displayScreen(new YourClickGuiClass())
to the init method of e.g. your ClickGui Module. Afterwards you open the instance (that you saved in a variable e.g. guiInstance) by:
mc.displayScreen(guiInstance)

Your final code in the ClickGui class should look sth. like this:

private YourClickGuiClass guiInstance;

initModule() {
guiInstance = new YourClickGuiClass();
}

openClickGui() {
mc.displayScreen(guiIntance)
}

This hopefully prevents the lag that you experience by initializing your gui over and over again.
I am pretty sure that most of the people who answered in this thread know this as well and maybe decide to help in the future...
Hopefully this helps you (contact/tag me for further questions) and with kind regards,
Phantom
 
To come back to your original question @charon ...
What you probably must do is create an instance that you e.g. save in the ClickGui class. That way you dont have to initialize a new Gui that will load all modules etc. but rather have it loaded once.
You can create this instance by moving your code that should look sth. like this:
mc.displayScreen(new YourClickGuiClass())
to the init method of e.g. your ClickGui Module. Afterwards you open the instance (that you saved in a variable e.g. guiInstance) by:
mc.displayScreen(guiInstance)

Your final code in the ClickGui class should look sth. like this:



This hopefully prevents the lag that you experience by initializing your gui over and over again.
I am pretty sure that most of the people who answered in this thread know this as well and maybe decide to help in the future...
Hopefully this helps you (contact/tag me for further questions) and with kind regards,
Phantom
o_O
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top