#feedback on this?
1 messages ยท Page 1 of 1 (latest)
your guis should be in functions instead of directly in the commands imo
the inventory click desperately needs some else ifs
why ifs?
never done this b4, unsure how to, and completely confused by this
else ifs
you just put the code ina function
and call the function when you need it
all the guis are different though
i thought so to but all the final texts are changed
and i wasnt sure how to change that
yeah you'll need different functions
but what if you want to open the gui based on a click event, or some other command
you open the metadata of the inventory?
rn you'd have to copy-paset or execute console command
just use a parameter
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
only if they've already run the troll command
more functions = longer? no?
negligible
well the skript is basically done, i dont plan on adding more
why loop 10 times?
then why did you even ask for feedback
im looking for optimization mainly
well step 1 is use else ifs
and if you want optimization you should use skript-gui over vanilla guis here
is this meant to be doubled
wym
for each player it adds all 8 directions
its a local variable so right after its used, its gone
so if you do it to 10 players, it's a list of 80 things
alright
add is bad
you could replace this by just getting the player's location, setting the y coord to 100, and using that
hm
this can grief things
yeah that was why i put the #
lemme try to understand this- gimme a sec
and if they log out, then it'll stick around forever
?
sorry not log out, if the server crashes
yeah
ok lets go one at a time
im confused on this, you set the location to a variable, how would i set the y level
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?
mhm
why
that wouldn't be any more efficient
often less lines is actually worse performance
i had a massive issue with this, just trying to get it to work without it staying forever
however how can i make it do it all at once?
lists?
so just backspace the final two lines?
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
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
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::*}```
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``` this lags the server a lot
3000??
mhm
my original wasnt 3000
well probably 4000 actually
my original was like less than 100
your original limited the y coord of the looped blocks
oh
which would be 300
where [y-coordinate of input is 100.5]:
how did that limit it
anyways solved it by reinputting it
that one thing
because it changes from a sphere to a disc
oh quite a bit more
damn
this is quite silly
probably
it's all happening at once, what's the point
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
yes but that's irrelevant here
you're playing 16 sounds at the exact same time
why not just play the 2 that matter
as the arrow one?
yeah
alr gimme a sec
also vulnerable to the waiting thing
this one gives out free buckets
what if they drop it within 15s
right
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)
ditto
this could be a loop
unless you're really attached to the random 2/3 sec waits
loop
very much
why attacker
wym
ditto means "same"
just go one by one
whats the difference between having a bunch of ifs and having else ifs?
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
ah
why the variable in the middle
good question
for a lot of the "hacks", the ops will get spammed with the msgs
because it sends once for each player in p
happens a lot, and the 250 mobs would die within seconds, wouldnt do much lag
look at the else
look at the loop it's in
righttttt
setting the location can be way better, but this is why its not a trollall, specifically designed when ur in the wild
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
good idea
uhhh good question. does that not work?
is fall damage the attacker?
the attacker is null
oh
ok so, like this?
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)```
alright this is my update @sharp pine any feedback?
except for the uh troll "hacks"
I'll glance tonight
Nine-Hundred LINES?
yes
is that a bad thing?
i mean it has many features
some were more difficult to do than others
but still a good skript
itd be better if i did this with java though so i could have a dozen more commands and trolls that are applicable given skript cant do everything
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
because 800 is fine
did say that
its extremely complex of how i made it
that's all ima say
you need to do that multiplication again
ill probs simplify it later
plus the point is why not just 1 loop
oh
wym
didnt really think about that but good point
not sure what you're saying here
loop 800 times
not
loop 100 times:
loop 8 times:
pointed out before, its always different at the ending so idk how to do it
lol
and i literally told you how
where
you just make it a function parameter
that didnt solve the problem
yeah, it would
every ending is completely different than the last
unless- aha
i use a variable in it
no they're all identical except the troll name
yeah that's literally what i said
thats literally what i was saying
no
never once did you explain it
saysomething({_p::*}, "Thor")
smh
i also showed an example here
for something completely different
see TrollAdminBroadcast
that wasnt there before
yeah, i wrote it there when i sent the message
never saw it
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
well, for starters, you are trying to use a local variable in a function that is never set. that is why
pretty sure the idea of functions is that its set
but anyway i figured it out myself
I didn't catch that
what im saying is, i fixed it
just stop using TrollPlayer in general
it's a lot of changes but makes your code much less confusing
all the information the function needs should be supplied through parameters
well id need a variable for it to detect arg-1 otherwise it'd assume im arg-1 if I did TrollIgnite(p:player)
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
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
well you don't care who initiated the troll
the function doesn't need to know that
which i fixed
all it needs to know is who to troll
which is set with a variable by arg-1
well you need the trollname right
what type is that
mhm
t:text?
well i'd name it somethign reasonable
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
while you're at it you could replace p with something like targets
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::*}
well it's a list now
you can't replace a single value with a list and expect everything to work
make it not a list
mhm
alright fixed
ive done everything youve said
cool
heres the updated version, any other feedback?
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>?
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```
you can handle "help" if you just check for arg-2 being "help" instead
if it were player, typing in /troll help
wouldnt be a thing
why would you wanna do /troll <playername> help
thats weird
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
so it clears, would you rather the list continue on growing everytime you input a username, so that someone youve finished trolling is affected?
i dont
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}
this is broken because you used players instead of player
right forgot to set that
you never put more than one player into it
so don't make it a list
same here
since its a helper, i just removed the s, wasnt needed
will do the same thing
therte
well what would the variable name be? "{TrollPlayer} to arg-1 parsed as player"?
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
read the hashtag
ah
this would work however im confused on the gui.
TrollThor({TrollPlayer::*})```
currently its this
if i removed the variable, how would i make it detect the player?
15.06 01:38:33 [Server] INFO Line: TrollDamage(arg-1)
15.06 01:38:33 [Server] INFO Line 107: (Troll.sk)```
seems to work if i parse it, but you said i didnt need to
i said you don't need to IF you use the player argument in the command
oh
you would just use metadata tag "troll-target" of player
what?
yes it would
...
function(metadata tag "troll-target" of player)
or put it in a local var first if you feel like more readable code
im so confused
about what
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?
(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
alright, how do i make it detect a player whos online?
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?
what is your name
ElijahJunaid
is there a way to prevent that with skript?
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
interesting
maybe smth like this:
loop all players:
if <player name value or smth idk> is "%loop-player%":
something
offine players don't have to actually exist, Bukkit makes it up on the spot if there isn't any data for them. You have to use {_offlineplayer} has played before to check if they've ever joined the server
yeah, but that's not quite relevant here
we're talking about just normal player
and "makes it up" means "asks Mojang servers about this username"
smth like this could work
"%arg 1%" parsed as player, if it returns none then the player doesn't exist
that doesnt stop the issue of typing in like "jah" and it thinking my name is that
do you need exact matches?
that would be preferable
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
perfect this works
so if i do this, how does it work? as i dont believe its a username
if event-inventory = (metadata tag "Troll" of player):
cancel event
if index of event-slot is 10:
TrollThor(metadata tag "troll-target" of player)```
but its non-existent
just instead of being a skript var, it's in metadata
well yeah you gotta set it
like i said here
that doesnt explain where
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
well it needs to be the actual player
so it needs to be parsed if you're using a text argument
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
use some ()
or pull it out to a local var
it's thinking you want the metadata tag of both player and player
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
where exactly would i parse it and set it to a variable without creating at least 2 extra lines
its been about 6 months since the last message here - i finally finished it and im looking for additional feedback