The cursor seems to go up when I want it to go down and down when I want it to go up, otherwise it seems to work.
x = (lx*8+(average(l3x)/800.0+0.5)*height)/9
x = (lx*8+(average(l3x)/(-800.0)+0.5)*height)/9