There are three ways to write %n codes (with DisplayToClipboard), more information on this page: (B) Write your first cheap character code using %n/%f exploits!
;For general %n write data, we have the following format:
;If X is an unsigned char, that is, a byte,
;and Y is an address,
;then these codes will write X to address Y
;Where X and Y are both decimal
[State ]
Type = DisplayToClipboard
Trigger1 = 1
Text = "%Xu%hn"
Params = 1, Y
[state ]
type = DisplayToClipboard
trigger1 = 1
text = "%*d%hn%d"
params = X,0,Y
[state ]
type = DisplayToClipboard
trigger1 = 1
text = "%*d%n%d"
params = X,0,Y