#(Niklas) Finding the error

1 messages · Page 1 of 1 (latest)

opaque canyon
frosty oreBOT
#

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>

worldly summit
#

what exactly is the error you are trying to find?

small trout
#

oh god

#

on system time minutely every:15

opaque canyon
small trout
#

This is represents your code

small trout
opaque canyon
#

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

opaque canyon
small trout
opaque canyon
#

how?

tight crescent
#

!lang data script

silk badgerBOT
# tight crescent !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

tight crescent
#

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?

opaque canyon
#

no not realy

tight crescent
#

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

silk badgerBOT
# tight crescent !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
opaque canyon
#

ok well...

tight crescent
#

note the available tags

#

!t element.div

silk badgerBOT
opaque canyon
#

the event works but the location is cursed

#

the note

tight crescent
#

!t element.round

silk badgerBOT
tight crescent
#

Could we please stay on topic

opaque canyon
#

ok ok sorry

tight crescent
#

Can we work on merging your events first

opaque canyon
#

ok

tight crescent
#

great

opaque canyon
#

But I have never worked with data keys

tight crescent
#

you don't need data keys

#

we write a formula

#

y'know, simple math and stuff

opaque canyon
#

what do I even need to type in the Type: xyz thing?

#

is it still world

tight crescent
#

yeah

#

that's a world script container

#

it's for events

#

so your script fires every 15 minutes right?

opaque canyon
#

yeah

tight crescent
#

!event system time

silk badgerBOT
# tight crescent !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
tight crescent
#

Do you see a switch here that could be possible helpful for you?

opaque canyon
#
    type: world
    events:
        on system time minutely:15:```
tight crescent
#

exactly!

#

not really

#

but you've got it

#

minutely is part of the event label

#

the switch is called every

opaque canyon
#

ah on system time minutely every:15:

tight crescent
#

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

opaque canyon
#

we could take the <context.hour> and devide it by 4?

tight crescent
#

do you mean minute?

opaque canyon
#

uhm hm

tight crescent
#

15 divided by what is 1?

#

30 divided by what is 2?

opaque canyon
#

oh by 15 xD

tight crescent
#

yeaah

#

!t element.div

silk badgerBOT
tight crescent
#

!t element.round

silk badgerBOT
tight crescent
#

you might need round, incase the system time event fires at the wrong minute

#

ie: 14 or / 16

opaque canyon
#

ok. Now I need an if dont I?

tight crescent
#

can you explain me why you think you need an if?

opaque canyon
#

to check if the output matches 1 / 2 / 3 / 4

tight crescent
#

that's round is for

#

can you share the script after you included the logic

opaque canyon
#

well I have no clue what I need to add now...

tight crescent
#

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

tight crescent
#

also you already know the tag that returns the current minute

#

!t element.div

silk badgerBOT
tight crescent
#

that tag divides something by something

#

!t element.round

silk badgerBOT
tight crescent
#

and this tag rounds a number

opaque canyon
#

I have absolutely no clue

#

do I need a repeat here?

tight crescent
#

yeah

opaque canyon
#
    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.

small trout
#

Should i give you complete code?
Or it's better for you to figure out by yourself?

small trout
#

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

opaque canyon
#

the event isnt the problem... the targets isnt working....

small trout
#

Yeah. We're here love to solve unexisting problems

#

Isn't working how?
I see you're noting location by command

#

wth is this

opaque canyon
#

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"```
small trout
#

Yes. But what's wrong?
Any errors?

#

The only thing i can see is that there is should be fallback

opaque canyon
#

what

small trout
#

- if <player.cursor_on_solid.material.name||null> == bedrock:

#

use debug: true if you're not sure where the problem is

opaque canyon
#

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>???
small trout
#

I would flag server with these locations
- flag server bell_locations:->:<player.cursor_on_solid>
And then foreach in event

opaque canyon
#

But the Note would work aswll?

small trout
#

For list of locations is better to use list

opaque canyon
timber laurel
#

didnt i give you an example with flagging it 2 weeks ago?

#

why didnt u use it

small trout