The same for one check: on alert level 10 "Reach":
on alert level 10 "Reach":
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% has 10 Reach violations" to loop-player
structureon alert "<check>":HyperGrimexample
The same for one check only, by the name Grim gives it: "Reach", "Simulation", "BadPacketsA"
on alert "Reach":
log "%player.name% failed Reach (%{_violations}% so far): %{_verbose}%"
eventon grim flag:HyperGrimexample
Another way of writing on alert:; both run
on grim flag:
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% &7was flagged for &f%{_check}%" to loop-player
What this event gives a script
In the block
What it is
{_check}
The name of the check
{_violations}
How many violations of it the player has by now
{_verbose}
What Grim noted about this one (often empty)
{_description}
What the check is for. In on grim punish: there is
{_command}
As well
eventon grim punish:HyperGrimexample
Runs when Grim carries out one of the commands its punishments are made of
on grim punish:
log "Grim ran for %player.name%: %{_command}%"
What this event gives a script
In the block
What it is
{_check}
The name of the check
{_violations}
How many violations of it the player has by now
{_verbose}
What Grim noted about this one (often empty)
{_description}
What the check is for. In on grim punish: there is
{_command}
As well
Guide and examples
on alert:
add 1 to {%player%.warns}
if {%player%.warns} > 10:
ban player for 7 days because "&cCheating (automatic ban)"
on alert "Reach":
log "%player.name% failed Reach (%{_violations}% so far): %{_verbose}%"
on grim flag:
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% &7was flagged for &f%{_check}%" to loop-player
on grim punish:
log "Grim ran for %player.name%: %{_command}%"
Syntax
Effect
on alert:
Runs every time Grim flags a player: each time one of its checks fails. player is who was flagged
on alert level <n>:
Runs once when the violations of a check reach that number, whichever check it is: on alert level 10:. It needs a number
on alert level <n> "<check>":
The same for one check: on alert level 10 "Reach":
on alert "<check>":
The same for one check only, by the name Grim gives it: "Reach", "Simulation", "BadPacketsA"
on grim flag:
Another way of writing on alert:; both run
on grim punish:
Runs when Grim carries out one of the commands its punishments are made of
Inside the blocks {_check} is the name of the check, {_violations} how many violations of it the player has by now, {_verbose} what Grim noted about this one (often empty), and {_description} what the check is for. In on grim punish: there is {_command} as well.
on alert level 10: saves the counting: it runs the one time a player's violations of a check get to 10, and again only if they fall and climb back. The values inside are the same as in on alert:.
on alert level 10 "Reach":
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% has 10 Reach violations" to loop-player
on alert level 25:
kick player because "&cToo many violations of %{_check}%"
Grim flags often. One player who is cheating can set on alert: off many times a second, and an honest one on a bad connection sets it off now and then. Count before you act, as the example does, and let the count fade:
on alert:
add 1 to {%player%.warns}
every 5 minutes for all players:
if {%player%.warns} > 0:
subtract 1 from {%player%.warns}
The blocks run a moment after the flag, on the server's own thread, so a script cannot stop the flag itself or what Grim does about it; Grim's own punishments.yml is where that is set. If the player has left by then, the block does not run.