Content of Denizen Script Paste #110597: Unnamed Denizen Script Paste... pasted 2023/06/02 08:08:26 UTC-07:00, Paste length: 24084 characters across 511 lines, Content: bell_events: type: world
#(Niklas) Finding the error
1 messages · Page 1 of 1 (latest)
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
what exactly is the error you are trying to find?
what is this?
This is represents your code
try this
But I need the excact amount of bells....
at 2 pm the bell should ring twice.
at 2:15 pm once
at 2:30pm twice
and so on
gimme a minute
You can store it in data map
how?
yes.
!lang data script
Data script containers are generic script containers for information that will be referenced by other scripts.
No part of a 'data' script container is ever run as commands.
There are no required keys.
Generally, data is read using the !tag ScriptTag.data_key tag.
data_script_name:
type: data
# Your data here
some_key: some value
some_list_key:
- some list value
some_map_key:
some_subkey: some value
Group
Script Container System
that's how
you can store keys and values into a data script
and then depending on the current time read from them
Or you write an algorithm that does the calculations for you
so you don't need 1000 events
do you know what I mean?
no not realy
at minute 00 the bell rings 4 times
at minute 15 the bell rings 1 time
at minute 30 the bell rings 2 times
at minute 45 the bell rings 3 times
so you could create a formula that calculates the amount of repeats
00 equals 60
so if you divide 60 by 15 it's 4
if you divide 30 by 15 it's 2
do you get it now?
!e system time
Group
Core
Event Lines
system time <HH:MM> system time hourly|minutely|secondly
Switches
every:<count> to only run the event every *count* times (like "on system time secondly every:5" for every 5 seconds).
Triggers
when the system time changes to the specified value.
The system time is the real world time set in the server's operating system.
It is not necessarily in sync with the game server time, which may vary (for example, when the server is lagging).
For events based on in-game time passage, use !event delta time or !command wait.
Context
<context.hour> returns the exact hour of the system time.
<context.minute> returns the exact minute of the system time.
Examples
on system time hourly:
- announce "Whoa an hour passed!"
on system time 12:00:
- announce "Whoa it's noon!"
on system time 03:00:
- announce "Daily restart in 5 minutes!"
- wait 5m
- adjust server restart
ok well...
Returns the element divided by a number.
Group
math
Returns
ElementTag(Decimal)
!t element.round
Could we please stay on topic
ok ok sorry
Can we work on merging your events first
ok
great
But I have never worked with data keys
yeah
that's a world script container
it's for events
so your script fires every 15 minutes right?
yeah
!event system time
Group
Core
Event Lines
system time <HH:MM> system time hourly|minutely|secondly
Switches
every:<count> to only run the event every *count* times (like "on system time secondly every:5" for every 5 seconds).
Triggers
when the system time changes to the specified value.
The system time is the real world time set in the server's operating system.
It is not necessarily in sync with the game server time, which may vary (for example, when the server is lagging).
For events based on in-game time passage, use !event delta time or !command wait.
Context
<context.hour> returns the exact hour of the system time.
<context.minute> returns the exact minute of the system time.
Examples
on system time hourly:
- announce "Whoa an hour passed!"
on system time 12:00:
- announce "Whoa it's noon!"
on system time 03:00:
- announce "Daily restart in 5 minutes!"
- wait 5m
- adjust server restart
Do you see a switch here that could be possible helpful for you?
type: world
events:
on system time minutely:15:```
exactly!
not really
but you've got it
minutely is part of the event label
the switch is called every
ah on system time minutely every:15:
yep
now we need the logic
what do you think we could do to get the amount of repeats?
15 -> 1
30 -> 2
45 -> 3
60 -> 4
we could take the <context.hour> and devide it by 4?
do you mean minute?
uhm hm
oh by 15 xD
Returns the element divided by a number.
Group
math
Returns
ElementTag(Decimal)
!t element.round
you might need round, incase the system time event fires at the wrong minute
ie: 14 or / 16
ok. Now I need an if dont I?
can you explain me why you think you need an if?
to check if the output matches 1 / 2 / 3 / 4
well I have no clue what I need to add now...
well
on system time 00:30:
- repeat 2:
- playsound <location[kapelleglocke]> sound:block_bell_use volume:20 sound_category:master
- wait 2
this is a snipped of your script
you just figured a formula that returns the amount of repeats
You've said divide minutes by 15
and you also figured the event label you need, to prevent 96 events
also you already know the tag that returns the current minute
!t element.div
Returns the element divided by a number.
Group
math
Returns
ElementTag(Decimal)
and this tag rounds a number
yeah
type: world
events:
on system time minutely every:15:
- repeat <div[<context.minute>.15]>:
- playsound sound:block_bell_use sound_category:master volume:1```
nah this wont work.
Should i give you complete code?
Or it's better for you to figure out by yourself?
well I wont say no.
didn't test it btw
yep. it won't ring at 12:00 🤪
brainless .mod[12] is wrong. but you can find the right way
the event isnt the problem... the targets isnt working....
Yeah. We're here love to solve unexisting problems
Isn't working how?
I see you're noting location by command
wth is this
bellkapelle_command:
type: command
name: glockeankapelle
usage: /glockeankapelle
permission: team
debug: false
description: Bell define
script:
- if <player.cursor_on_solid.material.name> == bedrock:
- note <player.cursor_on_solid> as:kapelleglocke
- narrate "<gold>Gemmeria <&8>| <&7>Glocke der Kapelle erstellt"
- else:
- narrate "<gold>Gemmeria <&8>| <&7>Dass geht nur mit Bedrock!"
belloffkapelle_command:
type: command
name: glockeauskapelle
permission: team
debug: false
usage: /glockeauskapelle
description: Bell define
script:
- if <player.cursor_on_solid.note_name> == kapelleglocke:
- note remove as:kapelleglocke
- narrate "<gold>Gemmeria <&8>| <&7>Glocke der Kapelle entfernt"
- else:
- narrate "<gold>Gemmeria <&8>| <&7>Keine Glocke"```
Yes. But what's wrong?
Any errors?
The only thing i can see is that there is should be fallback
what
- if <player.cursor_on_solid.material.name||null> == bedrock:
use debug: true if you're not sure where the problem is
OK
I can only make one "bell"
how can I make the script work at seperated locations?
- repeat 3:
- playsound <location[kapelleglocke_*]> sound:block_bell_use volume:20 sound_category:master
- wait 2
bellkapelle_command:
type: command
name: glockeankapelle
usage: /glockeankapelle
permission: team
debug: true
description: Bell define
script:
- if <player.cursor_on_solid.material.name||null> == bedrock:
- note <player.cursor_on_solid> as:kapelleglocke_<player.cursor_on>
- narrate "<gold>Gemmeria <&8>| <&7>Glocke der Kapelle erstellt"
- else:
- narrate "<gold>Gemmeria <&8>| <&7>Dass geht nur mit Bedrock!"```
would this work?
or woud be:
- note <player.cursor_on_solid.as_location.formatted>???
I would flag server with these locations
- flag server bell_locations:->:<player.cursor_on_solid>
And then foreach in event
But the Note would work aswll?
Yes, but this would require extra steps aka overengineering
For list of locations is better to use list
how can I then remove the flag?
u mean the whole flag or sindle location from this flag?
- flag server bell_locations:! for whole
- flag server bell_locations:<-:<[location]> for single