Advertisement
UmbertoKing

Untitled

Jan 22nd, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.83 KB | None | 0 0
  1.  
  2. if starting:
  3.  
  4.     import time
  5.     #from datetime import datetime
  6.     current_milli_time = lambda: int(round(time.time() * 1000000))
  7.     #current_milli_time = lambda: datetime.now().microsecond
  8.    
  9.     autoaim = True
  10.     lmousetime = 0
  11.     rmousetime = 0
  12.     rmouseshort = False
  13.     rmouseshortGlob = True
  14.     mmousetime = 0
  15.     perioddown = 0
  16.     periodpress = 0
  17.     periodkeep = False
  18.     periodtoggle = False
  19.     shiftT = False
  20.     shiftP = False
  21.     shiftK = 0
  22.     commadown = 0
  23.     commapress = 0
  24.     commadown = 0
  25.     commakeep = True
  26.     mdown = 0
  27.     mpress = 0
  28.     dpress = False
  29.     Glob = True
  30.     semi = False
  31.     semiW = False
  32.     aiming = False
  33.     press = 60
  34.     negPress = 60
  35.     press *= 1000
  36.     negPress *= 1000
  37.     longPress = press*3
  38.     mapon = False
  39.     prevd = 0
  40.     frameTime = current_milli_time();
  41.     deltaTime = 0
  42.     #--bench--
  43.     benchGlob = False
  44.     downSum = 0
  45.     downCount = 0
  46.     downAvg = 0
  47.     upSum = 0
  48.     upAvg = 0
  49.     testKey = Key.Comma
  50.     testKeyTime = 0
  51.     startBench = False
  52.  
  53. diagnostics.watch(keyboard.getKeyDown(Key.Return))
  54. diagnostics.watch(mouse.leftButton)
  55. diagnostics.watch(mouse.rightButton)
  56. diagnostics.watch(keyboard.getKeyDown(Key.Comma))
  57. diagnostics.watch(keyboard.getKeyDown(Key.Period))
  58. diagnostics.watch(keyboard.getKeyDown(Key.M))
  59. diagnostics.watch(semi)
  60. diagnostics.watch(deltaTime)
  61. diagnostics.watch(aiming)
  62. diagnostics.watch(periodtoggle)
  63. diagnostics.watch(commapress)
  64. diagnostics.watch(rmouseshort)
  65. diagnostics.watch(shiftT)
  66.    
  67. deltaTime = current_milli_time() - frameTime
  68. frameTime = current_milli_time()
  69.  
  70. #----------------------
  71.  
  72. if (mpress > 0 and mdown == 0): keyboard.setKeyDown(Key.M); mpress -= 1;
  73. if (periodpress > 0 and perioddown == 0): keyboard.setKeyDown(Key.Period); periodpress -= 1;
  74. if (commapress > 0 and commadown == 0): keyboard.setKeyDown(Key.Comma); keyboard.setKeyDown(Key.D1); commapress -= 1;
  75. #keyboard.setKeyDown(Key.D1);
  76.  
  77. lmousetime = lmousetime + deltaTime if mouse.leftButton else 0     
  78. rmousetime = rmousetime + deltaTime if mouse.rightButton else 0    
  79. mmousetime = mmousetime + deltaTime if mouse.middleButton else 0
  80.  
  81. perioddown = perioddown + deltaTime if (keyboard.getKeyDown(Key.Period) or perioddown < 0) and not periodkeep else 0
  82. commadown = commadown + deltaTime if (keyboard.getKeyDown(Key.Comma) or commadown < 0) and not commakeep else 0    
  83. mdown = mdown + deltaTime if keyboard.getKeyDown(Key.M) or mdown < 0  else 0
  84.  
  85. if perioddown > press: keyboard.setKeyUp(Key.Period); perioddown = -negPress;
  86. if commadown > press: keyboard.setKeyUp(Key.Comma); keyboard.setKeyUp(Key.D1); commadown = -negPress;
  87. #keyboard.setKeyUp(Key.D1);
  88. if mdown > press: keyboard.setKeyUp(Key.M); mdown = -negPress;
  89.  
  90. commakeep = False
  91. periodkeep = periodtoggle
  92.  
  93. #----------------------
  94.  
  95. if keyboard.getKeyDown(Key.PageDown):
  96.     Glob = False
  97. elif keyboard.getKeyDown(Key.PageUp):
  98.     Glob = True
  99.    
  100. if keyboard.getKeyDown(Key.End) or (mouse.wheelDown and not rmouseshortGlob):
  101.     #autoaim = False
  102.     semi = False
  103.     semiW = semi
  104. elif keyboard.getKeyDown(Key.Home) or (mouse.wheelUp and not rmouseshortGlob):
  105.     #autoaim = True
  106.     semi = True
  107.     semiW = semi
  108.  
  109. if keyboard.getKeyDown(Key.LeftShift):
  110.     if not shiftP:
  111.         shiftP = True
  112.         shiftT = not shiftT
  113. else:
  114.     shiftP = False
  115.    
  116. if keyboard.getKeyDown(Key.LeftControl):
  117.     shiftT = False
  118.  
  119. autoaim = False
  120.  
  121. if Glob:
  122.     if mmousetime > 0:
  123.         if not mapon:
  124.             mpress += deltaTime
  125.             mapon = True
  126.     elif mapon:
  127.         mpress += deltaTime
  128.         mapon = False
  129.        
  130.     if lmousetime > 0:
  131.         if commadown == 0: commapress = 1
  132.         if not semi: #or rmousetime > 0:
  133.             commakeep = True
  134.         if autoaim:
  135.             periodpress = 1
  136.             periodkeep = True
  137.    
  138.     if rmouseshortGlob:
  139.         if rmousetime > 0:
  140.             rmouseshort = True
  141.             if rmousetime > longPress:
  142.                 rmouseshort = False
  143.                 if commadown == 0: commapress = 1
  144.                 commakeep = True
  145.         elif rmouseshort:
  146.             rmouseshort = False
  147.             if True:
  148.                 #if rmousetime == 1:
  149.                 periodpress = 1
  150.                 periodtoggle = not periodtoggle
  151.             else:
  152.                 periodpress = 1
  153.                 periodkeep = True
  154.     else:
  155.         if rmousetime > 0:
  156.             if True:
  157.                 if rmousetime == deltaTime:
  158.                     periodpress = 1
  159.                     periodtoggle = not periodtoggle
  160.             else:
  161.                 periodpress = 1
  162.                 periodkeep = True  
  163.        
  164.    
  165.     if shiftT and not (lmousetime > 0 or rmousetime > 0):
  166.         keyboard.setKeyDown(Key.Slash)
  167.     else:
  168.         keyboard.setKeyUp(Key.Slash)
  169. else:
  170.     shiftT = False
  171.    
  172.     #if (rmousetime > 0 and rmousetime < 100) or keyboard.getKeyDown(Key.Z):
  173.         #keyboard.setKeyDown(Key.Slash)
  174.     #else:
  175.         #keyboard.setKeyUp(Key.Slash)
  176.  
  177. if benchGlob:
  178.     if keyboard.getKeyDown(testKey):
  179.         startBench = True
  180.     if startBench:
  181.         if keyboard.getKeyDown(testKey):
  182.             testKeyTime += deltaTime
  183.             if testKeyTime == deltaTime:
  184.                 downCount += 1
  185.             downSum += deltaTime
  186.         else:
  187.             testKeyTime = 0
  188.             upSum += deltaTime
  189.         downAvg = downSum / downCount
  190.         upAvg = upSum / downCount
  191.    
  192.     diagnostics.watch(downCount)
  193.     diagnostics.watch(downAvg/1000)
  194.     diagnostics.watch(upAvg/1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement