Jump to content

Fulano

Active Members
  • Posts

    312
  • Joined

  • Last visited

Everything posted by Fulano

  1. Just a side note: From the manual: So perhaps this would be better: (borrowing wrathdu's version):$file = FileOpen ("cdkeys.txt") FileReadLine ($file); eat the first line, as it appears to be skipped above For $i = 1 to 5 Assign("k" & $i, FileReadLine($file)) Next FileClose($file) For $i = 1 to 5 ConsoleWrite("k" & $i & " is: " & Eval("k" & $i)) Next
  2. Np, just takes a special kind of crazy
  3. Here's my take on it (I lifted everything but the regex from Melba ) $sText = '"Hello @visitor, last time you visited us, you were reading @page, what topic would you like to read about today"' $sNewtext = StringRegExpReplace($sText, "@([A-z0-9]+)", '" & $\1 & "') MsgBox(0, "Changed", $sNewtext)
  4. I'm sorry to took offence, I was merely pointing out that consistent use of good programming style should not be assumed when giving out help. Yes, all include files should have #include-once at the top for reasons which are obvious once the fledgling programmer learns the command exists, and that AutoIt doesn't handle that for them automatically like other languages (Python comes to mind). Unfortunately neither of these are a given when talking with someone new to the language (or programming in general). This is a really intolerant statement - should I tell my 1 year old to give up on any form of walking because she falls from time to time? Look at the code that some of the beginners post - it's very clear that they haven't ever taken even a beginning programming course. Give them some time, the ones that have good brains will clue in and become better and the others will get frustrated and leave. Or perhaps I should say, the ones with thick skins will stick around and the ones unwilling to put up with the abuse will move on to something less powerful, but with a less venomous community.
  5. Quite so, sorry about that.
  6. You'll want these two:Local $timer = TimerInit() ;Starts timer TimerDiff($timer); checks how many milliseconds since the timer started
  7. There's a sticky you should read.
  8. <rant>Please use code tags, they are your friends They make reading much easier, and the autoit tags will link keywords directly to the documentation. It just makes everyone's lives easier. Shellexecute("watchhdtvplay", "", "c:\documents and settings\desktop") Sleep(10) Controlclick("watchhdtvplay", "", "[class:button; text:open; instance:2]") He is my info from Info Tool Basic Window Info Title-Watchhdtvplay Class-#32770 Basic Control Info Class-Button Instance-2 Control Tab from Info Tool Class-Button Instance-2 Classnamenn-Button2 Advanced(Class)-Class:Button; Instance:2 ID-1000 Text-Open Pos-354,29 Size-54,20 Controlclick Coords-29,14 Style-0x0018000 Exstyle-0x00000004 Handle-0x00302ee</rant> It's possible that the documentation is just a bit more of a stickler for details, but you might be having a problem because of improper capitalization. Try this: Shellexecute("watchhdtvplay", "", "c:\documents and settings\desktop") WinWaitActive ('Watchhdtvplay'); Just demonstrating a different way of doing it, possibly faster, definitely more reliable Controlclick("Watchhdtvplay", "", "[class:Button; text:Open; instance:2"); capitalized to match output from Info Tool It might seem like cheating a little, but you can often just copy and paste the bit from the 'Advanced(Class)' line and be done with it (no typing - yay!).
  9. Once the Hotkey is unset the OS is free to do it's normal key repetition as it's no longer bound to AutoIt. At least that's what the behavior I observed while testing it seemed to indicate. Setting it to a dummy function was the best compromise I could come up with to block that key until the next send came due. It's a little erratic as sometimes the OS will get an extra one in between releasing the block and resetting it. It's kind of a weird behavior and certainly not what I expected, but it makes sense once you know it's there. Edit: Couldn't resist quoting your sig, '"In theory, theory and practice are the same. In practice, they are not."- Albert Einstein'
  10. I originally declined to answer because I didn't want to bother figuring out how to rig an autofire reaction without generating an endless loop of hotkeys calling themselves. However, I did end up running across something that will get you most of the way there. I redacted the code because it was pointed out (correctly) that it could have been easily modified into a keylogger.
  11. Interesting thing with that solution, it will continually send the key between the sent key presses. I don't know if that behavior will make any difference in this case or not, but on the off chance that it does, here's a version that will generally only repeat once or twice per interval (at the cost of complexity and an array lookup). Edit: I redacted the code, as it was (correctly) pointed out that it could have been used to make a keylogger, my apologies for the mistake.
  12. This is, of course, assuming that they were created in a thoughtful manner.
  13. I dunno: that seems like a pretty straightforward, even clever, way of doing it.
  14. Just thinking out loud, but wouldn't something like this be better than requesting the whole array:$fuu = InetGetInfo($download) / $sizeCompare2 * 100 if @error then ConsoleWrite ("Error in download: " & InetGetInfo ($download, 4) & @LF)
  15. Now that you mention it, I really should. Instead I have one file that I reuse over and over and over again. I think I like your way better.
  16. Well, it could be stored in the compiled exe, or it could be given as a master password by your friend. Depends on what you prefer.
  17. @jchd: I used FileInstall() to embark in the good ship 'settings.ini' on a long journey 'round the world.
  18. Also: please put your scripts in "autoit" tags, it makes it much easier to read.$sBase = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" $iEval = 1 $sSearch = "Fiery" While 1 $sUninst = "" $sDisplay = "" $sCurrent = RegEnumKey($sBase, $iEval) If @Error Then ExitLoop $sKey = $sBase & $sCurrent $sDisplay = RegRead($sKey, "DisplayName") If StringRegExp($sDisplay, "(?i).*" & $sSearch & ".*") Then $sUninst = RegRead($sKey, "UninstallString") If $sUninst Then Run($sUninst) WinwaitActive("Windows Installer") WinActive("Windows Installer") sleep(20) ControlClick("Windows Installer", "Are you sure you want to uninstall this product?", "Yes") EndIf EndIf $iEval += 1 WEnd
  19. Careful, as you have it, it'll end up in a (potentially) endless loop. User hits 'd' => triggers function 'e' => sends 'e' => triggers function 'r' ... Something like this would be marginally cleaner: HotKeySet("{SCROLLLOCK}","Toggle") Global $ON = False Global $KEYS_QUERTY [26] = ['a', 'b', 'c', 'd', 'e' ...] Global $KEYS_DVORAK [26] = ['a', 'x', 'j', 'e', 'r' ...] While 1 Sleep(100) WEnd Func Toggle() $ON=not($ON) if $ON Then For $index = 0 to 26 HotKeySet($KEYS_QUERTY[$index], 'SendDvorak') Next Else For $index = 0 to 26 HotKeySet($KEYS_QUERTY[$index]) Next EndIf EndFunc Func SendDvorak() Local $dvorak = $KEYS_DVORAK[Asc (@HotKeyPressed) - Asc ('a')] HotKeySet ($dvorak) Send ($dvorak) HotKeySet ($dvorak, 'SendDvorak') EndFunc Disclaimer: this is an example, the array that maps the keys is not complete, this will not compile.
  20. Well, if you have it set up already with leading zeros you can just do this: Local $stringDate = $day & '.' & $Month & '.' & $YearIf not you'll want to look at StringFormat()
  21. ::Laughs:: I didn't even notice!
  22. For the two buttons you'll want to start looking at the Send() command and the While looping structure. What kind of security warning?
  23. #include <IE.au3> $main = _IECreate ($news) _IELoadWait($main) $body1 = _IEBodyReadHTML($main) _IENavigate ($main, $otherpageonsamewebsite) _IELoadWait($main) $body2 = _IEBodyReadHTML($main) $changedhtml = "need help, you rule" To clarify, you are looking to do something like diff?
  24. Fixed: Fixed: Fixed (Not sure why, but this one seems to happen to me alot when posting my scripts to the forum - source code does not have this error): Fixed:
×
×
  • Create New...