Solved AutoCompressor Skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Vini

Member
Apr 8, 2023
42
2
8
25
Hello! I have an autocompressor skript, which is kinda poorly coded, it's not very efficient, can someone help me fix the code?

Code:
function compress(player:player):
    while {_player} has 64 oak log named "<##8A3E0C>Oak":
        remove 64 of oak logs named "<##8A3E0C>Oak" from {_player}
        give {_player} shiny oak log named "&aCompressed &8» &fOak" with lore "&7Information:" and "&fSource: &aOak Mines" and "&fWorld: &aOverworld" and "" and "&7Rarity &x&7&E&7&E&7&E&lC&x&9&8&9&8&9&8&lO&x&B&2&B&2&B&2&lM&x&C&B&C&B&C&B&lM&x&E&5&E&5&E&5&lO&x&F&F&F&F&F&F&lN"
    while {_player} has 64 stone named "&7Stone":
        remove 64 of stone named "&7Stone" from {_player}
        give {_player} shiny stone named "&aCompressed &8» &fStone" with lore "&7Information:" and "&fSource: &aStone Mines" and "&fWorld: &aOverworld" and "" and "&7Rarity &x&7&E&7&E&7&E&lC&x&9&8&9&8&9&8&lO&x&B&2&B&2&B&2&lM&x&C&B&C&B&C&B&lM&x&E&5&E&5&E&5&lO&x&F&F&F&F&F&F&lN"
 
Hello! I have an autocompressor skript, which is kinda poorly coded, it's not very efficient, can someone help me fix the code?

Code:
function compress(player:player):
    while {_player} has 64 oak log named "<##8A3E0C>Oak":
        remove 64 of oak logs named "<##8A3E0C>Oak" from {_player}
        give {_player} shiny oak log named "&aCompressed &8» &fOak" with lore "&7Information:" and "&fSource: &aOak Mines" and "&fWorld: &aOverworld" and "" and "&7Rarity &x&7&E&7&E&7&E&lC&x&9&8&9&8&9&8&lO&x&B&2&B&2&B&2&lM&x&C&B&C&B&C&B&lM&x&E&5&E&5&E&5&lO&x&F&F&F&F&F&F&lN"
    while {_player} has 64 stone named "&7Stone":
        remove 64 of stone named "&7Stone" from {_player}
        give {_player} shiny stone named "&aCompressed &8» &fStone" with lore "&7Information:" and "&fSource: &aStone Mines" and "&fWorld: &aOverworld" and "" and "&7Rarity &x&7&E&7&E&7&E&lC&x&9&8&9&8&9&8&lO&x&B&2&B&2&B&2&lM&x&C&B&C&B&C&B&lM&x&E&5&E&5&E&5&lO&x&F&F&F&F&F&F&lN"

Oof. Don't even get me started with auto-compressors. Hate them with a passion.

Here, I'll see what I can do. Give me a moment.
 
Your color codes are giving me an aneurysm...

I've also noticed that in your code, you didn't call the function you made (unless you have more code that I haven't seen).

Also, I don't know what you mean by 'shiny'. You keep calling that in your code. What plugins do you have? That could be a problem.



Here, I have an idea.

What if... we make a gui, and have the player do most of the work! (moving the items into the gui and such.)
 
Your color codes are giving me an aneurysm...

I've also noticed that in your code, you didn't call the function you made (unless you have more code that I haven't seen).

Also, I don't know what you mean by 'shiny'. You keep calling that in your code. What plugins do you have? That could be a problem.



Here, I have an idea.

What if... we make a gui, and have the player do most of the work! (moving the items into the gui and such.)
Adding on to doodle's suggestion, it could be cool to create a block compress fuser in a sense. I've done something like that in a script and it's relatively easy to set up (Have a GUI check if a slot is x64 of block with name and etc then run that data through a function to grant the player the compressed item when a fuse option is clicked)
 
  • Like
Reactions: Doodle
Adding on to doodle's suggestion, it could be cool to create a block compress fuser in a sense. I've done something like that in a script and it's relatively easy to set up (Have a GUI check if a slot is x64 of block with name and etc then run that data through a function to grant the player the compressed item when a fuse option is clicked)
What I did when making an auto-compressor (that I never finished because the way I coded it sucked) was I used a gui to allow the player to toggle which compressor they wanted on. I still struggled with actually getting the compressing part to work, but everything else worked (the gui, the toggling mechanism, etc.), just not the actual compressing part. I know how much of a pain it is to get that working, let alone an actually good version of it, but just play around with it to see what works. That is the best advice I can give you unfortunately.
 
  • Like
Reactions: Luke_Sky_Walker