Jump to content

somdcomputerguy

Active Members
  • Posts

    2,813
  • Joined

  • Last visited

  • Days Won

    5

somdcomputerguy last won the day on July 14 2014

somdcomputerguy had the most liked content!

About somdcomputerguy

  • Birthday 10/04/1967

Profile Information

  • Member Title
  • Location
    West Virginia
  • WWW
    http://somdcomputerguy.com

Recent Profile Visitors

971 profile views

somdcomputerguy's Achievements

  1. The Restart UDF is constantly called if the script is compiled and run. I had no actual need to check if the script is compiled or not, I was just curious. One thing I did try was to also add the If and the macro to the line where that variable is used. I added it to line 61 but I guess an If..Then statement can't be used in order to declare a Case. Thanks though.
  2. I wrote a script that runs just fine, but if I compile it, it generates this error: The code can be seen in full here - AutoGAT++, but I can post the script here if need be. I have troubleshot it down to line 35 of the script. If the line reads as Local $idRest = TrayCreateItem("Restart", $idAG) the script, compiled or not, runs just fine. However, if the line reads as If Not @Compiled Then Local $idRest = TrayCreateItem("Restart", $idAG) the compiled script when run will generate that error window. So I guess I just want to know why it errors if I modify that line with that macro and an If statement, and only the compiled version. Oh cheese & crackers, I just figured it out and I feel like a dimwit. I guess variables do need to declared before they're used.. Minutes & minutes of my life have been spent making sure this post is formatted correctly so I don't want to erase all this text. At the very least, this post might make one or many chuckle.
  3. https://www.autoitscript.com/forum/search/?q=FF.au3&quick=1
  4. It may have been a typo, and this is what is being referred to Whether my guess is right or wrong, I can logically and definitively say to tommytx123 that if you don't try it, it won't work..
  5. I posted an example here that doesn't work.
  6. Study in the documentation arrays and the For..Next loop.
  7. I realize the quote is from a 3 year old post, and this post may not be needed or necessary, but.. I wrote an AutoIt script to assist me with my KeePass use, At first, I was using Send() to, send, the intended hot-keys, but I quickly was only using that function to send an ALT-TAB sequence to 'switch' back to my browser, and instead I used ShellExecute() to, run, the intended KeePass function. I am currently using the below code, because I added more functionality to the script, but it's basically the same code as I posted here. https://pastebin.com/BxVR6WFp
  8. I wrote this script to use with KeePass, a password manager that I have used for almost forever. This script isn't meant to replace the hot-keys, but to just provide another way to execute them. I'm sure there are at least a few other users of this password manager, and this script is really small and it shouldn't be hard to understand, so feel free to use it and ask any questions about it. Oh, I start this script with a trigger in KeePass. Opt("TrayMenuMode", 3) Local $SleepTime = 100 Local $helpURL = "https://keepass.info/help/base/index.html" Local $KeePass[2] = ["C:\Program Files\KeePass Password Safe 2\", "KeePass.exe"] Local $AutoType[3] = ["-auto-type", "-auto-type-password", "-auto-type-selected"] Local $idKP = TrayCreateItem("KeePass") Local $idKPH = TrayCreateItem("KeePass Help") TrayCreateItem("") Local $idAT = TrayCreateItem("AutoType Selected") Local $idGAT = TrayCreateItem("Global AutoType") Local $idGATP = TrayCreateItem("Global PassWord") TrayCreateItem("") Local $idExit = TrayCreateItem("Exit") If $CmdLine[0] > 1 Then For $i = 1 to $CmdLine[0] Switch $CmdLine[$i] Case '-delay' $SleepTime = $CmdLine[$i + 1] Case '-path' $KeePass[0] = $CmdLine[$i + 1] Case '-name' $KeePass[1] = $CmdLine[$i + 1] EndSwitch Next EndIf TraySetState(1) TraySetIcon(@ScriptDir & '\AutoGAT.ico') While 1 If Not ProcessExists($KeePass[1]) Then ExitLoop ;leaves this While loop if KeePass exits or isn't running Switch TrayGetMsg() Case $idExit Exit Case $idKP ShellExecute($KeePass[0] & $KeePass[1]) Case $idKPH ShellExecute($helpURL) Case $idAT Send("!{TAB}") Sleep($SleepTime) ShellExecute($KeePass[0] & $KeePass[1], $AutoType[2]) Case $idGAT Send("!{TAB}") Sleep($SleepTime) ShellExecute($KeePass[0] & $KeePass[1], $AutoType[0]) Case $idGATP Send("!{TAB}") Sleep($SleepTime) ShellExecute($KeePass[0] & $KeePass[1], $AutoType[1]) EndSwitch WEnd Exit
  9. I use and have used this UDF successfully in a few of my scripts - http://www.autoitscript.com/wiki/AutoIt_Snippets#IsInternetConnected Thanks guinness.
  10. This bit of code may help. In it I use the _IsArray funtion. I do exit the script if the If is true, but you can do anything else that you want.. $Link = _StringBetween(ClipGet(), 'u=', '') If NOT IsArray($Link) Then MsgBox(48 + 4096, '', 'No User Link!') Exit EndIf
  11. Ya, $Spammer[] I chose that variable name since I use the script to get info from another forum that I moderate. That way I don't have to clip/paste all the necessary info individually, which takes quite a long time. BTW, you don't need to quote any or all of my post(s), I know what I have written. Although a partial quote may help someone else know what you are replying about, but again it's not really necessary.
  12. This a bit of code that I use in a script of mine. Now if any or all of the fourth field(s) and beyond are blank, the script continues. It doesn't exit. Note that I am using some of the _IE* functions.. $oForm = _IEFormGetObjByName($oIE, "cpform") $Spammer[0] = _IEFormElementGetObjByName($oForm, "user[username]") $Spammer[0] = _IEFormElementGetValue($Spammer[0]) $Spammer[1] = _IEFormElementGetObjByName($oForm, "user[email]") $Spammer[1] = _IEFormElementGetValue($Spammer[1]) $Spammer[2] = _IEFormElementGetObjByName($oForm, "user[ipaddress]") $Spammer[2] = _IEFormElementGetValue($Spammer[2]) $Spammer[3] = _IEFormElementGetObjByName($oForm, "user[homepage]") $Spammer[3] = _IEFormElementGetValue($Spammer[3]) $Spammer[4] = _IEFormElementGetObjByName($oForm, "profile[field1]") ;Biography $Spammer[4] = _IEFormElementGetValue($Spammer[4]) $Spammer[5] = _IEFormElementGetObjByName($oForm, "profile[field2]") ;Location $Spammer[5] = _IEFormElementGetValue($Spammer[5]) $Spammer[6] = _IEFormElementGetObjByName($oForm, "profile[field3]") ;Interests $Spammer[6] = _IEFormElementGetValue($Spammer[6]) $Spammer[7] = _IEFormElementGetObjByName($oForm, "profile[field4]") ;Occupation $Spammer[7] = _IEFormElementGetValue($Spammer[7])This is a bit of code from another script that I have written. Note that it uses the native Inet function '_INetGetSource'. If any of the array elements don't exist, the script does not quit. I don't know if either of these 'code bits' will help you, but good luck with your project! Global $Banyan_Calico[5] = ["Registering", "Activating", "Modifying", "Viewing User Profile", "Viewing User Control Panel"], $Quatrain While 1 Local $Source = _INetGetSource("http://forum.powweb.com/online.php?who=members") If StringInStr($Source, "The server is too busy at the moment.") <> 0 Then MsgBox(48 + 4096, "Oh No!!", "Busy server.", 3) ;If text does exist For $a = 0 To UBound($Banyan_Calico) - 1 If StringInStr($Source, $Banyan_Calico[$a], 1) <> 0 Then ;If text does exist SoundPlay(@ScriptDir & "\foghorn.mp3") MsgBox(48 + 4096, @ScriptName, $Banyan_Calico[$a], 3) Whoson() EndIf Next TraySetIcon("hourglass.ico") Timer() WEnd
  13. I know there is runnable example code in the Help file for these functions. They would demonstrate better than I could. Good luck with your project.
×
×
  • Create New...