oh, sorry about it, here is teh code for alll the buttons.
;____________________________
;
;[E] reading a button
;____________________________
;notes
;the buttons count up to 15 ticks, when they are being pressed,
;if released they get set to0
;there are 7 buttons so that makes it 7 - 4 bits groups
;
;
;this is the base code
;
;increase the counter
;[State -2, read a button]
;type = varSet
;trigger1 = ((var(17)&(((2**(N))*15)/2**(N))) < 15); && command = "hold_a"
;var(17) = (var(17)&(var(17)& ((2**32)-1)-(((2**(N))*15))))+( (var(17)&(((2**(N))*15))) + (1*(2**(N))) )
;ignorehitpause = 0
; reset the counter
;[State -2, not read a button]
;type = varSet
;trigger1 = command != "hold_a" && command != "a"
;var(17) = (var(17)&(var(17)& ((2**32)-1)-(((2**(N))*15))))
;ignorehitpause = 0
;
;
;
;
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&15) < 15
var(17) = (var(17)&(var(17)& ((2**32)-1)-15))+((var(17)&15)+1)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_a" && command != "a"
var(17) = (var(17)&(var(17)& ((2**32)-1)-(15)))
ignorehitpause = 0
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&240) < 240
var(17) = (var(17)&(var(17)& ((2**32)-1)-240))+((var(17)&240)+16)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_b" && command != "b"
var(17) = (var(17)&(var(17)& ((2**32)-1)-240))
ignorehitpause = 0
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&3840) < 3840
var(17) = (var(17)&(var(17)& ((2**32)-1)-3840))+((var(17)&3840)+256)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_c" && command != "c"
var(17) = (var(17)&(var(17)& ((2**32)-1)-3840))
ignorehitpause = 0
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&61440) < 61440
var(17) = (var(17)&(var(17)& ((2**32)-1)-61440))+((var(17)&61440)+4096)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_x" && command != "x"
var(17) = (var(17)&(var(17)& ((2**32)-1)-61440))
ignorehitpause = 0
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&983040) < 983040
var(17) = (var(17)&(var(17)& ((2**32)-1)-983040))+((var(17)&983040)+65536)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_y" && command != "y"
var(17) = (var(17)&(var(17)& ((2**32)-1)-983040))
ignorehitpause = 0
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&15728640) < 15728640
var(17) = (var(17)&(var(17)& ((2**32)-1)-15728640))+((var(17)&15728640)+1048576)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_z" && command != "z"
var(17) = (var(17)&(var(17)& ((2**32)-1)-15728640))
ignorehitpause = 0
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&251658240) < 251658240
var(17) = (var(17)&(var(17)& ((2**32)-1)-251658240))+((var(17)&251658240)+16777216)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_s" && command != "s"
var(17) = (var(17)&(var(17)& ((2**32)-1)-251658240))
ignorehitpause = 0