#Massive error occurring

1 messages · Page 1 of 1 (latest)

inland gorge
#

you have code that's taking too long to parse

#

the solution is to write shorter lines

#

or use more ()

open dune
inland gorge
#

what?
the issue is the parsing is taking too long, so paper thinks the server's frozen and crashed

#

therefore, the solution is to write code that doesn't take so long to parse

open dune
#

hmm, that makes sense

open dune
inland gorge
#

no

open dune
#

My skript is 752 lines

inland gorge
#

that doesn't matter

#

it's the length of individual lines that matter

#

more, shorter lines is waayyyyy better than fewer, long lines

#

really bad: set slot 5 of metadata tag "gui" of player to diamond sword of sharpness 5 and mending 1 named "hey" with lore "test", "test2", "test3", and "test4"
ok: set {_item} to diamond sword of sharpness 5 and mending 1 set slot 5 of metadata tag "gui" of player to {_item} named "hey" with lore "test", "test2", "test3", and "test4"
good:

set {_item} to diamond sword of sharpness 5 and mending 1
set name of {_item} to "hey"
set lore of {_item} to "test", "test2", "test3", and "test4"
set slot 5 of (metadata tag "gui" of player) to {_item}```
open dune
#

What about this?

    permission: staff.admin
    trigger:
        send "&c&m                            &r {@prefix} &r&c&m                             "
        send ""
        send "&c&lCommands:"
        send ""
        send "&4/admin:give &c<gen/sellwand> <tier> [<amount>] [<player>]"
        send "&3Description: &bgive generator/sellwand to yourself or to others"
        send "&8Example: &7/admin:give gen 5 10 (will give you generator tier 5, 10pcs)"
        send ""
        send "&4/admin:slot &c<add/remove/reset> <gen/hopper/chest> <player> [<amount>]"
        send "&3Description: &badd/remove/reset <gen/hopper/chest> slot of a player"
        send "&8Example: &7/admin:slot add gen PLAYER 10 (this will give PLAYER 10 more genslot)"
        send "&8Example: &7/admin:slot add hopper PLAYER 10 (this will give PLAYER 10 more hopper slot)"
        send "&8Example: &7/admin:slot add chest PLAYER 10 (this will give PLAYER 10 more chest slot)"
        send ""
        send "&4/admin:count &c<add/remove/set/reset> <gen/hopper/chest> <player> [<amount>]"
        send "&3Description: &badd/remove/reset <gen/hopper/chest> slot of a player"
        send "&8Example: &7/admin:count add gen PLAYER 10 (this will give PLAYER 10 more gen count)"
        send "&8Example: &7/admin:count add hopper PLAYER 10 (this will give PLAYER 10 more hopper count)"
        send "&8Example: &7/admin:count add chest PLAYER 10 (this will give PLAYER 10 more chest count)"
        send ""
        send "&4/admin:multi &c<add/remove/set/reset> <player> [<amount>]"
        send "&3Description: &badd/remove/reset multi of a player"
        send "&8Example: &7/admin:multi add PLAYER 10 (this will give PLAYER 10 more multi)"
        send "&8Example: &7/admin:multi remove PLAYER 10 (this will remove 10 multi from Player's multi)"
        send "&8Example: &7/admin:multi set PLAYER 10 (this will set Player's multi to 10)"
        send ""
        send "&c&m                                                                              "```
inland gorge
#

no that's very fast to parse

#

a single string is very easily parsed, pretty much regardless of length

open dune
#

What about something like this,

    usage: &4/admin:count &c<add/remove/reset> <gen/hopper/chest> <player> [<amount>]
    permission: staff.admin
    trigger:
        set {_count} to arg-4
        set {_receiver} to arg-3's uuid
        set {_preceiver} to arg-3
        if arg-1 = "add":
            if arg-2 = "gen":
                if {_count} is set:
                    add {_count} to {papelgen::%{_receiver}%::maxcount}
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::maxcount}% Gen count"
                else:
                    send "&c/admin:count &7add gen <player> <amount>"

            else if arg-2 = "chest":
                if {_count} is set:
                    add {_count} to {papelgen::%{_receiver}%::chest::max}
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::chest::max}% Chest count"
                else:
                    send "&c/admin:count &7add chest <player> <amount>"

            else if arg-2 = "hopper":
                if {_count} is set:
                    add {_count} to {papelgen::%{_receiver}%::hopper::max}
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::hopper::max}% Hopper count"
                else:
                    send "&c/admin:count &7add hopper <player> <amount>"


        else if arg-1 = "remove":
            if arg-2 = "gen":
                if {_count} is set:
                    remove {_count} from {papelgen::%{_receiver}%::counter}
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::counter}% Gen count"
                else:
                    send "&c/admin:count &7remove gen <player> <amount>"

            if arg-2 = "chest":
                if {_count} is set:
                    remove {_count} from {papelgen::%{_receiver}%::chest::counter}
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::chest::counter}% Chest count"
                else:
                    send "&c/admin:count &7remove chest <player> <amount>"

            if arg-2 = "hopper":
                if {_count} is set:
                    remove {_count} from {papelgen::%{_receiver}%::hopper::counter}
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::hopper::counter}% Hopper count"
                else:
                    send "&c/admin:count &7remove hopper <player> <amount>"

        else if arg-1 = "set":
            if arg-2 = "gen":
                if arg-4 is set:
                    set {papelgen::%{_receiver}%::counter} to arg-4
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::counter}% Gen count"
            if arg-2 = "chest":
                if arg-4 is set:
                    set {papelgen::%{_receiver}%::chest::counter} to arg-4
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::chest::counter}% Chest count"
            if arg-2 = "hopper":
                if arg-4 is set:
                    set {papelgen::%{_receiver}%::hopper::counter} to arg-4
                    send "%{_preceiver}% now has %{papelgen::%{_receiver}%::hopper::counter}% Hopper count"

        else if arg-1 = "reset":
            if arg-2 = "gen":
                set {papelgen::%{_receiver}%::counter} to 0
                send "%{_preceiver}% now has %{papelgen::%{_receiver}%::counter}% Gen count"
            if arg-2 = "chest":
                set {papelgen::%{_receiver}%::chest::counter} to 0
                send "%{_preceiver}% now has %{papelgen::%{_receiver}%::chest::counter}% Chest count"
            if arg-2 = "hopper":
                set {papelgen::%{_receiver}%::hopper::counter} to 0
                send "%{_preceiver}% now has %{papelgen::%{_receiver}%::hopper::counter}% Hopper count"```
inland gorge
#

instead of asking me every time, try deleting it and see if the error's still there

#

if it disappears, you've found the culprit