Skip to content

ontimer block seems to break with expressions #104

Closed
@FAReTek1

Description

@FAReTek1

When using the ontimer keyword, it works so long as the input is only a literal value or a variable. However, once I place a + sign, the code compiles incorrectly.

Here is some sample code. it simply takes an input and waits for that long - 5 seconds using the timer functionality of scratch.

costumes "blank.svg";

onflag {
    time = "Infinity";
    ask "wait how long?";
    time = answer();
    reset_timer;
}

ontimer > time - 5 {
    say "beep! timer finished!", 2;
    think "...i pre-emptively beeped 5 seconds early..hehe";
}

However, when opening in turbowarp, the ontimer script is nowhere to be seen.

Upon inspecting the project.json file, i am greeted by the subtract block and the 'whengreaterthan' blocks having the same block ID.

Image

That seems to be what causes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions