#feedback on this?

1 messages ยท Page 1 of 1 (latest)

signal crag
sharp pine
#

your guis should be in functions instead of directly in the commands imo

#

the inventory click desperately needs some else ifs

signal crag
#

why ifs?

signal crag
sharp pine
sharp pine
#

and call the function when you need it

signal crag
#

all the guis are different though

sharp pine
#

this really should be a function too

#

you have it duplicated many times

signal crag
#

i thought so to but all the final texts are changed

#

and i wasnt sure how to change that

sharp pine
#

but what if you want to open the gui based on a click event, or some other command

signal crag
#

you open the metadata of the inventory?

sharp pine
#

rn you'd have to copy-paset or execute console command

sharp pine
signal crag
#

open (metadata tag "Troll" of player) to player

#

thatd open it

#

perfectly fine

#

if it makes it more efficient ill do it

#

but i dont see how

sharp pine
signal crag
#

more functions = longer? no?

sharp pine
signal crag
#

well the skript is basically done, i dont plan on adding more

sharp pine
#

why loop 10 times?

sharp pine
signal crag
#

im looking for optimization mainly

signal crag
#

and 100% avoidable

sharp pine
signal crag
#

im confused by that

#

theres no ifs

#

at all

sharp pine
#

and if you want optimization you should use skript-gui over vanilla guis here

sharp pine
#

1 is 1:
is the exact same as
if 1 is 1:

signal crag
#

oh

#

i did not know that

sharp pine
#

is this meant to be doubled

signal crag
#

also no its not

#

plenty of issues id miss if i didnt ask for help

sharp pine
#

this is really bad

#

you're making the list bigger and bigger and bigger

signal crag
#

wym

sharp pine
#

for each player it adds all 8 directions

signal crag
#

its a local variable so right after its used, its gone

sharp pine
#

so if you do it to 10 players, it's a list of 80 things

signal crag
#

i guess

#

is there a better way to get all directions?

sharp pine
#

literally just do it before the loop

#

and use SET not ADD

signal crag
#

alright

sharp pine
#

add is bad

#

you could replace this by just getting the player's location, setting the y coord to 100, and using that

signal crag
#

hm

sharp pine
#

this can grief things

signal crag
#

yeah that was why i put the #

signal crag
sharp pine
#

and if they log out, then it'll stick around forever

signal crag
#

?

sharp pine
#

sorry not log out, if the server crashes

signal crag
#

yeah

sharp pine
#

this will do the trolls one at a time, not all at once

#

same here

signal crag
#

ok lets go one at a time

signal crag
signal crag
#
        set {_location} to loop-value-1's location
        set y-coordinate of {_location} to 100
        loop (all blocks in radius 10 of {_location})
            spawn arrow at loop-block```
#

like that?

sharp pine
#

mhm

signal crag
#

is there a way to make it one less line

#

like setting the y level in the location?

sharp pine
#

why

signal crag
#

idk

#

im looking for ways for it to be more efficient

sharp pine
#

that wouldn't be any more efficient

signal crag
#

if it sets the y level in the same line, it might be faster

#

ah ok

sharp pine
#

often less lines is actually worse performance

signal crag
#

however how can i make it do it all at once?

#

lists?

sharp pine
#

you have to wait outside of the loop

#

(or call another function)

signal crag
#

so just backspace the final two lines?

sharp pine
#

function TrollPumpkin(p:players):
    TrollAdminBroadcast({_p::*}, "Pumpkin Head")
    loop {_p::*}:
        TrollPumpkinHelper(loop-player)

function TrollPumpkinHelper(p:player):
    set {_helmet} to helmet of {_p}
    set helmet of {_p} to carved pumpkin of curse of binding
    wait 15 seconds
    set helmet of {_p} to {_helmet}``` something like this
signal crag
#

ah

#

now i understand what you mean

#

a loop goes through each thing, so the wait takes 15 seconds for every person as it only goes 1 by 1

#

alright let me test that

signal crag
# sharp pine literally just do it before the loop
12.06 00:33:58 [Server] INFO (north, south, east, west, west and north, east and north, west and south and east and south) can't be set to anything
12.06 00:33:58 [Server] INFO Line: set north, south, east, west, northwest, northeast, southwest and southeast to {_directions::*}```
sharp pine
#

bro

#

think for a second

signal crag
#

right

#

its the other way around

#

or not?

#

im dumbfounded

signal crag
sharp pine
#

well yeah

#

that's 3000 arrows

#

per player

signal crag
#

3000??

sharp pine
#

mhm

signal crag
#

my original wasnt 3000

sharp pine
#

well probably 4000 actually

signal crag
#

my original was like less than 100

sharp pine
signal crag
#

oh

sharp pine
#

which would be 300

signal crag
#

where [y-coordinate of input is 100.5]:

#

how did that limit it

#

anyways solved it by reinputting it

#

that one thing

sharp pine
signal crag
#

o

signal crag
#

anything else?

sharp pine
#

oh quite a bit more

signal crag
#

damn

sharp pine
#

this is quite silly

signal crag
#

probably

sharp pine
#

it's all happening at once, what's the point

signal crag
#

but its earrape

#

to annoy the player

sharp pine
#

just play it once

#

it's the same effect

signal crag
#

but then its not annoying

#

if you play it once its not that annoying

sharp pine
#

it's literally the same

#

you're playing all those sounds at the exact same time

#

even if you want to maintain playing all those sounds, you should loop instead of copy-paste

signal crag
#

well i mean

#

it does loop 100 times

#

so thats like

#

800 times

sharp pine
#

yes but that's irrelevant here

#

you're playing 16 sounds at the exact same time

#

why not just play the 2 that matter

signal crag
#

good point, i should loop the loop

#

since theyre exactly the same

sharp pine
#

same thing here

#

same thing here

signal crag
#

as the arrow one?

sharp pine
#

yeah

signal crag
#

alr gimme a sec

sharp pine
signal crag
#

right

#

anything that has a wait needs a second function

sharp pine
#

this one gives out free buckets

signal crag
#

well i mean

#

it shouldnt

#

it removes it

sharp pine
#

what if they drop it within 15s

signal crag
#

right

sharp pine
#

or put it in a chest

#

and what if there are blocks at y 200

#

the cap is like 300 something now

#

this could obliterate people's bases

#

imagine doing this to 10 people
that's 250 mobs spawned instantly

#

they also might just spawn in the ground if the player is looking upwards

#

else if
(or better yet, a list)

#

this could be a loop

#

unless you're really attached to the random 2/3 sec waits

sharp pine
#

why attacker

signal crag
sharp pine
signal crag
#

so much to work to understand at once

sharp pine
#

just go one by one

signal crag
sharp pine
#

if it's else if, then skript doesn't have to check all the others once it finds one that works

#

if ti's just if, it has to check every single one

signal crag
#

ah

sharp pine
#

why the variable in the middle

signal crag
#

good question

sharp pine
#

for a lot of the "hacks", the ops will get spammed with the msgs
because it sends once for each player in p

signal crag
sharp pine
signal crag
#

righttttt

signal crag
signal crag
#

as im not sure

sharp pine
#

well you could try to check a bunch of events
personally i'd just give them a normal water bucket and not care about where it ends up

signal crag
#

good idea

signal crag
#

is fall damage the attacker?

sharp pine
#

the attacker is null

signal crag
#

oh

signal crag
#
    if event-inventory = (metadata tag "Troll" of player):
        cancel event
        if index of event-slot is 10:
            TrollThor(player)
        else if index of event-slot is 11:
            TrollFreeze(player)```
signal crag
signal crag
#

except for the uh troll "hacks"

sharp pine
#

I'll glance tonight

rocky depot
#

Nine-Hundred LINES?

signal crag
#

is that a bad thing?

#

i mean it has many features

#

some were more difficult to do than others

#

but still a good skript

signal crag
sharp pine
#

looks like you're missing a few

#

this should REALLY be a function like i said previously

#

often you can just act on the list directly; ignite {_p::^}

#

why not just 8000

#

also that's like 13 minutes straight

#

also i don't think you're keeping {_p} and {TrollPlayer::%{_p}%} straight in a lot of these
you really should aim to do away with {TrollPlayer::%{_p}%} entirely

#

just pass in the playrs to be acted upon as parameters always

#

still an issue w/ the repeated messages

signal crag
signal crag
signal crag
#

that's all ima say

sharp pine
#

it's quite basic

#

you've just overcomplicated that

signal crag
#

yes

#

i did

sharp pine
signal crag
#

ill probs simplify it later

sharp pine
#

plus the point is why not just 1 loop

signal crag
signal crag
signal crag
sharp pine
sharp pine
signal crag
sharp pine
signal crag
#

where

sharp pine
#

you just make it a function parameter

signal crag
#

that didnt solve the problem

sharp pine
#

yeah, it would

signal crag
#

every ending is completely different than the last

#

unless- aha

#

i use a variable in it

sharp pine
#

no they're all identical except the troll name

sharp pine
signal crag
#

thats literally what i was saying

signal crag
sharp pine
signal crag
#

never once did you explain it

sharp pine
#

saysomething({_p::*}, "Thor")

signal crag
#

smh

sharp pine
signal crag
#

for something completely different

sharp pine
#

see TrollAdminBroadcast

signal crag
#

that wasnt there before

sharp pine
#

yeah, i wrote it there when i sent the message

signal crag
#

never saw it

signal crag
#

ok so uhh

#

so uh after some testing, my overcomplication has quite literally flipped me over

#
    loop all players where [input has permission "op"]:
        if size of {_p::*} = 1:
            send "{@prefix2} &b%{TrollPlayer::%{_p::*}%}% has been trolled with Ignite" to loop-player
        else:
            send "{@prefix2} &b%size of {_p::*}% players have been trolled with Ignite" to loop-player
    loop {_p::*}:
        ignite loop-value-1``` if i do TrollIgnite(player) it sets {_p::*} to the user executing the command, not the player being targeted via arg-1 of the troll command
#

trollall works perfectly though

#
command /troll [<text>] [<text>]:
    permission: op
    trigger:
        clear {TrollPlayer::*}
        if arg-1 is not set:
            send "&cUsage: /troll help"
            stop
        else:
            if arg-1 is "help":
                send "&cDo /troll {player} to troll the player." to player
                send "&cDo /troll {player} {troll} to do it without a GUI." to player
                stop
            else:
                set {TrollPlayer::%player%} to arg-1 parsed as player
                if {TrollPlayer::%player%} is not set:
                    send "&cPlayer not found" to player
                    stop```
#

thats my command

#

how do i make it work properly? @sharp pine

#

when i broadcast, like this: broadcast "%{_p::*}%" broadcast "%{TrollPlayer::%{_p::*}%}%"

#

the first one returns me

#

the second one returns arg-1 of the command

rocky depot
#

well, for starters, you are trying to use a local variable in a function that is never set. that is why

signal crag
#

but anyway i figured it out myself

rocky depot
#

I didn't catch that

signal crag
#

what im saying is, i fixed it

sharp pine
#

it's a lot of changes but makes your code much less confusing

#

all the information the function needs should be supplied through parameters

signal crag
#

however you are right, i can stop using it in the functions, specifically for if size of p = 1 as i can just do {_p::*} and itll say the name of the player

signal crag
# sharp pine i also showed an example here
    loop all players where [input has permission "op"]:
        if size of {_p::*} = 1:
            send "{@prefix2} &b%{_p::*}% has been trolled with %{_trollname}%" to loop-player
        else:
            send "{@prefix2} &b%size of {_p::*}% players have been trolled with %{_trollname}%" to loop-player``` i got as far as here for writing the function
sharp pine
#

the function doesn't need to know that

signal crag
sharp pine
#

all it needs to know is who to troll

signal crag
#

which is set with a variable by arg-1

sharp pine
#

what type is that

signal crag
#

uh

#

a text?

sharp pine
#

mhm

signal crag
#

t:text?

sharp pine
#

well i'd name it somethign reasonable

signal crag
#

t seems reasonable

#

very short

sharp pine
#

it seems very bad given that you have the nice already written {_trollname}

#

it even tells you what it is!

#

who knows what t means

signal crag
#

trollname wasnt set

#

as i didnt know what to do

#

so i just typed random stuff

sharp pine
#

while you're at it you could replace p with something like targets

signal crag
#
15.06 00:58:13 [Server] INFO Can't understand this condition/effect: set block north above {_p::*} to barrier``` ```15.06 00:58:13 [Server] INFO There's no location in a function event
15.06 00:58:13 [Server] INFO Line: drop {_p::*}'s tool at {_p::*}'s location``` ```15.06 00:58:13 [Server] INFO Can't understand this expression: '{_p::*}'s location'
15.06 00:58:13 [Server] INFO Line: set {_location} to {_p::*}'s location```
#

3 main errors

#

they all worked before i set trollplayer to {_p::*}

sharp pine
#

well it's a list now

#

you can't replace a single value with a list and expect everything to work

signal crag
#

yea

#

but how do i fix it

sharp pine
#

make it not a list

signal crag
#

alright i fixed the first one

#

i assume for the other two, i have to do the same?

sharp pine
#

mhm

signal crag
#

alright fixed

signal crag
sharp pine
#

cool

signal crag
sharp pine
#

why is TrollPlayer a list here
why is it used at all outside of the gui option

#

for that matter, why is the first argument not <player>?

signal crag
#
            if arg-1 is "help":
                send "&cDo /troll {player} to troll the player." to player
                send "&cDo /troll {player} {troll} to do it without a GUI." to player
                stop```
sharp pine
#

you can handle "help" if you just check for arg-2 being "help" instead

signal crag
#

if it were player, typing in /troll help

#

wouldnt be a thing

#

why would you wanna do /troll <playername> help

#

thats weird

sharp pine
#

you don't

#

you do /troll help

#

and skript is like, ok, no player, let's put it in the text argument then

#

see, no player, but arg-2 is help

signal crag
#

i dont

sharp pine
#

no i would say that it shouldn't be used at all here

#

you have arg-1, use that everywhere
if they open the GUI, only then set a global var (or even better, use metadata)

#

clearing that list also breaks any other guis that are open by other players

#

you can replace the loop with simply sending to that filtered list of players directly

#

send "x" to all players where []

#

why is there p::1

#

why not just only accept 1 player in the function

#

p: player
then you just use {_p}

signal crag
#

because the variable used to detect it is a list

#

and its one less line

sharp pine
#

this is broken because you used players instead of player

signal crag
#

right forgot to set that

sharp pine
#

so don't make it a list

signal crag
#

will do the same thing

#

therte

sharp pine
#

yeah that's the solution

#

do it for the other helpers too

signal crag
#

yeah

#

fixed it for all of them

signal crag
sharp pine
#

well as i said earlier, you don't actually need that variable
and if you use the player argument, you don't need to parse either

#

you could just do TrollWhatever(arg-1)

#

and for the gui, you could do set metadata tag "troll-target" of player to arg-1 and reference that (or you could use a global var if you really want to)

#

this still needs fixing

signal crag
#

read the hashtag

sharp pine
#

ah

signal crag
#
            TrollThor({TrollPlayer::*})```
#

currently its this

#

if i removed the variable, how would i make it detect the player?

signal crag
#

seems to work if i parse it, but you said i didnt need to

sharp pine
#

i said you don't need to IF you use the player argument in the command

signal crag
#

oh

sharp pine
signal crag
#

but- thats not-

#

that-

#

bruh

sharp pine
#

what?

signal crag
#

that doesn't help get the name for the inventory clicj

#

click

sharp pine
#

yes it would

signal crag
#

that makes zero sense

#

how would i call the function??

sharp pine
#

function(metadata tag "troll-target" of player)

#

or put it in a local var first if you feel like more readable code

signal crag
#

im so confused

sharp pine
#

about what

signal crag
#
15.06 02:58:19 [Server] INFO Can't understand this condition: 'arg-1 parsed as online player is not set'
15.06 02:58:19 [Server] INFO Line: if arg-1 parsed as online player is not set:``` how do i make this condition work?
sharp pine
#

(again, you don't have to parse if you just use the player argument)
but try removing online

#

because online player is not a type

signal crag
#

alright, how do i make it detect a player whos online?

sharp pine
#

all players are online

#

only offline players can be offline

signal crag
#

well i type in "a" and somehow that goes through as a player

#

could it be filling in my name despite it not being my name?

sharp pine
#

what is your name

signal crag
#

ElijahJunaid

sharp pine
#

ah classic bukkit

#

it's over-eager in matching names

signal crag
#

is there a way to prevent that with skript?

sharp pine
#

i'm not entirely sure let me look into it

#

my gut reaction is no

#

yeah no

#

i guess the player argument idea has a hole

signal crag
#

interesting

analog willow
stone token
analog willow
#

or that

#

yea

sharp pine
#

we're talking about just normal player

#

and "makes it up" means "asks Mojang servers about this username"

stone token
#

"%arg 1%" parsed as player, if it returns none then the player doesn't exist

signal crag
stone token
#

do you need exact matches?

signal crag
#

that would be preferable

stone token
#
if name of {_player} is not arg 1:
    send "Unknown player"
    stop```
#

format it how you want, but that'll make sure the name matches exactly and throw an error if it doesn't

#

If you're using it in a function, change stop to return and make the message send to whatever player the function is being run with

#

otherwise do what Agent suggested

signal crag
#
    if event-inventory = (metadata tag "Troll" of player):
        cancel event
        if index of event-slot is 10:
            TrollThor(metadata tag "troll-target" of player)```
sharp pine
#

it's just a player

#

it's basically a variable, it stores the player for you

signal crag
#

but its non-existent

sharp pine
#

just instead of being a skript var, it's in metadata

sharp pine
signal crag
#

the metadata does not exist

#

where

#

and how

signal crag
#

that doesnt explain where

sharp pine
#

when you're opening the gui to the player

#

in the troll command

signal crag
#
    permission: op
    trigger:
        clear {TrollPlayer::*}
        if arg-1 is not set:
            send "&cUsage: /troll help"
            stop
        else:
            if arg-1 is "help":
                send "&cDo /troll {player} to troll the player." to player
                send "&cDo /troll {player} {troll} to do it without a GUI." to player
                stop
            else:
                set {_player} to arg-1 parsed as player
                if name of {_player} is not arg-1:
                    send "&cPlayer not found" to player
                    stop
        if arg-2 is not set:
            set metadata tag "troll-target" of player to arg-1```
#

not working

#

very last line

sharp pine
#

well it needs to be the actual player

#

so it needs to be parsed if you're using a text argument

signal crag
#

right

#

it works

#

amazing

#
15.06 03:28:43 [Server] INFO Line: TrollDrop(metadata tag "troll-target" of player, player)```
#

couldve sworn a comma meant its another argument

sharp pine
#

use some ()

#

or pull it out to a local var

#

it's thinking you want the metadata tag of both player and player

signal crag
#

fixed

sharp pine
#

parse as player once at the top

#

you don't need to have it everywhere

#

just set {_target} to arg-1 parsed as player and use {_target}

#

likewise here
just put it in a local var at the start

#

the -1 might be an issue

#

missed a p::1

signal crag
sharp pine
#

right here

#

and boo hoo, 2 extra lines

#

mate your skript is hundreds of lines

signal crag
#

true

#

its like a plugin designed in a skript

sharp pine
#

it's looking a lot better now though

#

all the things are rather minor changes now

signal crag
#

its been about 6 months since the last message here - i finally finished it and im looking for additional feedback