Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/14/2019 in all areas

  1. Time spent on learning the language and further use is hundreds of times more expensive. It takes me 3 days to work to buy PureBasic, but studying and addictive will take several months. It is more difficult to pay, as it is necessary to register on PayPal. I do not think that it is necessary to make an AutoIt3 shell for PureBasic. It is better to make a table of function analogs in order to understand with the help of which function you can do the same things. I for example know the name of the function "Sleep", but I can not find its equivalent in the PureBasic help file, because the name is different.
    3 points
  2. zPlayer is the name I used when I introduced the early version of this player in my blog back in early 2009 and, therefore, has nothing to do with the mobile media player of the same name which started marketing in 2015. After I retired from active duty in 2002 I spent much time listening to music. First I started with CD's and LP's, then quickly moved on to mp3 files. I converted many of my CD's to mp3 and I collected many more from various sources which were freely available at the time. As the number of my mp3 files grew, I put them in folders according to their genres and my favorite classifications. I mainly used Windows Media Player to listen to them and I slowly began to dislike wmp because it had massive user interface while I just wanted to listen to music in the background while I was doing other work in the foreground, hopping between folders from time to time. It was the time I was beginning to learn AutoIt and I thought I should make my own player with AutoIt. Coming from a sales career with no experience in programming, it was not an easy task. Somehow, after about 2 years of learning and trying, I had my own audio player which worked with only hotkeys without any graphical interface. I gave it to some of my friends who were not as computer-savvy as I. They liked it but definitely wanted something to clcik with mouse. So I came up with very rude gui which took a form similar to what it is now. The attached source files include one au3 file, one icon file and 14 jpg files. The jpg files are used for drawing a graphical player and are fileinstalled in @DocumentsCommonDir folder. This player uses WMPlayer.OCX as its engine and supports all audio file formats supported by wmp and additional codecs installed. I would like to thank many forum members for kind answers to my questions and would appreciate it if anyone could review the code and give me any suggestion. This player works for me, but I don't know whether the code is presentable as an example. I am posting this here with a hope to learn much from AutoIt community. Edit: August 4, 2020: Video function was added. July 23, 2023: 1. Changed playback engine from IE-embdded WMPlayer.ocx to Winmm.dll. 2. Further reduced main GUI to bare minimum. 3. Eliminated fileinstalls. Media control icon files were replaced with unicode characters Please see Downloads section of this forum for the latest version of this player.
    2 points
  3. ; ;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED $FromName = "Name" ; name from who the email was sent $FromAddress = "your@Email.Address.com" ; address from where the mail should come $ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed $BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "******" ; username for the account used from where the mail gets sent - REQUIRED $Password = "********" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS $tls = 0 ; enables/disables TLS when required ;~ $SmtpServer = "smtp.gmail.com" ; GMAIL address for the smtp-server to use - REQUIRED ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAIL enables/disables secure socket layer sending - put to 1 if using https ;~ $SmtpServer = "smtp.office365.com" ; O365 address for the smtp-server to use - REQUIRED ;~ $IPPort=25 ; O365 port used for sending the mail ;~ $ssl=1 ; O365 enables/disables secure socket layer sending - put to 1 if using https ;~ SmtpServer = "smtp.mail.yahoo.com" ; Yahoo address for the smtp-server to use - REQUIRED ;~ $IPPort = 465 ; Yahoo port used for sending the mail ;~ $ssl = 1 ; Yahoo enables/disables secure socket layer sending - put to 1 if using https ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl, $tls) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0, $tls = 0) Local $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf ; Set security params If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True If $tls Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc Edit: Fixed Bcc ... Edit: Added support for different port and SLL which are used by GMail (Port 465) Edit: Added Importance support (10/2008) EDIT: Added $TLS option (07/2020 Some interesting Info from the thread:
    1 point
  4. water

    OutlookEX

    Version 1.7.0.1

    10,054 downloads

    Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None
    1 point
  5. When I see someone asking for help and doesn't make the effort of making it understandable, I truly fell bad for you. In any case, if you want some help (from me at least) I strongly suggest you make a runable script that we can use.
    1 point
  6. i just meant we needed to get him a better paying job, lol but yeah, the list would be nice. for me, it's not hard to pick up another language when you already know a few really well. but i did cut my teeth on Color Basic that shipped with my Tandy coco, then onto C, Java, and on from there. It's a lot of the same stuff really.
    1 point
  7. @yyywww Something like this? #include <Array.au3> #include <Inet.au3> #include <StringConstants.au3> Global $strUrl = "https://deadline.com/", _ $strHTML = "", _ $arrResult $strHTML = _INetGetSource($strURL, True) $arrResult = StringRegExp($strHTML, '(?s)<h2 class="post-title">(.*?)<p class="post-author-time">', $STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($arrResult)
    1 point
  8. mLipok

    Log UDF

    Added to: https://www.autoitscript.com/wiki/User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging
    1 point
  9. I thought that @LarsJ did it as a standard code, it's just a matter of perceiving the standard.
    1 point
  10. sorry I forgot to remove one of the commands #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") Local Const $Q_KEY = "51" Local Const $LMOUSE = "01" While (1) If _IsPressed($LMOUSE, $hDLL) Or _IsPressed($Q_KEY, $hDLL) Then If Not _IsPressed($LMOUSE, $hDLL) Then MouseDown("Left") Do Sleep(100) Until Not _IsPressed($Q_KEY, $hDLL) MouseUp("Left") Else ;Mouse is down Do Sleep(100) If _IsPressed($Q_KEY, $hDLL) Then MouseUp("Left") Sleep(200) MouseDown("Left") Do Sleep(100) Until Not _IsPressed($Q_KEY, $hDLL) EndIf Until Not (_IsPressed($LMOUSE, $hDLL) Or _IsPressed($Q_KEY, $hDLL)) EndIf EndIf Sleep(50) WEnd
    1 point
  11. You leave it stuck in the loop lets separate it into two code paths #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") Local Const $Q_KEY = "51" Local Const $LMOUSE = "01" While (1) If _IsPressed($LMOUSE, $hDLL) Or _IsPressed($Q_KEY, $hDLL) Then If Not _IsPressed($LMOUSE, $hDLL) Then MouseDown("Left") Do Sleep(100) Until Not (_IsPressed($LMOUSE, $hDLL) Or _IsPressed($Q_KEY, $hDLL)) MouseUp("Left") Else ;Mouse is down Do Sleep(100) If _IsPressed($Q_KEY, $hDLL) Then MouseUp("Left") Sleep(200) MouseDown("Left") Do Sleep(100) Until Not _IsPressed($Q_KEY, $hDLL) EndIf Until Not (_IsPressed($LMOUSE, $hDLL) Or _IsPressed($Q_KEY, $hDLL)) EndIf EndIf Sleep(50) WEnd
    1 point
  12. If it hasn't been a problem for you. It most likely not an issue and there is nothing to worry about. If a key ever gets stuck wrap your Send() calls with a SendEx() call, just copy SendEx() from the Internet and use SendEx($string) instead of Send($string). I wouldn't bother though, not if, keys aren't getting stuck. I'm almost sorry I said anything. There's no need to fix it if it isn't broken.
    1 point
  13. @Xandy, Thank you. I corrected the error and uploaded the new file a minute ago. Thanks for your comment.
    1 point
  14. For one you will need to make it either a CTRL + Letter combo or maybe an un-used F - key otherwise youll be screwing up all kinds of documents 2. you are calling mouse down repeatedly #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") Local Const $F7 = "76" While (1) If _IsPressed($F7, $hDLL) Then If _IsChecked() Then MouseDown("Left") Do Sleep(100) Until Not _IsPressed($F7, $hDLL) MouseUp("Left") EndIf EndIf Sleep(50) WEnd Func _IsChecked() Return True EndFunc ;==>_IsChecked With LCTRL + S #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") Local Const $S_KEY = "53" Local Const $LCTRL = "A2" While (1) If _IsPressed($LCTRL, $hDLL) AND _IsPressed($S_KEY, $hDLL) Then If _IsChecked() Then MouseDown("Left") Do Sleep(100) Until Not (_IsPressed($LCTRL, $hDLL) AND _IsPressed($S_KEY, $hDLL)) MouseUp("Left") EndIf EndIf Sleep(50) WEnd Func _IsChecked() Return True EndFunc ;==>_IsChecked
    1 point
  15. 1 point
  16. G'day everyone The help file for "If...Then" states that: "The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed." ...but it doesn't give examples of how this could be accomplished. The following does not work for me: $format = InputBox ( "Which image format do you want?", "Which image format do you want? Valid options are: JPG, BMP, GIF, PNG and TIF.", "JPG") If [something] Then MsgBox (0, "", "Sorry, that is not valid format.", 0) Else MsgBox (0, "", "Sorry, the programmer screwed up...", 0) EndIf I've tried the following [something]: ($format NOT "JPG") AND ($format NOT "BMP") AND ($format NOT "GIF") AND ($format NOT "PNG") AND ($format NOT "TIF") $format (NOT "JPG") AND (NOT "BMP") AND (NOT "GIF") AND (NOT "PNG") AND (NOT "TIF") $format = (NOT "JPG") AND (NOT "BMP") AND (NOT "GIF") AND (NOT "PNG") AND (NOT "TIF") $format = (NOT "JPG" AND NOT "BMP" AND NOT "GIF" AND NOT "PNG" AND NOT "TIF") The first two throws me an error. The second two tells me that the programmer screwed up. What I want is to be dol that the format is invalid (see Autoit code above). Obviously I'm doing something wrong here. Can anyone tell me what the correct syntax would be? Thanks Samuel
    1 point
  17. As Tvern posted, Switch/Case/EndSwitch is a much better choice for the function. But to address the compare logic: The NOT operator is simple boolean negation. And NOT is first operator in the order of operations, so be careful with it. ($format = NOT "JPG") will first perform (NOT "JPG") because of order of operations. For strings, if the string is not empty, it evaluates as TRUE, so "JPG" evaluates as Boolean TRUE, and (NOT "JPG") evaluates as FALSE. The actual contents of the string are not evaluated, so (NOT "FALSE") still evaluates as Boolean FALSE because the string "FALSE" is not empty. The result is $format = FALSE for every string except and empty one. This version suffers from the same problem: NOT ($format = "BMP") The correct test would be: If $format <> "BMP" Then So, if for some reason you couldn't use Switch/Case/EndSwitch, the full test would be: If ($format <> "JPG") AND ($format <> "BMP") AND ($format <> "GIF") AND ($format <> "PNG") AND ($format <> "TIF") Then ; Not valid input Else ; Valid input EndIf Or, put the other way around: If ($format = "JPG") OR ($format = "BMP") OR ($format = "GIF") OR ($format = "PNG") OR ($format "TIF") Then ; Valid input Else ; Not valid input EndIf
    1 point
  18. Well I think the section between parentheses needs to be a valid equation like this: ($format = NOT "JPG") or NOT ($format = "BMP") the above is incorrect, read PsaltyDS' post for the real functionality. You can also use them the way you would in math, to evaluate the formula inside the parentheses before the rest of the formula like this: 2*5+5 = 15 2*(5+5) = 20 For your script I would advise using a Switch statement like this: $format = InputBox ( "Which image format do you want?", "Which image format do you want? Valid options are: JPG, BMP, GIF, PNG and TIF.", "JPG") Switch $format Case "JPG", "BMP", "GIF", "PNG", "TIF" ConsoleWrite("Case 1 is true" & @CRLF) Case Else ConsoleWrite("Case 2 is true" & @CRLF) EndSwitch edit and re-edit: removed false information
    1 point
  19. @Bilgus Look at this little code : Now i see that i am confused and i dont know how to even try more attemps. MouseDown ("Left");51 If _IsPressed( "51" , $hDLL ) Then MsgBox(0,"","MouseClick Detected!") EndIf If we do a MouseDown Event. It's like an _IsPressed "51". So this script is stuck. Becose i want to continu my painting if i drag something but if i drag somthing it's a mouseclick/. May one of you got sollution for that but it seem i'am trying to do somthing illogic.
    0 points
×
×
  • Create New...