Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- word = ''
- def onValueChange(channel: Channel, sampleIndex, val, prev):
- guesser = []
- gate = False
- global word
- letter = ''
- if (
- op('null175')['h1:index_finger_tip:x'] > op('null175')['h1:middle_finger_tip:x']
- and 0.4 < op('null175')['h1:index_finger_tip:y'] <1
- and 0.4 < op('null175')['h1:middle_finger_tip:y'] <1
- and 0.4 < op('null175')['h1:ring_finger_tip:y'] <1
- and 0.4 < op('null175')['h1:pinky_tip:y'] <1
- and op('null175')['h1:index_finger_tip:x'] < op('null175')['h1:thumb_tip:x'] <1.2
- and op('null175')['h1:thumb_ip:y'] < op('null175')['h1:thumb_tip:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'a'
- if (
- op('null1')['h1:index_finger_tip:y'] > 1.2
- and 1.2 < op('null1')['h1:thumb_tip:x'] < 1.6
- and op('null1')['h1:thumb_tip:y'] > 0.8
- and op('null1')['h1:index_finger_tip:y'] > op('null1')['h1:index_finger_pip:y']
- and op('null1')['h1:middle_finger_tip:y'] > 1.2
- and op('null1')['h1:ring_finger_tip:y'] > 1.2
- and op('null1')['h1:pinky_tip:y'] > 1.2
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'b'
- if (
- op('null7')['h1:middle_finger_pip:y'] > op('null7')['h1:middle_finger_tip:y']
- and 0.85 < op('null7')['h1:middle_finger_tip:y'] < 1.4
- and 0.85 < op('null7')['h1:index_finger_tip:y'] < 1.4
- and 0.85 < op('null7')['h1:ring_finger_tip:y'] < 1.4
- and 0.85 < op('null7')['h1:pinky_tip:y'] < 1.4
- and 0.5 < op('null7')['h1:thumb_tip:y'] < 0.7
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'c'
- if (
- op('null13')['h1:middle_finger_pip:y'] > op('null13')['h1:middle_finger_tip:y']
- and op('null13')['h1:index_finger_tip:y'] > 1.4
- and op('null13')['h1:index_finger_dip:y'] < op('null13')['h1:index_finger_tip:y']
- and op('null13')['h1:middle_finger_tip:y'] < 0.9
- and op('null13')['h1:ring_finger_tip:y'] < 0.9
- and op('null13')['h1:pinky_tip:y'] < 0.9
- and 0.9 > op('null13')['h1:thumb_tip:y'] >0.5
- and 0.1 < op('null13')['h1:thumb_tip:x'] < 0.6
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'd'
- if (
- 0.8 < op('null23')['h1:index_finger_tip:y'] <1.1
- and 0.8 < op('null23')['h1:middle_finger_tip:y'] <1.1
- and 0.8 < op('null23')['h1:ring_finger_tip:y'] <1.1
- and 0.8 < op('null23')['h1:pinky_tip:y'] <1.1
- and op('null23')['h1:middle_finger_tip:x'] > op('null23')['h1:thumb_tip:x'] < 0.6
- and op('null23')['h1:index_finger_tip:y'] > op('null23')['h1:thumb_tip:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'e'
- if (
- op('null68')['h1:middle_finger_pip:y'] < op('null68')['h1:middle_finger_tip:y']
- and 0.5< op('null68')['h1:index_finger_tip:y'] < 0.9
- and op('null68')['h1:thumb_tip:x'] < 0.8
- and op('null68')['h1:middle_finger_tip:y'] > 1.2
- and op('null68')['h1:ring_finger_tip:y'] > 1.2
- and op('null68')['h1:pinky_tip:y'] > 1.2
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'f'
- if (
- op('null25')['h1:middle_finger_pip:x'] > op('null25')['h1:middle_finger_tip:x']
- and op('null25')['h1:middle_finger_tip:x'] < 0.6
- and op('null25')['h1:ring_finger_tip:x'] < 0.6
- and op('null25')['h1:pinky_tip:x'] < 0.6
- and op('null25')['h1:index_finger_tip:x'] <1.1
- and op('null25')['h1:pinky_pip:y'] < 0.7
- and op('null25')['h1:thumb_tip:x'] < 1
- and op('null25')['h1:pinky_tip:y'] < op('null25')['h1:ring_finger_tip:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'g'
- if (
- op('null30')['h1:ring_finger_pip:x'] > op('null30')['h1:ring_finger_tip:x']
- and op('null30')['h1:ring_finger_tip:x'] < 0.6
- and op('null30')['h1:pinky_tip:x'] < 0.6
- and op('null30')['h1:pinky_tip:y'] < op('null30')['h1:ring_finger_tip:y']
- and op('null30')['h1:pinky_pip:y'] < 0.7
- and op('null30')['h1:middle_finger_tip:x'] > 0.6
- and op('null30')['h1:index_finger_tip:x'] > 0.6
- and op('null30')['h1:index_finger_tip:y'] < 1.2
- and op('null30')['h1:thumb_tip:x'] < 1
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'h'
- if (
- op('null2')['h1:middle_finger_tip:y'] < 1
- and op('null2')['h1:ring_finger_tip:y'] < 1
- and op('null2')['h1:index_finger_tip:y'] < 1
- and op('null2')['h1:middle_finger_pip:y'] > op('null2')['h1:middle_finger_tip:y']
- and op('null2')['h1:pinky_tip:y'] > 1.3
- and 0.9 > op('null2')['h1:thumb_tip:y'] >0.5
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'i'
- if (
- op('merge1')['h1:pinky_tip:x']
- and op('merge1')['h1:pinky_tip:y']
- and op('merge1')['h1:pinky_tip:y']
- and op('merge1')['h1:pinky_tip:x'] >3.5
- and op('logic1')['kj']
- ): letter = 'j'
- if (
- op('null39')['h1:ring_finger_pip:y'] > op('null39')['h1:ring_finger_tip:y']
- and op('null39')['h1:ring_finger_tip:y'] < 0.7
- and op('null39')['h1:pinky_tip:y'] < 0.7
- and op('null39')['h1:middle_finger_tip:y'] > 0.7
- and op('null39')['h1:index_finger_tip:y'] >1.2
- and op('null39')['h1:thumb_tip:y'] > 0.85
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'k'
- if (
- op('null3')['h1:middle_finger_tip:y'] < 0.9
- and op('null3')['h1:ring_finger_tip:y'] < 0.9
- and op('null3')['h1:pinky_tip:y'] < 0.9
- and op('null3')['h1:middle_finger_pip:y'] > op('null3')['h1:middle_finger_tip:y']
- and op('null3')['h1:index_finger_tip:y'] > 1.4
- and 0.5 < op('null3')['h1:thumb_tip:x'] < 1.2
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'l'
- if (
- 0.7 < op('null52')['h1:index_finger_tip:y'] <1.1
- and 0.7 < op('null52')['h1:middle_finger_tip:y'] <1.1
- and 0.7 < op('null52')['h1:ring_finger_tip:y'] <1.1
- and op('null52')['h1:ring_finger_pip:y'] > op('null52')['h1:thumb_tip:y'] > op('null52')['h1:pinky_pip:y']
- and 0.5 < op('null52')['h1:pinky_tip:y'] < 1
- and op('null52')['h1:ring_finger_tip:x'] > op('null52')['h1:thumb_tip:x']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'm'
- if (
- 0.7 < op('null58')['h1:index_finger_tip:y'] <1.1
- and 0.7 < op('null58')['h1:middle_finger_tip:y'] <1.1
- and op('null58')['h1:ring_finger_tip:y'] < 1
- and op('null58')['h1:pinky_tip:y'] < 1
- and 0.2 < op('null58')['h1:thumb_tip:x'] < op('null58')['h1:middle_finger_tip:x']
- and op('null58')['h1:index_finger_tip:y'] < op('null58')['h1:thumb_tip:y']
- and op('null58')['h1:ring_finger_pip:y'] < op('null58')['h1:thumb_tip:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'n'
- if (
- 1.2 > op('null4')['h1:index_finger_tip:y'] > 0.8
- and 1.2 > op('null4')['h1:middle_finger_tip:y'] > 0.8
- and 1.2 > op('null4')['h1:ring_finger_tip:y'] > 0.8
- and 1.2 > op('null4')['h1:pinky_tip:y'] > 0.8
- and op('null4')['h1:middle_finger_pip:y'] > op('null4')['h1:middle_finger_tip:y']
- and 0.7 < op('null4')['h1:thumb_tip:y'] < 1
- and op('null4')['h1:thumb_tip:x'] > op('null4')['h1:middle_finger_tip:x']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'o'
- if (
- op('null69')['h1:ring_finger_pip:y'] < op('null69')['h1:ring_finger_tip:y']
- and op('null69')['h1:ring_finger_pip:y'] < 1
- and op('null69')['h1:pinky_pip:y'] < 1
- and op('null69')['h1:middle_finger_tip:y'] < 0.6
- and op('null69')['h1:index_finger_tip:y'] < 0.8
- and op('null69')['h1:thumb_tip:y'] < 1
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'p'
- if (
- op('null75')['h1:ring_finger_pip:y'] < op('null75')['h1:ring_finger_tip:y']
- and op('null75')['h1:ring_finger_pip:y'] < 1
- and op('null75')['h1:pinky_pip:y'] < 1
- and op('null75')['h1:middle_finger_tip:y'] > 0.7
- and op('null75')['h1:index_finger_tip:y'] < 0.6
- and op('null75')['h1:thumb_tip:y'] < 1
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'q'
- if (
- op('null81')['h1:ring_finger_pip:y'] > op('null81')['h1:ring_finger_tip:y']
- and op('null81')['h1:ring_finger_tip:y'] < 0.8
- and op('null81')['h1:pinky_tip:y'] < 0.8
- and op('null81')['h1:middle_finger_tip:y'] >1
- and op('null81')['h1:index_finger_tip:y'] >1.2
- and op('null81')['h1:thumb_tip:x'] < 0.6
- and op('null81')['h1:middle_finger_tip:x'] > op('null81')['h1:index_finger_tip:x']
- and op('null81')['h1:thumb_tip:y'] < op('null81')['h1:index_finger_mcp:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'r'
- if (
- 0.8 < op('null89')['h1:index_finger_tip:y'] <1.1
- and 0.8 < op('null89')['h1:middle_finger_tip:y'] <1.1
- and op('null89')['h1:pinky_tip:y'] < 1
- and op('null89')['h1:ring_finger_tip:y'] < 1
- and 0.7 > op('null89')['h1:thumb_tip:x'] > 0.2
- and op('null89')['h1:index_finger_tip:y'] < op('null89')['h1:thumb_tip:y'] < op('null89')['h1:pinky_pip:y']
- and op('null89')['h1:ring_finger_pip:y'] > op('null89')['h1:thumb_tip:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 's'
- if (
- 0.5 < op('null98')['h1:index_finger_tip:y'] <1.1
- and 0.5 < op('null98')['h1:middle_finger_tip:y'] <1.1
- and op('null98')['h1:ring_finger_tip:y'] < 1
- and op('null98')['h1:pinky_tip:y'] < 1
- and op('null98')['h1:index_finger_dip:x'] > op('null98')['h1:thumb_tip:x'] > 0.2
- and op('null98')['h1:index_finger_tip:y'] < op('null98')['h1:thumb_tip:y']
- and op('null98')['h1:middle_finger_pip:y'] < op('null98')['h1:thumb_tip:y']
- and op('null98')['h1:pinky_pip:y'] > 0.7
- and op('null98')['h1:thumb_ip:y'] < op('null98')['h1:thumb_tip:y']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 't'
- if (
- op('null106')['h1:ring_finger_pip:y'] > op('null106')['h1:ring_finger_tip:y']
- and op('null106')['h1:ring_finger_tip:y'] < 0.8
- and op('null106')['h1:pinky_tip:y'] < 0.8
- and op('null106')['h1:middle_finger_tip:y'] >1
- and op('null106')['h1:middle_finger_mcp:y'] > op('null106')['h1:thumb_tip:y']
- and op('null106')['h1:index_finger_tip:y'] >1.2
- and op('null106')['h1:thumb_tip:x'] < 0.5
- and 0.3 < op('null106')['h1:middle_finger_tip:x'] < op('null106')['h1:index_finger_tip:x']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'u'
- if (
- op('null114')['h1:ring_finger_pip:y'] > op('null114')['h1:ring_finger_tip:y']
- and op('null114')['h1:middle_finger_mcp:y'] > op('null114')['h1:thumb_tip:y']
- and op('null114')['h1:ring_finger_tip:y'] < 0.8
- and op('null114')['h1:pinky_tip:y']
- and op('null114')['h1:middle_finger_tip:y'] >1
- and op('null114')['h1:index_finger_tip:y'] >1.2
- and op('null114')['h1:thumb_tip:x'] < 0.5
- and op('null114')['h1:middle_finger_tip:x'] < op('null114')['h1:index_finger_tip:x']
- and op('null114')['h1:middle_finger_tip:x'] < 0.3
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'v'
- if (
- op('null124')['h1:ring_finger_pip:y'] < op('null124')['h1:ring_finger_tip:y']
- and op('null124')['h1:ring_finger_tip:y'] > 1
- and op('null124')['h1:pinky_tip:y'] < 0.8
- and op('null124')['h1:middle_finger_tip:y'] >1
- and op('null124')['h1:index_finger_tip:y'] >1.2
- and op('null124')['h1:thumb_tip:x'] < 0.6
- and op('null124')['h1:middle_finger_tip:x'] < op('null124')['h1:index_finger_tip:x']
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'w'
- if (
- op('null6')['h1:middle_finger_pip:y'] > op('null6')['h1:middle_finger_tip:y']
- and op('null6')['h1:middle_finger_tip:y'] < op('null6')['h1:index_finger_pip:y']
- and op('null6')['h1:pinky_pip:y'] > 0.7
- and op('null6')['h1:index_finger_dip:y'] > op('null6')['h1:index_finger_tip:y'] > 1
- and op('null6')['h1:middle_finger_tip:y'] < 0.9
- and op('null6')['h1:ring_finger_tip:y'] < 0.9
- and op('null6')['h1:pinky_tip:y'] < 0.9
- and 0.9 > op('null6')['h1:thumb_tip:y'] >0.5
- and op('null6')['h1:thumb_tip:x'] < 0.6
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'x'
- if (
- 0.4 < op('null9')['h1:index_finger_tip:y'] <0.9
- and 0.4 < op('null9')['h1:middle_finger_tip:y'] <0.9
- and 0.4 < op('null9')['h1:ring_finger_tip:y'] <0.9
- and op('null9')['h1:pinky_tip:y'] > 0.9
- and 0.7 < op('null9')['h1:thumb_tip:x'] <1.2
- and op('logic2')['kj'] == 1
- and op('logic4')['kz'] == 1
- ): letter = 'y'
- if (
- op('merge2')['h1:index_finger_tip:x']
- and op('merge2')['h1:index_finger_tip:y']
- and op('merge2')['h1:index_finger_tip:x']
- and op('merge2')['h1:index_finger_tip:y']
- and op('merge2')['h1:index_finger_tip:x']
- and op('merge2')['h1:index_finger_tip:y'] >5.5
- and op('logic3')['kz']
- ): letter = 'z'
- guesser.append(letter)
- if me.time.frame % (60) == 0:
- check = getMostFrequent(guesser)
- if check != False:
- word += getMostFrequent(guesser)
- guesser = []
- print(word)
- """
- print(letter)
- """
- return
- from functools import reduce
- def getMostFrequent(arr):
- hashmap = {}
- for value in arr:
- hashmap[value] = hashmap.get(value, 0) + 1
- return reduce(
- lambda a, b: a if hashmap[a] > hashmap[b] else b,
- hashmap
- )
Advertisement