Jump to content

primer

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by primer

  1. Is it possible to Send a keypress to an inactive window?
  2. this way works $newstr = "[" & $str1[0] $newstr2 = "[" & $str2[0] For $i = 1 to 64 $newstr = $newstr & "," & $str1[$i] $newstr2 = $newstr2 & "," & $str2[$i] Next $newstr = $newstr & "]" $newstr2 = $newstr2 & "]" MsgBox(0, '', $newstr, 1) $file = FileOpen("test.txt", 1) FileWrite($file, $newstr & @CRLF & $newstr2) FileClose($file)
  3. Hey guys, I have two Array variables that get assigned values, and then I would like to write all of the data in each array to a file (not just one array node at a time). So my question is how do I target the entire Array data instead of one particular node? For example: Do $ind = $ind + 1 $str1[$ind] = $someVar $str2[$ind] = $anotherVar While blahblah $file = FileOpen("test.txt", 1) FileWrite($file, $str1 + @CRLF + $str2) FileClose($file) doesn't write anything. I've tried $str1[], etc but I cant figure it out.
  4. im still a bit lost unfortunately
  5. not according to the documentation HotKeySet ( "key" [, "function"] ) Key - The key(s) to use as the hotkey. Same format as Send(). If you mean the function calls () then yea I goofed up on that. I understand my syntax knowledge is shaky with this language, but thats not what I'm asking for help with. I can read the documentation for that. I do not understand the... logic, i guess, to accomplishing this task in AutoIt
  6. not sure what i can do to convince you its not a keylogger. A keylogger seems like it would be more feasible because I wouldn't have to worry about timing and how long W,A,S or D are held down.
  7. i absolutely understand, but how much could I possibly record from 4 keys? also, i run into another problem. how would I record the time in between the key presses, when no key is pressed. i look more at the _IsPressed function and realized im doing it wrong. came up with this: HotKeySet("{W down}","wfunc()") HotKeySet("{S down}","sfunc()") HotKeySet("{A down}","afunc()") HotKeySet("{D down}","dfunc()") HotKeySet("{W up}","wfunc2()") HotKeySet("{S up}","sfunc2()") HotKeySet("{A up}","afunc2()") HotKeySet("{D up}","dfunc2()") Func wfunc() $wbegin = TimerInit() EndFunc Func wfunc2() $wdif = TimerDiff($wbegin) MsgBox(0, "W Key: " + $wdif/1000 + " seconds.", "W") EndFunc Func sfunc() $sbegin = TimerInit() EndFunc Func sfunc2() $sdif = TimerDiff($sbegin) MsgBox(0, "S Key: " + $sdif/1000 + " seconds.", "S") EndFunc Func afunc() $abegin = TimerInit() EndFunc Func afunc2() $adif = TimerDiff($abegin) MsgBox(0, "A Key: " + $adif/1000 + " seconds.", "A") EndFunc Func dfunc() $dbegin = TimerInit() EndFunc Func dfunc2() $ddif = TimerDiff($dbegin) MsgBox(0, "D Key: " + $ddif/1000 + " seconds.", "D") EndFunc
  8. ok, this is what im trying to do. i only need to record these four keys HotKeySet("{W}","wfunc()") HotKeySet("{S}","sfunc()") HotKeySet("{A}","afunc()") HotKeySet("{D}","dfunc()") Func wfunc() $begin = TimerInit() While _IsPressed("{w}","user32.dll") $dif = TimerDiff($begin) WEnd MsgBox(0, "W Key: " + $dif/1000 + " seconds.", "W") EndFunc Func sfunc() $begin = TimerInit() While _IsPressed("{s}","user32.dll") $dif = TimerDiff($begin) WEnd MsgBox(0, "S Key: " + $dif/1000 + " seconds.", "S") EndFunc Func afunc() $begin = TimerInit() While _IsPressed("{a}","user32.dll") $dif = TimerDiff($begin) WEnd MsgBox(0, "A Key: " + $dif/1000 + " seconds.", "A") EndFunc Func dfunc() $begin = TimerInit() While _IsPressed("{d}","user32.dll") $dif = TimerDiff($begin) WEnd MsgBox(0, "D Key: " + $dif/1000 + " seconds.", "D") EndFunc but it doesnt work
  9. for my personal use to automate a video game i could use a stop-watch to record how long i pres each key and then code it from there, but this way seems much easier and more precise
  10. this isnt for anything malicious or anything but is it possible to have an au3 script record how long i hold down which key and when, and then output it. Basically, i want it to simulate my exact key patterns and then duplicate them. it would have to be in the background while recording also, because i need to have focus on another window. is that possible?
×
×
  • Create New...