Leaderboard
Popular Content
Showing content with the highest reputation on 08/01/2017 in all areas
-
Looking pretty extensive now, even reporting success there in every step. ......and more importantly........ does it work now? Jos1 point
-
IIRC $colItems.Count returns the number of items in the collection.1 point
-
Copying files not working
aa2zz6 reacted to KickStarter15 for a topic
@aa2zz6 I tried checking you code and I've found some issues. 1. $Destination must not contain "S:" or any directory since it was already declared in $drive[$i]. Local $Destination = "S:\Digital Camera Photos\2017\" 2. $sFilePath = "my_pictures" was duplicated with $drive[$i] & "\my_pictures". Local $sFilePath = "my_pictures" Local $GetPaths = $drive[$i] & "\my_pictures" 3. I tried it this way and removing DirCreate() function to see if it is working or not (and it worked accordingly). However, DirCreate() was removed. By that, maybe you can check why it is not working when using DirCreate(). #include <FileConstants.au3> #include <Date.au3> $drive = DriveGetDrive("ALL") If Not @error Then For $i = 1 To $drive[0] Local $Destination = "\Digital Camera Photos\2017\" FileChangeDir($drive[$i]) Local $GetPaths = $drive[$i] & "\my_pictures\" Local $GetPaths1 = $GetPaths $sizefldr1 = DirGetSize($GetPaths1, 1) If Not @error Then If Not $sizefldr1[1] And Not $sizefldr1[2] Then MsgBox(0, "Msgbox", "Empty") Else ;~ $folder = DirCreate($Destination & _DateToMonth(@MON, 1) & "-" & @MDAY & "-" & @YEAR & " " & @UserName) ; Error originate's here... DirCopy($GetPaths1, $Destination, $FC_OVERWRITE) EndIf Else MsgBox(0, "Msgbox", "Does not exist: " & $GetPaths1) EndIf Next EndIf Just trying to suggest. Hope it helps. KS151 point -
how to join x2 text files and display the common entries ?
asiawatcher reacted to Malkey for a topic
Added a "Find Duplicate routine" to your example of post #1. #include <Array.au3> Local $txt = "3" &@crlf& "1" &@crlf& "2" &@crlf& "3 " &@crlf& "4" &@crlf& "41" &@crlf& "42" &@crlf& "3" &@crlf& "5" &@crlf& "6" &@crlf& "42" ;Local $txt = "1,2,3,4,5,6,7,8,9,10, 2,5,10,11,12,2,2,2,10,10 " ;Local $txt = FileRead("1.txt") & @crlf & FileRead("2.txt") & @crlf & FileRead("3.txt") Local $uniq = StringRegExp($txt, "(?s)\b(\d+)\b(?!.*\b\1\b)", 3) ; sorting numeric Local $temp, $loop = 1, $Duplicates = "" While $loop $loop = 0 For $i = 1 To UBound($uniq) - 1 If Number($uniq[$i]) < Number($uniq[$i - 1]) Then ; sort ascending $temp = $uniq[$i] $uniq[$i] = $uniq[$i - 1] $uniq[$i - 1] = $temp $loop = 1 EndIf Next WEnd _ArrayDisplay($uniq) ; --------- Find Duplicate routine ------- For $i = 1 To UBound($uniq) - 1 StringRegExpReplace($txt, "\b(" & $uniq[$i] & ")\b", "") If @extended > 1 Then $Duplicates &= $uniq[$i] & ", " Next ; ---- End of Find Duplicate routine ----- MsgBox(0, "", "Unique: " & _ArrayToString($uniq, ", ") & @CRLF & _ "Duplicates: " & StringTrimRight($Duplicates, 2)) And another "Find Duplicate routine" ; --------- Find Duplicate routine ------- Local $a = StringRegExp($txt, "(?s)\b(\d+)\b(?=.*\b\g-1\b)", 3) Local $dupl = _ArrayUnique($a, 0, 0, 0, 0, 0) ; ---- End of Find Duplicate routine ----- MsgBox(0, "Method 2 (No loop)", "Unique: " & _ArrayToString($uniq, ", ") & @CRLF & _ "Duplicates: " & _ArrayToString($dupl, ", "))1 point -
First you need to pass the username and password of the user you want to fetch messages for to the server so that you can get a Session ID from the server, like so. $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", "https://pdglobal.net?sid=login&usr=" & URLEncode($username) & "&pwd=" & URLEncode($password), False) $oHTTP.Send() $auth = $oHTTP.ResponseText $session = StringTrimLeft($auth, 3) Then you need to pass the session ID to the getmsgs page $oHTTP.Open("GET", "https://pdglobal.net/?sid=getmsgs&session=" & URLEncode($session), False) $oHTTP.Send() $msg = $oHTTP.ResponseText then the $msg variable will have all unread messages for that user. Each message is seperated by a "!" and the username of the message/message itself are separated with a "~" Note: The URLEncode function() function can be found in the source code of SIM. Note: The session ID expires after 24 hours, so you may want to request a new session ID every so often. SIM fetches a new session ID every hour.1 point
-
@grimta And in fact you were not totally wrong My code above does the modification before writing in the input. Pretty nice correct and all, but as TheSaint pointed out, not so easy to handle. So the easiest workaround is to make the modification in the input just after writing, so fast than you can't see Example #1, using $GUI_EVENT_DROPPED : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $hForm = GUICreate('Test', 500, 100, -1, -1, -1, $WS_EX_ACCEPTFILES) Global $input = GUICtrlCreateInput("", 10, 40, 480, 20) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_DROPPED If @GUI_DropId = $input Then GuiCtrlSetData($input, StringReplace(GUICtrlRead($input), "|", ";") ) EndIf EndSwitch WEnd Example #2 using GUIRegisterMsg : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Local $hForm = GUICreate('Test', 500, 100, -1, -1, -1, $WS_EX_ACCEPTFILES) Global $input = GUICtrlCreateInput("", 10, 40, 480, 20) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) Local $iCode = BitShift($wParam, 16) Switch $iIDFrom Case $input Switch $iCode Case $EN_UPDATE ;$EN_CHANGE GuiCtrlSetData($input, StringReplace(GUICtrlRead($input), "|", ";") ) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND1 point
-
http://www.bioinfor.com/bruker-data/ Seems doable but only when you have access to a bruker machine and time for experimenting. All these type of machines offer some kind of serial communication.1 point
-
Weather from weather.com
coffeeturtle reacted to usmiv4o for a topic
Yet another weather scrypt, but this one is working. All other that I search for aren not functioning. To get you City code go to weather.com and inside URL is code. this script parses XML from weather.com and shows to MSgBox and console. #cs Description: Weather XML from Weather.com. author: usmiv4o (just repaired old script) date: 29.7.2017 to get City code go to weather.com and copy City code from URL ;http://wxdata.weather.com/wxdata/weather/local/BUXX0005?cc=*&unit=m&dayf=1 <- URL for Sofia, Bulgaria, metric units #ce Global $location,$loc_time,$sunrise,$sunset,$datetime,$loc,$temp,$feels,$current,$wicon,$bp Global $bpd,$ws,$wg,$wd,$wt,$hmid,$vis,$uv,$uvt,$dewp,$micon,$mt Global $code = "BUXX0005" ;Sofia Bulgaria $input = "sofia" _GetWeather() $array = StringSplit($temp, " ") ;$temp = K2C($array[1]) $array = StringSplit($feels, " ") ;$feels = K2C($array[1]) $array = StringSplit($sunrise, " ") $sunrise = $array[1] $array = StringSplit($sunrise, ":") $sunrise = $array[1] $sunrise1 = $array[2] ;MsgBox(0,"sunset", $sunset) $array = StringSplit($sunset, " ") $sunset = $array[1] $array = StringSplit($sunset, ":") $sunset = $array[1] $sunset1 = $array[2] ; wind speed $ws = $ws * 1.6 $array = StringSplit($ws, ".") $ws = $array[1] ;$ws1 = $array[2] ;ConsoleWrite("Temperature now "&$temp& " C " & @CRLF _ ;& " Weather now "& $current & @CRLF &" wind speed " & K2C($ws) _ ;& "km/h." & @CRLF & " Humidity " &$hmid & " %" & @CRLF & " bar. pressure " & $bp & " hP" & @CRLF) ; convert Kelvins to Celsius Func K2C(ByRef $temp) $temp = ($temp - 32) * (5/9) ;converting to Celsius $temp = Round($temp, 2) ;round float point up to 2 -nd sign ;MsgBox(0, "K2C", $temp) Return $temp EndFunc ;Message Box with data Func Showy() MsgBox(0,"location ", $location) ConsoleWrite("location "& $location & @CRLF) MsgBox(0,"loc_time ", $loc_time) ConsoleWrite("loc_time "& $loc_time & @CRLF) MsgBox(0,"sunrise ", $sunrise &"."& $sunrise1) ConsoleWrite("sunrise "& $sunrise &"."& $sunrise1 & @CRLF) MsgBox(0,"sunset ", $sunset &"."& $sunset1) ConsoleWrite("sunset "& $sunset &"."& $sunset1 & @CRLF) MsgBox(0,"datetime ", $datetime) ConsoleWrite("datetime "& $datetime & @CRLF) MsgBox(0,"temp ", $temp & " C") ConsoleWrite("temp "& $temp & " C" & @CRLF) MsgBox(0,"feels ", $feels & "C") ConsoleWrite("feels "& $feels & "C" & @CRLF) MsgBox(0,"current ", $current) ConsoleWrite("current " & $current & @CRLF) MsgBox(0,"barometric pressure ", $bp & "hP") ConsoleWrite("barometric pressure "& $bp & "hP" & @CRLF) MsgBox(0,"bpd ", $bpd) ConsoleWrite("bpd " & $bpd & @CRLF) MsgBox(0,"wind speed ", $ws) ConsoleWrite("wind speed " & $ws & @CRLF) MsgBox(0,"wd wt ", $wd & " " & $wt& " km/h") ConsoleWrite("wd wt " & $wd & " " & $wt & " km/h" & @CRLF) MsgBox(0,"humidity ", $hmid & "%") ConsoleWrite("humidity " & $hmid & "%" & @CRLF) MsgBox(0,"visibility ", $vis & " km") ConsoleWrite("visibility " & $vis & " km " & @CRLF) MsgBox(0,"UV index", $uv & " (" & $uvt & ")") ConsoleWrite("UV index " & $uv & " (" & $uvt & ")" & @CRLF) MsgBox(0,"dewp", $dewp) ConsoleWrite("dewp " & $dewp & @CRLF) MsgBox(0,"mt", $mt) ConsoleWrite("mt " & $mt & @CRLF) EndFunc Func _GetWeather() $oXml = ObjCreate("Msxml2.DOMDocument.3.0") $oXml.async=0 $oXml.Load("http://wxdata.weather.com/wxdata/weather/local/BUXX0005?cc=*&unit=m&dayf=1") $oXmlroot = $oXml.documentElement For $oXmlnode In $oXmlroot.childnodes For $oXmlnode2 In $oXmlnode.attributes If $oXmlnode2.name = "id" Then $code = $oXmlnode2.value Next Next If $code = "NoCode" Then Msgbox(0, "Error", "Location Not Found" & "Click OK To Continue") Else $oXml.Load("http://wxdata.weather.com/wxdata/weather/local/" & $code & "?cc=*&unit=m&dayf=1") $oXmlroot = $oXml.documentElement For $oXmlNode In $oXmlroot.childNodes Select Case $oXmlnode.nodename = "loc" For $oXmlnode2 in $oXmlnode.Childnodes Select Case $oXmlnode2.nodename = "dnam" $location = $oXmlnode2.text Case $oXmlnode2.nodename = "tm" $loc_time = $oXmlnode2.text Case $oXmlnode2.nodename = "sunr" $sunrise = $oxmlnode2.text ; sunrise ;ConsoleWrite($sunrise & @CRLF) Case $oXmlnode2.nodename = "suns" $sunset = $oxmlnode2.text ; sunset ;ConsoleWrite($sunset & @CRLF) EndSelect Next Case $oXmlnode.nodename = "dayf" For $oXmlnode2 in $oXmlnode.Childnodes Select Case $oXmlnode2.nodename = "hi" $hi = $oXmlnode2.text Case $oXmlnode2.nodename = "low" $low = $oXmlnode2.text EndSelect Next Case $oxmlnode.nodename = "cc" For $oxmlnode2 In $oxmlnode.childnodes Select Case $oxmlnode2.nodename = "lsup" ;<lsup>7/28/17 7:00 AM EEST</lsup> $datetime = $oxmlnode2.text Case $oxmlnode2.nodename = "obst" $loc = $oxmlnode2.text Case $oxmlnode2.nodename = "tmp" $temp = $oxmlnode2.text Case $oxmlnode2.nodename = "flik" $feels = $oxmlnode2.text Case $oxmlnode2.nodename = "t" $current = $oxmlnode2.text Case $oxmlnode2.nodename = "icon" $wicon = $oxmlnode2.text Case $oxmlnode2.nodename = "bar" For $oxmlnode3 in $oxmlnode2.childnodes Select Case $oxmlnode3.nodename = "r" $bp = $oxmlnode3.text Case $oxmlnode3.nodename = "d" $bpd = $oxmlnode3.text EndSelect Next Case $oxmlnode2.nodename = "wind" For $oxmlnode3 in $oxmlnode2.childnodes Select Case $oxmlnode3.nodename = "s" $ws = $oxmlnode3.text ;windspeed miles Case $oxmlnode3.nodename = "gust" $wg = $oxmlnode3.text Case $oxmlnode3.nodename = "d" $wd = $oxmlnode3.text Case $oxmlnode3.nodename = "t" $wt = $oxmlnode3.text EndSelect Next Case $oxmlnode2.nodename = "hmid" $hmid = $oxmlnode2.text ;humidity Case $oxmlnode2.nodename = "vis" $vis = $oxmlnode2.text ;visibility Case $oxmlnode2.nodename = "uv" For $oxmlnode3 in $oxmlnode2.childnodes; ULTRAVIOLET INDEX Select Case $oxmlnode3.nodename = "i" $uv = $oxmlnode3.text Case $oxmlnode3.nodename = "t" $uvt = $oxmlnode3.text EndSelect Next Case $oxmlnode2.nodename = "dewp" $dewp = $oxmlnode2.text Case $oxmlnode2.nodename = "moon" For $oxmlnode3 in $oxmlnode2.childnodes Select Case $oxmlnode3.nodename = "icon" $micon = $oxmlnode3.text Case $oxmlnode3.nodename = "t" $mt = $oxmlnode3.text EndSelect Next EndSelect Next EndSelect Next $oXml = "" EndIf EndFunc Showy() attached weather.au3 and sample XML BUXX0005.xml Weather.au31 point -
Automation using WebLayout
VaishnaviBUtpat reacted to Danp2 for a topic
You'll need to supply more information. Post your code and explain in detail what isn't working as you would expect.1 point