Jump to content

Ofus-Will

Member
  • Posts

    25
  • Joined

  • Last visited

Posts posted by Ofus-Will

  1. A skript addon that allows for packet manipulation, can allow users to do things that usually aren't possible without outdated depricated addons.

    List of all packets made available:

    > findpacket *
    [00:29:51 INFO]: [All packet types]
    [00:29:51 INFO]: login_server_success
    [00:29:51 INFO]: login_client_custom_payload
    [00:29:51 INFO]: login_server_set_compression
    [00:29:51 INFO]: login_client_encryption_begin
    [00:29:51 INFO]: login_client_start
    [00:29:51 INFO]: login_server_custom_payload
    [00:29:51 INFO]: play_client_enchant_item
    [00:29:51 INFO]: status_client_start
    [00:29:51 INFO]: status_client_ping
    [00:29:51 INFO]: play_client_window_click
    [00:29:51 INFO]: play_client_close_window
    [00:29:51 INFO]: play_client_custom_payload
    [00:29:51 INFO]: play_client_client_command
    [00:29:51 INFO]: play_client_settings
    [00:29:51 INFO]: play_client_tab_complete
    [00:29:51 INFO]: play_client_transaction
    [00:29:51 INFO]: play_client_teleport_accept
    [00:29:51 INFO]: play_client_tile_nbt_query
    [00:29:51 INFO]: play_client_difficulty_change
    [00:29:51 INFO]: play_client_chat
    [00:29:51 INFO]: status_server_pong
    [00:29:51 INFO]: status_server_server_info
    [00:29:51 INFO]: play_server_entity_destroy
    [00:29:51 INFO]: play_server_recipes
    [00:29:51 INFO]: play_server_resource_pack_send
    [00:29:51 INFO]: play_server_remove_entity_effect
    [00:29:51 INFO]: play_server_player_info
    [00:29:51 INFO]: play_server_combat_event
    [00:29:51 INFO]: play_server_position
    [00:29:51 INFO]: play_server_look_at
    [00:29:51 INFO]: play_server_open_sign_editor
    [00:29:51 INFO]: play_server_open_window
    [00:29:51 INFO]: play_server_abilities
    [00:29:51 INFO]: play_server_auto_recipe
    [00:29:51 INFO]: play_client_use_item
    [00:29:51 INFO]: play_server_entity
    [00:29:51 INFO]: play_client_block_place
    [00:29:51 INFO]: play_server_entity_look
    [00:29:51 INFO]: play_server_open_book
    [00:29:51 INFO]: play_server_vehicle_move
    [00:29:51 INFO]: play_server_open_window_merchant
    [00:29:51 INFO]: play_server_map
    [00:29:51 INFO]: play_server_rel_entity_move_look
    [00:29:51 INFO]: play_server_rel_entity_move
    [00:29:51 INFO]: play_server_world_particles
    [00:29:51 INFO]: play_server_world_event
    [00:29:51 INFO]: play_server_login
    [00:29:51 INFO]: play_server_light_update
    [00:29:51 INFO]: play_server_open_window_horse
    [00:29:51 INFO]: play_server_game_state_change
    [00:29:51 INFO]: play_server_map_chunk
    [00:29:51 INFO]: play_server_keep_alive
    [00:29:51 INFO]: play_server_entity_status
    [00:29:51 INFO]: play_server_kick_disconnect
    [00:29:51 INFO]: play_server_unload_chunk
    [00:29:51 INFO]: play_server_explosion
    [00:29:51 INFO]: play_client_auto_recipe
    [00:29:51 INFO]: play_server_set_cooldown
    [00:29:51 INFO]: play_server_set_slot
    [00:29:51 INFO]: play_client_abilities
    [00:29:51 INFO]: play_client_block_dig
    [00:29:51 INFO]: play_server_custom_sound_effect
    [00:29:51 INFO]: play_client_entity_action

     

  2. On 4/9/2020 at 2:17 PM, xlr100 said:

    Cool tutorial, good job!

    Should probably go into more details about group specific scoreboards (Like mini-games)

    this tutorial was more focused on the conceptual idea of scoreboards, i feel like situation-specific scoreboards aren't actually related to scoreboards, but rather custom mechanisms that can be displayed on the scoreboard. 

    • Like 1
  3. On 4/6/2020 at 8:02 PM, Ezekia said:

    Nice - kinda related to scoreboards but could you tell me what the thing is for displaying pex ranks on a scoreboard? Obviously %rank% doesn't work.

    it's just %player's rank%, alternatively you can use %player's prefix%. Both require a valid group plugin to work

    • Like 1
  4. BEFORE READING:
    1) If you have skrayfall installed, you must disable the enableFastScoreBoards option in skrayfall's config.yml

    2) A scoreboard line can not be set to nothing, if you want an empty line, you must set it to a color code (e.g. "&0")

    3) Two different scoreboards line can not have the same text, a work around is yet again by using color codes as seen above (e.g. "&eText" and "&1&eText" to display 2 lines the same)

    4) There are 3 addons labelled skbee on minehut's download page, make sure you download the one that's description is "A simple solution to make your servers more bold!"


    INTRO

    Following the introduction of the new add-on skbee, i thought it'd be wise to create a scoreboard tutorial using the add-on. The only semi-viable options for minehut users prior to this add-ons introduction were skellet and skrayfall, which both had their issues. Noticeably, skellet had large parsing times and unnecessarily complex syntaxes and skrayfall scoreboards flickered.

    important: if you are attempting to support 1.8 clients on your minehut server using protocolsupport for example, your skbee scoreboard lines will cut off at after 16 characters  for those 1.8 users

    READING SYNTAX PATTERNS (syntaxes are ways you can write code)

    for this tutorial, i will be providing the syntax patterns and example code. In the chance that you do not want to use this template, this is how you interpret skript's syntax patterns. If you do not understand, this do not worry. This is for more advanced users.

    • %% = an object/objects (e.g. player(s) or string(s))
    • [] = optional, meaning it is not mandatory
    • (option 1|option 2) = interchangeable, but only one can be used

    For example, all these patterns are correct for the syntax [score]board of %player% is (on|off):

    • scoreboard of player is on
    • scoreboard of player is off
    • board of player is on
    • board of player is off

    there are 6 simple, sufficient syntaxes provided by skbee which include:

    Screenshot (95).png

     

    SETTING UP YOUR SCOREBOARD
     

    When making player specific scoreboards, we only want their scoreboard to exist when they're online (duh). Therefore, we need to listen to two player specific events: on join and on disconnect.

    Luckily for us, if we use one of skbee's syntaxes (set line or set title), skbee will automatically handle setting up a player's scoreboard for us, so we don't need a syntax like create scoreboard. Useful, right? What this means, is that all we need to do is set the title and lines of our scoreboard and we're all done!

    on join:
    	set title of player's scoreboard to "my server!"
    	set line 3 of player's scoreboard to "top line"
    	set line 2 of player's scoreboard to "middle line"
    	set line 1 of player's scoreboard to "bottom line"

    2020-04-01_20.37.20.png

     Note: minecraft scoreboards always displays the lines highest to lowest from top to bottom (3, 2, 1 instead of 1, 2, 3)

    Cool! we've got a scoreboard. Simple. However, odds are you're going to want to have variables on your scoreboard, right?

    For this example, I will be displaying online players on the scoreboard

    There are two ways of updating your scoreboard. For this tutorial we're going to be using a while loop as it is easier to use. For more advanced users, see the advanced scoreboards header for more efficient methods

    a while loop basically means, for as long as a certain statement (condition) is true, repeat something. Here's an example of it put in to use (along with the use of some colour codes)

    on join:
    	set title of player's scoreboard to "&6&lServer Info"
    	while player is online:
    		set line 1 of player's scoreboard to "&7• &eOnline: &f%size of all players%"
    		wait 1 second

    2020-04-01_22_15_59.thumb.png.5d538922b1e53d97bfd99ee15bcc8f8d.png

    Great! Now we've got a scoreboard that will accurately display the amount of online players. It's important to remember that this works for more than just online players, and you can make it display any skript variable you'd like by including %{variable}%

    When the player leaves the server we want to clear their scoreboard because we don't want to store unnecessary data for players if they're not online. We can do this easily by including:

    on disconnect:
    	clear player's scoreboard

    And that's all there is to it! I hope you've found this tutorial useful, if you have any requests for tutorials on anything else please let me know.

    Skbee download link: https://www.spigotmc.org/resources/skbee-skript-addon.75839/

     

    ADVANCED SCOREBOARDS

    note: I will not being going in to as much detail here, if you don't understand the content below i suggest you stick with the first method

    as i'm sure some of you are all aware, having a while loop that loops every 1 second for all players isn't the best way of updating a scoreboard in some cases

    A better more complicated method for scoreboards that display data that's manipulation is easily detectable is by passing the setting of lines to an updateBoard() function. For this example i will be using player kills and deaths

    function updateBoard(p: player):
    	set {_uuid} to {_p}'s uuid
    	set line 2 of {_p}'s scoreboard to "&6Kills: &f%{kills::%{_uuid}%} ? 0%"
    	set line 1 of {_p}'s scoreboard to "&6Deaths: &f%{deaths::%{_uuid}%} ? 0%"
        
    on join:
    	set title of player's scoreboard to "&e&lStats"
    	updateBoard(player)
        
    on death of player:
    	add 1 to {deaths::%victim's uuid%}
    	if attacker is a player:
    		add 1 to {kills::%attacker's uuid%}
    	updateBoard(victim)
    	updateBoard(attacker)
    
    on disconnect:
    	clear scoreboard of player

    Notice how on join we don't require a loop, merely the initial set up of the lines. Instead, we listen in on the on death event, allowing us to only update the scoreboard of the victim and attacker when the information displayed on their boards change.

    If your scoreboard is not player-specific, but still contains variables that frequently change, it might be better for you to structure your updateBoard() function like so:

    function updateBoard(p: players):
    	loop {_p::*}:
    		set line 1 of loop-value's scoreboard to "..."

     

    • Like 1
  5. note: I have confirmed with the developer of skbee that this is not a plugin-side error, and have also confirmed that this works outside of minehut.

    on join:
        set title of player's scoreboard to "&6&lServer Info"
        while player is online:
            set line 1 of player's scoreboard to "&eOnline: &f0" # 0 for testing purposes only
            wait 1 second

    this only sets line 1 of player's scoreboard to "Online: " instead of "Online: 0"

    if i change line 4 to 
     

    set line 1 of player's scoreboard to "&eOnline: 0"

    it displays it fine, showing that there an issue with minehut supporting multiple color codes in the string of this skript expression

    I'm not sure how you'd go about resolving this issue but i thought it was worth reporting anyone because skbee is currently the best scoreboard option performance wise

    Resource page: https://www.spigotmc.org/resources/skbee-skript-addon.75839/

  6. 1) why are you merging tuske and vanilla syntaxes unnecessarily?

    2) for your repeated codes, you could easily use a loop for increased efficiency and readability

    3) you don't need to make your temporary variables player specific because they only exist in that scope/instance anyway

    4) your cancel event expression does not need to exist under every clicked slot condition, you could move it under the skbee/sknbeet inventory name condition

    5) You haven't stated any of the dependencies of this project, aka this project requiring skbee/snbeet and tuske

    6) expanding on point 3, you can literally just give the local location variable the identifier {_loc} due to it deleting itself after the inventory click event

  7. i suggest at the very least making the conditions else if conditions, as by doing so you won't be running unnecessary code when you've found the main argument. Also, with undisguising, it'd be better to reset their rank back to what they had prior to disguising

  8. 15 minutes ago, Mesyl2 said:

    That doesn't add up with what you originally posted

     

    The link brings you to the otherwise expression which doesn't add up with what you just said I already said I could maybe delete it however at the same time I've also been running into errors with the values being none this has been most noticable in removing of balance if the variable is none and a player trys to buy something their balance is negative 

    so for me to ensure no issues happen I set it to 0 you also need to keep in mind that logic only works for the very simple one and one more thing the variables are deleted upon leave

     

    what's the point of storing a variable at all if you're going to delete it on leave?

    there are no issues with the default value expression, if stuff is erroring you're doing it incorrectly
     

  9. It would appear that location variables in uploaded worlds (ones prefixed with "ul_") do not persist over restarts.

     

    command /setspawn:
    	trigger:
    		set {location::spawn} to location of player
    
    on join:
    	teleport player to {location::spawn}

    if i execute /setspawn and relog it works just fine. However when i restart the server, the location variable outputs <none> in a debug message

     

    After this method didn't work, i tried doing

    on join:
    	teleport player to location at 1, 5, 1 in "ul_world"

    and that did not work after restart either

     

    I assumed it was something to do with skript loading before the uploaded world did, so the identifier of the world was nullified, consequently so was the expression.

     

    Another method I tried was 

    on join:
    	teleeport player to location at 1, 5, 1 in "ul_world"
    
    on world load:
    	if event-world = "ul_world":
    		execute console command "sk reload Join"

    Therefore when the world is loaded in by the server, the script will be reloaded with the world "ul_world" now actually being recognised by the location at expression. Unfortunately, this did not fix anything, presumably due to the on world load event only being triggered by a player teleporting to the world, not the server

    as a last ditch, messy effort I tried

    on script load:
    	wait 30 seconds
    	execute console command "sk reload scripts"
    
    on join:
    		teleport player to location at 1, 5, 1 in "ul_world"

    still to no prevail

     

    ideally, i would rather only have my ul_world and no other world, but the generator settings to not seem to be validating the void world custom generation. If minehut users had access to server.properties i believe we would be able to change the level-name variable to our desired world and that would be sufficient, but obviously we don't have access to that. Is there anyway of changing the main world of the server to a void world?

    note: I do not wish to use multiverse, before anyone suggests this.

  10. 6 hours ago, Mesyl2 said:

    Never heard of that before I'll see what I can do with this new found knowledge thanks! XD

     

    at the same time @Ofus-Will I don't see how that can apply to this situation besides me maybe changing it to delete instead I still need to reset the victim's kill and not going to lie I only really see use for that in messaging something similar to what the example is 

     

    The point is that setting a variable to 0 unnecessarily takes up unnecessary memory space that wouldn't be taken up if you deleted it instead. My point was that there is no point setting it to 0, as keeping it as not set allows you to work with the variable exactly the same, but saves memory.

  11. 23 hours ago, Nic said:

    for people who want an extreamly simple one

     

    
    options:
    	killstreak_kills: 5
    
    on join:
    	set {kills::%player%} to 0
    on quit:
    	delete {kills::%player%}
    
    on death of a player:
    	set {kills::%victim%} to 0
    	attacker is a player
    	add 1 to {kills::%attacker%}
    	{kills::%attacker%} is divisible by {@killstreak_kills}
    #	send action bar "&c&lKS &8> &e%attacker% &fis on a &e%{kills::%attacker%}% kill streak" to all players
    	broadcast formatted "&c&lKS &8> &e%attacker% &7is on a &e%{kills::%attacker%}% kill streak"

     

    you never need to set a variable to 0, see here

×
×
  • Create New...