{=():}
{=(roleA):111111111111111111}
{=(roleB):222222222222222222}
{=(roleC):333333333333333333}
{=(roleD):444444444444444444}
{=(roleE):555555555555555555}
{=(noTarget):{contains({user(id)}):{target(id)}}}
{=(targetRoles):{{if(false=={noTarget}):target(roleids)}}}
{=(role):{roleA} {roleB} {roleC} {roleD} {roleE}}
{=(checkRoles):{contains({roleA}):{targetRoles}} {contains({roleB}):{targetRoles}} {contains({roleC}):{targetRoles}} {contains({roleD}):{targetRoles}} {contains({roleE}):{targetRoles}}}
{=(Current):{m:trunc({index(true):{checkRoles}}+1)}}
{=(Next):{m:trunc({index(true):{checkRoles}}+2)}}
{=(roleCountCheck):{if(2>{index(&£):{replace(false,):{checkRoles}} &£}):true|false}}
{=(First):{if(0=={Current}):true|false}}
{=(Maxed):{if(5=={Current}):true|false}}
{=($cmdFirst):c:role add {target(id)} {roleA}}
{=($cmdNext):c:role c {target(id)} +{role({Next})} -{role({Current})}}
{=(checks):{in(false true false):{noTarget} {roleCountCheck} {Maxed}}}
{{{if(true=={checks}):$cmd{if(true=={First}):First|Next}}}}
{=(error.Target):You need to mention a user.}
{=(error.RoleCount):That user has more than 1 tier, someone will need to manually fix their roles.}
{=(error.Maxed):That user is already Max tier. They cannot be promomoted.}
{=(error.Other):an unknown error has occured.}
{{if(false=={checks}):error.{if(true=={noTarget}):Target|{if(false=={roleCountCheck}):RoleCount|{if(true=={Maxed}):Maxed|Other}}}}}