Jump to content

AndroidZero

Active Members
  • Posts

    62
  • Joined

  • Last visited

Recent Profile Visitors

307 profile views

AndroidZero's Achievements

Wayfarer

Wayfarer (2/7)

3

Reputation

  1. If somebody is interested in here is the solution how to use parent axis "::" and negation "not()" _WD_FindElement($mySession, $_WD_LOCATOR_ByXPath, "//p[text()='Place bet']/parent::button[not(@disabled)][@color='green']") Google is still my best friend ๐Ÿ˜„
  2. @Danp2 uhm idk what wiki do you mean? I used "https://www.w3schools.com/xml/xpath_syntax.asp" as reference
  3. Howdy, how can I access the parent node of a selected node and additional with a negotation condition in XPath? My example doesn't work because it's not a valid Syntax, I guess I'm using the ".." and "not()" wrong ๐Ÿคฆโ€โ™‚๏ธ _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//p['Place bet']..button[not(@disabled)]") The pointed Element is what I want to find (NOTE: class & dashlane-rid attribute get always random generated values, not useable)
  4. I'm stuck at this code line since almost a hour can't help myself Func CalcAvgRoundOfStreaks() Local $lostStreak = 0 Local $wonStreak = 0 For $row=0 To UBound($ResultHistory,1)-1 If $ResultHistory[$row][0] >= 2 Then $wonStreak = $wonStreak + 1 If $lostStreak > 0 Then For $i=0 To UBound($L2StreakMemory,1)-1 If $L2StreakMemory[$i][$lostStreak-1] == "" Then If $i == 0 Then $L2StreakMemory[$i][$lostStreak-1] = $row Else $L2StreakMemory[$i][$lostStreak-1] = $row - $L2StreakMemory[$i-1][$lostStreak-1] EndIf ExitLoop EndIf Next EndIf $lostStreak = 0 ElseIf $ResultHistory[$row][0] < 2 Then $lostStreak = $lostStreak + 1 If $wonStreak > 0 Then For $i=0 To UBound($G2StreakMemory,1)-1 If $G2StreakMemory[$i][$wonStreak-1] == "" Then If $row == 0 Then $G2StreakMemory[$i][$wonStreak-1] = $row Else $G2StreakMemory[$i][$wonStreak-1] = $row - $G2StreakMemory[$i-1][$wonStreak-1] EndIf ExitLoop EndIf Next EndIf $wonStreak = 0 EndIf Next _ArrayDisplay($L2StreakMemory,"$L2StreakMemory") _ArrayDisplay($G2StreakMemory,"$G2StreakMemory") EndFunc
  5. I need a function that set an image to a specific row and column within a listview control. There is a function called _GUICtrlListView_SetItemStateImage but it set the image in the first column of a listview index (row). I also tryed the "GUIListViewEx.au3" UDF but the painted Listview Item disappear after clicking or scrolling because I dont work with GUIgetMsg Loops and use instead Opt("GUIOnEventMode",1). Any suggestion how I can paint listview subitem easily ?
  6. I wonder if there is a way to send pictures within html body that will be shown at the desition email. Here is a test script The sending HTM File with the needed image folder test-Dateien.7ztest.htm #include "Inet.au3" Local $text = FileRead("E:\AutoIT\SMTP Messenger\test.htm") Local $s_SmtpServer = "exchange2016.kanzlei.local" Local $s_FromName = "Developer" Local $s_FromAddress = "dev@kmp-gruppe.de" Local $s_ToAddress = "a.klein@kmp-gruppe.de" Local $s_Subject = "*SMTP HTML Test Ansicht*" Local $as_Body[1] $as_Body[0] = $text Local $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, Default, -1) Local $err = @error If $Response = 1 Then MsgBox(0, "Zugestellt!", "Mail erfolgreich zugestellt!") Else MsgBox(0, "Abbruch!", "Zustellung mit folgender Error ID abgebrochen: " & $err) EndIf I read a .htm file created with Microsoft Office Word. Microsoft Outlook using the same extension for adding Signatures and surprisingly the recipient can see the image files within the text body without any problems. If I send the same htm file with "_INetSmtpMail" it doesn't work and looks like this: Don't worry my inet.au3 is already modified to html so this can't be the problem. I guess Outlook using some additional functions to make it possible. $aSend[4] = "From:" & $sFromName & "<" & $sFromAddress & ">" & @CRLF & _ "To:" & "<" & $sToAddress & ">" & @CRLF & _ "Subject:" & $sSubject & @CRLF & _ "Mime-Version: 1.0" & @CRLF & _ "Date: " & _DateDayOfWeek(@WDAY, 1) & ", " & @MDAY & " " & _DateToMonth(@MON, 1) & " " & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & $iBias & @CRLF & _ "Content-Type: text/html; charset=ISO8859-1" & @CRLF & _ @CRLF $aReplyCode[4] = ""
  7. You forgot to store the message & title content of a notification that expired on timeout, well at least i missed it for my needs. Added following Line in Notify_Mod_TextRet.au3 (Script Line 887) Func __Notify_Timer() ... $g_aNotify_Data[0][9] = GUICtrlRead($g_aNotify_Data[$i][8]) & Opt("GUIDataSeparatorChar") & GUICtrlRead($g_aNotify_Data[$i][9]) .. I added a few functions from my current project to your example and it works like a charm for me ! #include "Notify_Mod_TextRet.au3" #include <MSSQL.au3> Opt("TrayAutoPause", 0) ; Press ESC to exit script HotKeySet("{ESC}", "_Exit") Global $samAccName = @UserName, _ $SQL_SERVER = "192.168.10.28", _ $SQL_USER = "devZero", _ $SQL_PW = "xxxxxxxxx", _ $SQL_DB = "kmp" ; Register message for click event _Notify_RegMsg() ; Set notification location _Notify_Locate(0) ; Show notifications Global $aNotCID[5] $aNotCID[0] = _Notify_Show(0, "Ticket 1", "Message 1") $aNotCID[1] = _Notify_Show(0, "Ticket 2", "Message 2") $aNotCID[2] = _Notify_Show(0, "Ticket 3", "Message 3") $aNotCID[3] = _Notify_Show(0, "Message - Andreas", "This is a test message click to answere") $aNotCID[4] = _Notify_Show(0, "Status", "SQL Server [online]", 1) While 1 Sleep(10) ;~ Opt("GUIDataSeparatorChar") For $i = 0 To 4 Local $sRet = _Notify_RetractCheck($aNotCID[$i]) Local $reason = $sRet[0] If $reason <> 0 Then Local $title = StringSplit($sRet[1],"|",1)[1] Local $msg = StringSplit($sRet[1],"|",1)[2] Local $timestamp = @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC EndIf If $reason == 0 Then ;===== nothing ==== ElseIf $reason == 1 Then ConsoleWrite(@CRLF & "========= $aNotCID[" & $i & "] =========") ConsoleWrite(@CRLF & "RetractCheck: Clicked Title") ConsoleWrite(@CRLF & "Title: " & $title) ConsoleWrite(@CRLF & "Message: " & $msg) ;~ Local $mscon = _MSSQL_Con($SQL_SERVER, $SQL_USER, $SQL_PW, $SQL_DB) ;~ _MSSQL_Query($mscon, "INSERT INTO ticketlog (samAccName, notifyRetract, notifyTitle, notifyMessage, timeStamp) " & _ ;~ "VALUES ('" & $samAccName & "','" & $title & "','" & $msg & "','" & $timestamp & "')") If StringInStr($title,"Message", 1) Then $msgFrom = StringSplit($title," - ", 1)[2] _UDP_Messenger("Popup", "ChatWindow", $msgFrom) ElseIf StringInStr($title,"Ticket", 1) Then $ticketNr = StringSplit($title," ", 1)[2] _Ticket_Window("Edit", $ticketNr, Default, Default) EndIf ElseIf $reason == 2 Then ConsoleWrite(@CRLF & "========= $aNotCID[" & $i & "] =========") ConsoleWrite(@CRLF & "RetractCheck: Clicked Message") ConsoleWrite(@CRLF & "Title: " & $title) ConsoleWrite(@CRLF & "Message: " & $msg) ;~ Local $mscon = _MSSQL_Con($SQL_SERVER, $SQL_USER, $SQL_PW, $SQL_DB) ;~ _MSSQL_Query($mscon, "INSERT INTO ticketlog (samAccName, notifyRetract, notifyTitle, notifyMessage, timeStamp) " & _ ;~ "VALUES ('" & $samAccName & "','" & $title & "','" & $msg & "','" & $timestamp & "')") If StringInStr($title,"Message", 1) Then $msgFrom = StringSplit($title," - ", 1)[2] _UDP_Messenger("Popup", "ChatWindow", $msgFrom) ElseIf StringInStr($title,"Ticket", 1) Then $ticketNr = StringSplit($title," ", 1)[2] _Ticket_Window("Edit", $ticketNr, Default, Default) EndIf ElseIf $reason == 9 Then ConsoleWrite(@CRLF & "========= $aNotCID[" & $i & "] =========") ConsoleWrite(@CRLF & "RetractCheck: Timeout") ConsoleWrite(@CRLF & "Title: " & $title) ConsoleWrite(@CRLF & "Message: " & $msg) ;~ Local $mscon = _MSSQL_Con($SQL_SERVER, $SQL_USER, $SQL_PW, $SQL_DB) ;~ _MSSQL_Query($mscon, "INSERT INTO ticketlog (samAccName, notifyRetract, notifyTitle, notifyMessage, timeStamp) " & _ ;~ "VALUES ('" & $samAccName & "','" & $title & "','" & $msg & "','" & $timestamp & "')") ;~ _MSSQL_End($mscon) EndIf Next WEnd Func _Exit() Exit EndFunc Func _UDP_Messenger($mode, $window, $from) ; too big to show EndFunc Func _Ticket_Window($mode, $index, $styleLV, $styleGrid) ; too big to show EndFunc Really love your Notify UDF and since the last change it even more comfortable. Also I got a lot of ideas how to make it more customizeable and what new features could be usefull #GDI+ Animation. I will share the modified notify UDF when all tests are finished until then keep up your excellent work ๐Ÿ’ช
  8. Oh it's the ControlLabel that is stored in $aNotify_Data[$aNotify_Data[0][0]][9] All I have to do is reading the stored GuiControl Local $sMsg = GUICtrlRead($aNotify_Data[$aNotify_Data[0][0]][9]) Thread can be closed And thanks for this awesome UDF @Melba23
  9. I want to use a modified WM_MOUSEACTIVATE when clicking on a Notificaion instead the _Notify_RegMsg(). My goal: I want read the message of the clicked Notification and start another function depending on the message In the Notifiy UDF I could find in Line 683 that the Message is stored in $aNotify_Data[$aNotify_Data[0][0]][9] but it shows only a number anyone here knows wher I can find the stored notification message ? Func WM_MOUSEACTIVATE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam ConsoleWrite(@CRLF & "$hWnd=" & $hWnd) For $i = $aNotify_Data[0][0] To 1 Step -1 ; Is it a click on a notification? If $hWnd = $aNotify_Data[$i][0] Then ; Check if other action occuring If $bNotify_Action Then ; Clear click on this notification AdlibRegister("_Notify_ResetClick", 100) Else $aNotify_Data[0][5] = $i If $aNotify_Data[$i][5] Then ; Extend the notification AdlibRegister("_Notify_Extend", 100) Else ; Delete the notification if clickable If $aNotify_Data[$i][3] Then ConsoleWrite(@CRLF & "$aNotify_Data[0][0]= " & $aNotify_Data[0][0]) ConsoleWrite(@CRLF & "$aNotify_Data[0][1]= " & $aNotify_Data[0][1]) ConsoleWrite(@CRLF & "$aNotify_Data[0][2]= " & $aNotify_Data[0][2]) ConsoleWrite(@CRLF & "$aNotify_Data[0][3]= " & $aNotify_Data[0][3]) ConsoleWrite(@CRLF & "$aNotify_Data[0][4]= " & $aNotify_Data[0][4]) ConsoleWrite(@CRLF & "$aNotify_Data[0][5]= " & $aNotify_Data[0][5]) ConsoleWrite(@CRLF & "$aNotify_Data[0][6]= " & $aNotify_Data[0][6]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][1]= " & $aNotify_Data[$i][1]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][2]= " & $aNotify_Data[$i][2]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][3]= " & $aNotify_Data[$i][3]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][4]= " & $aNotify_Data[$i][4]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][5]= " & $aNotify_Data[$i][5]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][6]= " & $aNotify_Data[$i][6]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][7]= " & $aNotify_Data[$i][7]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][8]= " & $aNotify_Data[$i][8]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][9]= " & $aNotify_Data[$i][9]) ConsoleWrite(@CRLF & "$aNotify_Data[$aNotify_Data[0][0]][9]= " & $aNotify_Data[$aNotify_Data[0][0]][9]) AdlibRegister("_Notify_Delete", 100) EndIf EndIf EndIf ExitLoop EndIf Next Return "GUI_RUNDEFMSG" EndFunc
  10. @BrewManNH okey you are right .. I just hoped for some magic trick Well I read about functional programming time ago and how fancy it is without using globals just create Functions with 1 simple job and nest them inside each other to get your desired result like: *PSEUDOCODE* call OpenDoor(Move(LoadHand(LoadAvatar()),90°,45°,Down)) Thanks for all of your replies I will keep juggeling with my globals ๐Ÿคนโ€โ™‚๏ธ
  11. Ok I understand but my wish is to reduce the ammount of globals in my script to a minimum to avoid side effects and ress memory usage. The thing with MessageLoops like GuiGetMsg() or TrayGetMsg() is that I can access the Local Scope BUT I can't go simultaneously into another MessageLoop. That means I can't open another GUI or click in the TrayIcon. Just to make it clear what my goal is: I want to generate a TrayIcon with TrayMenus/items where I can open different GUIs or simply call functions but always being able to control the TrayIcon at any time and start further functions. I extended the example script above with my needs using MessageLoops but how explained it doesn't work how I wish it should. Any suggestion what is the best way to realize my plan ? Or is there no way to bypass declaring Globals ? #include <GUIConstants.au3> #cs Global $GUI_Window Global $GUI_Label #ce ;~ Opt("GUIOnEventMode", 1) Opt("TrayMenuMode", 3) Tray_T1() Func Gui_P1() Local $GUI_Window = GUICreate("P1", 250, 250, -1, -1) Local $GUI_Label = GUICtrlCreateLabel("<Nothing>", 25, 20) Local $GUI_Button1 = GUICtrlCreateButton("Modify",0,175,250) Local $GUI_Button2 = GUICtrlCreateButton("Back",0,200,250) Local $GUI_Button3 = GUICtrlCreateButton("Exit",0,225,250) GUISetState(@SW_SHOW, $GUI_Window) While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ConsoleWrite(@CRLF & ">$GUI_EVENT_CLOSE") Gui_Delete($GUI_Window) Tray_T1() Case $GUI_Button1 ConsoleWrite(@CRLF & ">$GUI_Button1") Modify($GUI_Label) Case $GUI_Button2 ConsoleWrite(@CRLF & ">$GUI_Button2") GUIDelete($GUI_Window) Tray_T1() Case $GUI_Button3 ConsoleWrite(@CRLF & ">$GUI_Button3") Local $resp = MsgBox(262144 + 64 + 4, "Attention", "Do you really want to quit the whole program ?") If $resp == "1" Or $resp == "6" Or $resp == "11" Then GUIDelete($GUI_Window) Exit ElseIf $resp == "2" Or $resp == "3" Or $resp == "7" Then ;Nothing EndIf EndSwitch WEnd EndFunc Func Gui_P2() Local $GUI_Window = GUICreate("P2", 250, 250, -1, -1) Local $GUI_Label = GUICtrlCreateLabel("<Nothing>", 25, 20) Local $GUI_Button1 = GUICtrlCreateButton("Modify",0,175,250) Local $GUI_Button2 = GUICtrlCreateButton("Back",0,200,250) Local $GUI_Button3 = GUICtrlCreateButton("Exit",0,225,250) GUISetState(@SW_SHOW, $GUI_Window) While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ConsoleWrite(@CRLF & ">$GUI_EVENT_CLOSE") Gui_Delete($GUI_Window) Tray_T1() Case $GUI_Button1 ConsoleWrite(@CRLF & ">$GUI_Button1") Modify($GUI_Label) Case $GUI_Button2 ConsoleWrite(@CRLF & ">$GUI_Button2") GUIDelete($GUI_Window) Tray_T1() Case $GUI_Button3 ConsoleWrite(@CRLF & ">$GUI_Button3") Local $resp = MsgBox(262144 + 64 + 4, "Attention", "Do you really want to quit the whole program ?") If $resp == "1" Or $resp == "6" Or $resp == "11" Then GUIDelete($GUI_Window) Exit ElseIf $resp == "2" Or $resp == "3" Or $resp == "7" Then ;Nothing EndIf EndSwitch WEnd EndFunc Func Gui_Delete($gui) GUIDelete($gui) EndFunc Func Modify($control) ConsoleWrite(@CRLF & ">Move") GUICtrlSetPos($control, Random(0,200,1), Random(0,175,1)) ConsoleWrite(@CRLF & ">Rewrite") GUICtrlSetData($control,"Number: " & Asc(Random(0,99,1))) EndFunc Func Tray_T1() $Tray_Item1 = TrayCreateItem("Gui_P1") $Tray_Item2 = TrayCreateItem("Gui_P2") $Tray_Item3 = TrayCreateItem("Exit") While 1 Switch TrayGetMsg() Case $Tray_Item1 ConsoleWrite(@CRLF & ">$Tray_Item1") TrayItemDelete($Tray_Item1) TrayItemDelete($Tray_Item2) TrayItemDelete($Tray_Item3) Gui_P1() Case $Tray_Item2 ConsoleWrite(@CRLF & ">$Tray_Item2") TrayItemDelete($Tray_Item1) TrayItemDelete($Tray_Item2) TrayItemDelete($Tray_Item3) Gui_P2() Case $Tray_Item3 ConsoleWrite(@CRLF & ">$Tray_Item3") Exit EndSwitch WEnd EndFunc
  12. How I can access a Local Scope from outside Is there a better way except creating Globals ? #include <GUIConstants.au3> #cs Global $GUI_Window Global $GUI_Label #ce Opt("GUIOnEventMode", 1) Gui_P1() While 1 Sleep(100) WEnd Func Gui_P1() $GUI_Window = GUICreate("P1", 1050, 720, -1, -1) $GUI_Label = GUICtrlCreateLabel("<Nothing>", 25, 20) Local $GUI_Button = GUICtrlCreateButton("Modify",25,300,100) GUICtrlSetOnEvent($GUI_Button, "Modify") GUISetOnEvent($GUI_EVENT_CLOSE, "Gui_P1_Close") GUISetState(@SW_SHOW, $GUI_Window) EndFunc Func Gui_P1_Close() GUIDelete($GUI_Window) Exit EndFunc Func Modify() ConsoleWrite(@CRLF & ">Move") GUICtrlSetPos($GUI_Label, Random(25,250,1), Random(25,250,1)) ConsoleWrite(@CRLF & ">Rewrite") GUICtrlSetData($GUI_Label,"Number: " & Random(0,99,1)) EndFunc
  13. Is there a way to create a Event Function that runs every x miliseconds while I can interact in another While Loop ? For example opening a GUI working inside it, calling functions etc .. and during all the time my script checks for receiving UDP data
×
×
  • Create New...