Event as Trigger

Trouble with if statements in standard Gcode Scripts

Need tool No from event.toolchange.new as a trigger for certain gcode commands from within standard gcode scripts (after Toolchange)

{% if toolchange.new() equals 0 %}
M280 P0 S2500
{% endif %

Does not work - nor any other attempt to to use actual T- number als trigger in if statement.

Could use toolchange.new as an event in yaml to trigger python script changing "after toolchange" script file. But "after toolchange" script is only loaded once octoprint is started so this won´t help.

Not sure I completely understand the question, but looking at this snippet, the word equals is not correct. The templates are Jinja2, so you can use ==.