-
Posts
2,401 -
Joined
-
Last visited
-
Days Won
13
careca last won the day on June 5 2020
careca had the most liked content!
About careca
- Birthday 08/05/1986
Profile Information
-
Member Title
Desinformation Era
-
Location
Sines, Portugal
careca's Achievements
-
rohmanabdur reacted to a post in a topic: Need to find the path of exe
-
Hi! What could be a cause for an application that crashes/closes after some days at random? The computer is not mine, and is never shut down, but is put to sleep at occasion. What should i be looking for? The applications in question are my own beats player and stringtrigger. Memory used doesn't seem to increase over time (in the short time i looked at it). Is the best approach to let the script run for days hoping that it crashes and i see the error in the debugger? I am hoping that you experts can point me in the most likely direction. Thank you.
-
ad777 reacted to a post in a topic: [Solved] How do I detect click on an input control?
-
Thank you for the input and suggestions.
-
Hi, i just noticed this annoying thing in my music player, in which the files that have numbers are not in sequence, see example attached. 1, 11, 12, 2, 3, 4.. I'm currently using _FileListToArrayRec Open to suggestions. Thanks in advance.
-
Hi, i created this after i was trying to clone a disk and it kept giving me errors from bad sector, i ran CHKDSK on the offending drive multiple times, not finding anything, then i learned that there are hidden partitions on which chkdsk can run on, but i need to supply the partition GUID. This tool is the simple and easy way to chkdsk /R those partitions, it retrieves a list of all, with and without assigned letter, and then the user can use the context menu on them to run chkdsk /r command. #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=chkdsk.ico #AutoIt3Wrapper_Res_Icon_Add=chkdsk.ico #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;============================================================================= #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <GuiListView.au3> ;============================================================================= Opt("GUIOnEventMode", 1) Opt("GUIEventOptions", 0) Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Opt("TrayMenuMode", 3) Opt("TrayIconHide", 0) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) Opt("TrayOnEventMode", 1) ;============================================================================= Local $Form1, $DSK, $Str, $Read, $List, $Letter, $VolSplit, $GUID, $cListView, $ContextMenu, $Selection, $GetItemPos, $ExitItem $Form1 = GUICreate("CheckDisk Tool", 600, 360, 190, 125) GUISetOnEvent($GUI_EVENT_CLOSE, "Close") $cListView = GUICtrlCreateListView("Drive Letter|GUID", 10, 10, 580, 300) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 175) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 400) $List = GUICtrlCreateButton("List Drives", 10, 320, 75, 25) GUICtrlSetOnEvent($List, "List") $ContextMenu = GUICtrlCreateContextMenu($cListView) $Selection = GUICtrlCreateMenuItem("CHKDSK", $ContextMenu, 1) GUICtrlSetOnEvent(-1, "CHKDSK") GUICtrlSetTip(-1, "CHKDSK the volume with this GUID", 'CHKDSK') GUISetIcon('chkdsk.ico') TraySetIcon('chkdsk.ico') $ExitItem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Close") GUISetState(@SW_SHOW) ;============================================================================= Func List() WinSetTitle($Form1, "", "Reading Volumes...") _GUICtrlListView_DeleteAllItems($cListView) $DSK = Run('mountvol', '', @SW_HIDE, $STDOUT_CHILD) ;@SW_HIDE WinWaitActive('[CLASS:ConsoleWindowClass]', '', 2) SendKeepActive('[CLASS:ConsoleWindowClass]') Sleep(1000) Do Sleep(100) $Read = StdoutRead($DSK, True, False) $Str = StringInStr($Read, ':\') Until $Str <> 0 $VolSplit = StringSplit($Read, '\\?\Volume{', 1) For $v = 2 To $VolSplit[0] $Letter = StringStripWS(StringTrimLeft($VolSplit[$v], 48), 8) $GUID = '\\?\Volume{' & StringLeft($VolSplit[$v], 37) If $Letter = '***NOMOUNTPOINTS***' Then $Letter = 'No Letter' EndIf GUICtrlCreateListViewItem($Letter & '|' & $GUID, $cListView) Next WinSetTitle($Form1, "", "CheckDisk Tool") EndFunc ;==>List ;============================================================================= Func CHKDSK() $GetItemPos = _GUICtrlListView_GetNextItem($cListView, -1, 0, 8) $GUID = _GUICtrlListView_GetItemText($cListView, $GetItemPos, 1) ConsoleWrite($GUID & @CRLF) $DSK = ShellExecute('chkdsk', $GUID & ' /r', '', '', @SW_SHOW) WinWaitActive('[CLASS:ConsoleWindowClass]', '', 2) SendKeepActive('[CLASS:ConsoleWindowClass]') ;GUISetState(@SW_SHOW) EndFunc ;==>CHKDSK ;============================================================================= Func Close() Exit EndFunc ;==>Close ;============================================================================= Do Sleep(100) Until $Form1 = 0 ;=============================================================================
-
Copy items from a listview column to another (Binance)
careca replied to careca's topic in AutoIt General Help and Support
Hi, that's a good idea, the problem I'm not able to go around, is that there are empty elements in the array, so if I import the whole array as is, there will be many empty entries. I will look into it some more. EDIT: this seems to do the work, thank you #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Binance.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Comment=By:careca #AutoIt3Wrapper_Res_Description=Get Binance BTC Pairs Spikes #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Icon_Add=Binance.ico ;#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;============================================================================= #Region ;Include + Opt #include <IE.au3> #include <Inet.au3> #include <File.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <WinAPIGdi.au3> #include <GuiTreeView.au3> #include <GuiListView.au3> #include <TrayConstants.au3> #include <ScreenCapture.au3> #include <GUIConstantsEx.au3> #include <GuiScrollBars.au3> #include <StaticConstants.au3> #include <AutoItConstants.au3> #include <WindowsConstants.au3> #include "ExtMsgBox.au3" #include "GUIListViewEx.au3" Opt("TrayMenuMode", 3) Opt("TrayIconHide", 0) ;Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) ;Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) ;Opt("MustDeclareVars", 1) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) #EndRegion ;Include + Opt ;============================================================================= #Region ;GuiVars + FileInstall Global $GUI, $Button_1, $hGraphic, $hGraphic2, $sString, $hFont, $aInfo, $hFormat, $hBrush, $hImage, $hImageR, $hFamily, $tLayout, $IndexDay, $RefreshItem, $wpos Global $ExitItem, $Label, $Label1, $oIE, $oDoc, $oElement1, $oElement2, $StringMid, $Split1, $Split2, $Trim, $Number, $ID, $Pic, $String, $SetString, $CfgFldr Global $IniRIStart, $IniRIEnd, $IniRVStart, $IniRVEnd, $Ping, $clistview, $iLV_Index, $cLV, $Pair, $Value, $1stStart = 1, $iniArray, $CheckBoxRead, $InputRead Global $Day = 0, $WS, $StartWinCheck, $BookTicker, $SplitCoins, $SplitPairData, $WinState = 0, $Iteration = 1, $aArray_Base[257][2], $ArrLoop = 0 Global Const $AC_SRC_ALPHA = 1 Global $i_x1 = 0, $i_y1 = 0, $i_x3 = 25, $i_y3 = 25 Global $aMousePos, $aMousePos2, $iMouseOver = 0 Global $InstallDir = @LocalAppDataDir & '\ipma' Global $aProcessList = ProcessList(@ScriptName) If $aProcessList[0][0] >= 2 Then Exit FileInstall("Binance.ico", $InstallDir & '\Binance.ico', 1) #EndRegion ;GuiVars + FileInstall ;============================================================================= #Region ;GUI TraySetIcon("Binance.ico") $GUI = GUICreate('Binance', 800, 520, -1, -1, -1) GUISetBkColor(0x444444) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") GUISetIcon("Binance.ico") ;============================================================================= Local $CheckBox = GUICtrlCreateCheckbox('Activate Check', 630, 20) Local $InputBox = GUICtrlCreateInput('', 630, 40, 100) $ExitItem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Quit") TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "Window") TraySetState(1) TraySetClick(8) GUISetState(@SW_SHOW) #EndRegion ;GUI ;============================================================================= #Region ;ListView $clistview = GUICtrlCreateListView("", 10, 10, 600, 500, -1, $LVS_EX_GRIDLINES) ; + $LVS_EX_FULLROWSELECT + $LVS_EX_INFOTIP) GUICtrlSetFont($clistview, 9, 600, 0, '', 5) _GUICtrlListView_AddColumn($clistview, "Pair", 100) _GUICtrlListView_AddColumn($clistview, "Latest", 100) _GUICtrlListView_AddColumn($clistview, "Previous1", 100) _GUICtrlListView_AddColumn($clistview, "Difference", 100) _GUIScrollBars_Init($clistview) _GUIScrollBars_EnableScrollBar($clistview, $SB_HORZ, $ESB_DISABLE_RIGHT) #EndRegion ;ListView AdlibRegister("CheckPairs", 10000) ;============================================================================= Func CheckPairs() ;============================================================================= $BookTicker = _INetGetSource("https://www.binance.com/api/v3/ticker/bookTicker", True) $BookTicker = StringTrimLeft($BookTicker, 2) $SplitCoins = StringSplit($BookTicker, "},{", 1) For $c = 1 To $SplitCoins[0] If StringInStr($SplitCoins[$c], 'BTC","') <> 0 Then $SplitPairData = StringSplit($SplitCoins[$c], ",", 1) $Pair = StringReplace(StringTrimLeft($SplitPairData[1], 10), '"', '') $Value = StringReplace(StringTrimLeft($SplitPairData[2], 12), '"', '') If $Value <> 0.00000000 Then $aArray_Base[$ArrLoop][0] = $Pair $aArray_Base[$ArrLoop][1] = $Value $ArrLoop = $ArrLoop + 1 EndIf EndIf Next $ArrLoop = 0 ;============================================================================= _ArraySort($aArray_Base, 0, 0, 0, 0, 0) ;============================================================================= If $1stStart = 1 Then ;Only at first start _GUICtrlListView_AddArray($clistview, $aArray_Base) EndIf ;============================================================================= For $d = 0 To _GUICtrlListView_GetItemCount($clistview) ;Copy items to the second column _GUICtrlListView_SetItemText($clistview, $d, _GUICtrlListView_GetItemText($clistview, $d, 1), 2) Next ;============================================================================= For $ArrS = 1 To UBound($aArray_Base) - 1 ;Write the updated values _GUICtrlListView_SetItemText($clistview, $ArrS - 1, $aArray_Base[$ArrS][0], 0) _GUICtrlListView_SetItemText($clistview, $ArrS - 1, $aArray_Base[$ArrS][1], 1) Next ;============================================================================= $InputRead = GUICtrlRead($InputBox) $CheckBoxRead = GUICtrlRead($CheckBox, 0) For $d = 0 To _GUICtrlListView_GetItemCount($clistview) - 1 $Current = _GUICtrlListView_GetItemText($clistview, $d, 1) $Prev1 = _GUICtrlListView_GetItemText($clistview, $d, 2) $Result = Round(($Current - $Prev1) / (($Current + $Prev1) / 2) * 100, 2) _GUICtrlListView_SetItemText($clistview, $d, $Result & '%', 3) If $CheckBoxRead = 1 And $InputRead <> '' Then If $Result >= $InputRead And $Result <> 200 Then _WinAPI_Beep(500, 1000) $GetPair = StringTrimRight(_GUICtrlListView_GetItemText($clistview, $d, 0), 3) Local $sMsg = "The pair :" & $d & " - " & $GetPair & @CRLF & "Increased by " & $Result & '%' Local $iRetValue = _ExtMsgBox($EMB_ICONINFO, "Go to the pair page.|Ignore.", "Select", $sMsg, 20) If $iRetValue = 1 Then ShellExecute('https://www.binance.com/en/trade/' & $GetPair & '_BTC?layout=pro') ElseIf $iRetValue = 2 Then ;MsgBox(64 + 262144, 'Failed', '.' & @CRLF & 'Will close') EndIf EndIf EndIf Next ;============================================================================= $1stStart = 0 Return EndFunc ;==>CheckPairs ;============================================================================= Do ;Main Sleep(100) Until GUIGetMsg() = $GUI_EVENT_CLOSE ;============================================================================= #Region ;Window ;====================================================================================== Func Window() If $WinState = 0 Then GUISetState(@SW_SHOW, $GUI) $WinState = 1 Else GUISetState(@SW_HIDE, $GUI) $WinState = 0 EndIf EndFunc ;==>Window ;============================================================================= Func Minimize() WinSetState('', '', @SW_MINIMIZE) EndFunc ;==>Minimize ;============================================================================= Func Restore() WinSetState('', '', @SW_RESTORE) EndFunc ;==>Restore ;============================================================================= Func Quit() TrayItemSetState($ExitItem, $TRAY_UNCHECKED) AdlibUnRegister("CheckPairs") Exit EndFunc ;==>Quit #EndRegion ;Window ;============================================================================= -
Hi, im seeking to retrieve information from a website and place it in a listview, the idea is that the most recent values are in the column 2, and then at the subsequent data retrievals the values from the most recent column, go into the one next to it to the right, and the ones that were in that 3rd column go to the 4th column as to make some sort of history. This is what i got so far #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Binance.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Comment=By:careca #AutoIt3Wrapper_Res_Description=Get Binance BTC Pairs Spikes #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Icon_Add=Binance.ico ;#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;============================================================================= #Region ;Include + Opt #include <IE.au3> #include <Inet.au3> #include <File.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <WinAPIGdi.au3> #include <GuiTreeView.au3> #include <GuiListView.au3> #include <TrayConstants.au3> #include <ScreenCapture.au3> #include <GUIConstantsEx.au3> #include <GuiScrollBars.au3> #include <StaticConstants.au3> #include <AutoItConstants.au3> #include <WindowsConstants.au3> #include "ExtMsgBox.au3" #include "GUIListViewEx.au3" Opt("TrayMenuMode", 3) Opt("TrayIconHide", 0) ;Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) ;Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) ;Opt("MustDeclareVars", 1) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) #EndRegion ;Include + Opt ;============================================================================= #Region ;GuiVars + FileInstall Global $GUI, $Button_1, $hGraphic, $hGraphic2, $sString, $hFont, $aInfo, $hFormat, $hBrush, $hImage, $hImageR, $hFamily, $tLayout, $IndexDay, $RefreshItem, $wpos Global $ExitItem, $Label, $Label1, $oIE, $oDoc, $oElement1, $oElement2, $StringMid, $Split1, $Split2, $Trim, $Number, $ID, $Pic, $String, $SetString, $CfgFldr Global $IniRIStart, $IniRIEnd, $IniRVStart, $IniRVEnd, $Ping, $clistview, $iLV_Index, $cLV, $Pair, $Value, $1stStart = 1, $iniArray, $CheckBoxRead, $InputRead Global $Day = 0, $WS, $StartWinCheck, $BookTicker, $SplitCoins, $SplitPairData, $WinState = 0, $Iteration = 1, $aArray_Base[1500][2] Global Const $AC_SRC_ALPHA = 1 Global $i_x1 = 0, $i_y1 = 0, $i_x3 = 25, $i_y3 = 25 Global $aMousePos, $aMousePos2, $iMouseOver = 0 Global $InstallDir = @LocalAppDataDir & '\ipma' Global $aProcessList = ProcessList(@ScriptName) If $aProcessList[0][0] >= 2 Then Exit FileInstall("Binance.ico", $InstallDir & '\Binance.ico', 1) #EndRegion ;GuiVars + FileInstall ;============================================================================= #Region ;GUI TraySetIcon("Binance.ico") $GUI = GUICreate('Binance', 800, 520, -1, -1, -1) ;, $WS_EX_TOOLWINDOW) ; $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) GUISetBkColor(0x444444) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") GUISetIcon("Binance.ico") ;============================================================================= Local $CheckBox = GUICtrlCreateCheckbox('Activate Check', 630, 20) Local $InputBox = GUICtrlCreateInput('', 630, 40, 100) ;$CfgFldr = TrayCreateItem("Config Folder") ;TrayItemSetOnEvent(-1, "CfgFolder") $ExitItem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Quit") TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "Window") TraySetState(1) TraySetClick(8) GUISetState(@SW_SHOW) ;WinSetOnTop($GUI, '', 1) #EndRegion ;GUI ;============================================================================= #Region ;Triggers / Listview ;============================================================================= ;$clistview = GUICtrlCreateListView("", 20, 30, 690, 450, BitOR($LVS_DEFAULT, $WS_BORDER), BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) ;============================================================================= #Region ;ListView $clistview = GUICtrlCreateListView("", 10, 10, 600, 500, -1, $LVS_EX_GRIDLINES) ; + $LVS_EX_FULLROWSELECT + $LVS_EX_INFOTIP) ;GUICtrlSetTip($clistview, 'Right Click for options', "Tip", 1) ;GUICtrlSetState($clistview, $GUI_DROPACCEPTED) GUICtrlSetFont($clistview, 9, 600, 0, '', 5) _GUICtrlListView_AddColumn($clistview, "Pair", 100) _GUICtrlListView_AddColumn($clistview, "Latest", 100) _GUICtrlListView_AddColumn($clistview, "Previous1", 100) ;_GUICtrlListView_AddColumn($clistview, "Previous2", 100) ;_GUICtrlListView_AddColumn($clistview, "Previous3", 100) _GUICtrlListView_AddColumn($clistview, "Difference", 100) _GUIScrollBars_Init($clistview) _GUIScrollBars_EnableScrollBar($clistview, $SB_HORZ, $ESB_DISABLE_RIGHT) #EndRegion ;ListView ;============================================================================= ;Global $iLV_Index = _GUIListViewEx_Init($clistview, $cLV, 1, 0xFF0000, True, 32) ;============================================================================= #EndRegion ;Triggers / Listview AdlibRegister("CheckPairs", 5000) ;============================================================================= Func CheckPairs() $BookTicker = _INetGetSource("https://www.binance.com/api/v3/ticker/bookTicker", True) $BookTicker = StringTrimLeft($BookTicker, 2) $SplitCoins = StringSplit($BookTicker, "},{", 1) For $c = 1 To $SplitCoins[0] ;Sleep(10) If StringInStr($SplitCoins[$c], 'BTC","') <> 0 Then $SplitPairData = StringSplit($SplitCoins[$c], ",", 1) $Pair = StringReplace(StringTrimLeft($SplitPairData[1], 10), '"', '') $Value = StringReplace(StringTrimLeft($SplitPairData[2], 12), '"', '') ;ConsoleWrite($Pair & ' - ' & $Value & @CRLF) If $Value <> 0.00000000 Then $aArray_Base[$c][0] = $Pair $aArray_Base[$c][1] = $Value EndIf EndIf Next ;_ArraySort($aArray_Base, 0, 0, 0, 0, 0) ;_ArrayDisplay($aArray_Base) ;============================================================================= For $d = 0 To _GUICtrlListView_GetItemCount($clistview) _GUICtrlListView_SetItemText($clistview, $d, _GUICtrlListView_GetItemText($clistview, $d, 1), 2) Next ;============================================================================= For $ArrS = 1 To UBound($aArray_Base) - 1 ;Sleep(10) If $1stStart = 1 Then If $aArray_Base[$ArrS][0] <> '' Then ;GUICtrlCreateListViewItem($aArray_Base[$ArrS][0] & '|' & $aArray_Base[$ArrS][1] & '|' & 'prev1' & '|' & 'prev2' & '|' & 'prev3' & '|' & 'Difference', $clistview) GUICtrlCreateListViewItem($aArray_Base[$ArrS][0] & '|' & $aArray_Base[$ArrS][1] & '|' & 'prev1' & '|' & 'Difference', $clistview) EndIf Else If $aArray_Base[$ArrS][0] <> '' Then _GUICtrlListView_SetItemText($clistview, $ArrS - 1, $aArray_Base[$ArrS][0], 0) _GUICtrlListView_SetItemText($clistview, $ArrS - 1, $aArray_Base[$ArrS][1], 1) EndIf EndIf Next ;============================================================================= $InputRead = GUICtrlRead($InputBox) $CheckBoxRead = GUICtrlRead($CheckBox, 0) For $d = 0 To _GUICtrlListView_GetItemCount($clistview) - 1 $Current = _GUICtrlListView_GetItemText($clistview, $d, 1) $Prev1 = _GUICtrlListView_GetItemText($clistview, $d, 2) $Result = Round(($Current - $Prev1) / (($Current + $Prev1) / 2) * 100, 2) _GUICtrlListView_SetItemText($clistview, $d, $Result & '%', 3) If $CheckBoxRead = 1 And $InputRead <> '' Then If $Result >= $InputRead And $Result <> 200 Then $GetPair = StringTrimRight(_GUICtrlListView_GetItemText($clistview, $d, 0), 3) Local $sMsg = "The pair :" & $d & " - " & $GetPair & @CRLF & "Increased by " & $Result & '%' Local $iRetValue = _ExtMsgBox($EMB_ICONINFO, "Go to the pair page.|Ignore.", "Select", $sMsg, 20) If $iRetValue = 1 Then ShellExecute('https://www.binance.com/en/trade/' & $GetPair & '_BTC?layout=pro') ElseIf $iRetValue = 2 Then ;MsgBox(64 + 262144, 'Failed', '.' & @CRLF & 'Will close') EndIf EndIf EndIf Next ;============================================================================= $1stStart = 0 Return EndFunc ;==>CheckPairs ;============================================================================= Do ;Main Sleep(100) Until GUIGetMsg() = $GUI_EVENT_CLOSE ;====================================================================================== Func CfgFolder() TrayItemSetState($CfgFldr, $TRAY_UNCHECKED) ShellExecute($InstallDir) EndFunc ;==>CfgFolder ;============================================================================= #Region ;Window ;====================================================================================== Func Window() If $WinState = 0 Then GUISetState(@SW_SHOW, $GUI) $WinState = 1 Else GUISetState(@SW_HIDE, $GUI) $WinState = 0 EndIf EndFunc ;==>Window ;============================================================================= Func Minimize() WinSetState('', '', @SW_MINIMIZE) EndFunc ;==>Minimize ;============================================================================= Func Restore() WinSetState('', '', @SW_RESTORE) EndFunc ;==>Restore ;============================================================================= Func Quit() TrayItemSetState($ExitItem, $TRAY_UNCHECKED) AdlibUnRegister("CheckPairs") _GDIPlus_Shutdown() $StartWinCheck = TrayItemGetState($WS) If $StartWinCheck = 65 Then ;IniWrite($cfg, 'Options', 'StartWithWin', 1) ElseIf $StartWinCheck = 68 Then ;IniWrite($cfg, 'Options', 'StartWithWin', 0) EndIf ;FileDelete('tmp4.ini') ;FileDelete('tmp3.ini') ;FileDelete('tmp2.ini') ;FileDelete('tmp1.ini') Exit EndFunc ;==>Quit #EndRegion ;Window ;============================================================================= Or maybe suggestions on how to do this in a better way. EDIT: Kinda made it work, but its very inefficient, maybe i should drop the ini writing and reading, it's slow. EDIT2: This works, but it's still clunky, causes a bit of a spike on the cpu of 10% or so at each cycle. Thanks in advance
-
careca reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
careca reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
WebDriver UDF - Help & Support (II)
careca replied to Danp2's topic in AutoIt General Help and Support
Hi, im trying to interact with binance.com, i would like to press a button and retrieve a table, but it seems cant do any of that, looked into the demos, but couldn't figure it out. What im trying to do: get into https://www.binance.com/en/markets, press BTC Markets, and get all the values from the table. What i tried so far: #include "wd_core.au3" #include "wd_helper.au3" #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Local $sDesiredCapabilities, $iIndex, $sSession SetupGecko() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.binance.com/en/markets") _WD_LoadWait($sSession, Default, Default, Default) ; Locate a single element $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@class='css-1vs0no5']") ;Button Class, doesn't use name. ; Get element's coordinates $oERect = _WD_ElementAction($sSession, $sElement, 'rect') ConsoleWrite("Element Coords = " & $oERect.Item('x') & " / " & $oERect.Item('y') & " / " & $oERect.Item('width') & " / " & $oERect.Item('height') & @CRLF) ; Click search button $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='BTC Markets']") _WD_ElementAction($sSession, $sButton, 'click') _WD_LoadWait($sSession, 2000) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@class='css-1vs0no5']") $sValue = _WD_ElementAction($sSession, $sElement, 'property', 'value') ConsoleWrite('value = ' & $sValue & @CRLF) MsgBox($MB_ICONINFORMATION, "Demo complete!", "Click ok to shutdown the browser and console") _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupGecko() _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('DriverParams', '--binary "C:\Program Files\Mozilla Firefox\firefox.exe"') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' EndFunc On a side note, i considered getting the source but somehow, the values from the table do not show up in it, i don't understand much about browsers but i guess the table loads in a different manner. -
Check if an Input Box is selected?
careca replied to SupremeNTM's topic in AutoIt General Help and Support
Maybe, another option would be to write directly into the inputbox, or maybe checking for it's existance, but using the control id, if it returns an id. -
mLipok reacted to a file: Power Profiles Tool
-
Best practice to make as standard gui as possible
careca replied to Fenzik's topic in AutoIt GUI Help and Support
Hi, in my opinion you should mess with the common styles only when you have a special need to create a window in a specific way. When you don't have any particular need for a window, you can leave the style alone, and use default/blank. You ask how to create a standard window.. all you really have to do is remove the part on your line past the 600, the Y coordinate, close braket there and leave it. This: GUICreate("Main Gui", 800, 600) PS: your software is replacing the letter i with the y in the words "tried" and "replies", just thought you might want to know. -
Are there many of them? Manual extraction of the path would be a way.
-
Hi, i never used this intelliremote, not sure what it is or what it does, no time atm to investigate about it, but if it runs autoit scripts, you could place the code i gave you there. The code does all by itself, creating the ini, writing to it, and reading from it. At each run it writes the last state, either first or second command, and the next run, it reads the ini, and runs the other command. So try placing the code there, all of it, see it the thing works with it.
-
SouzaRM reacted to a file: String Trigger
-
Hotkeys with multiple letter triggers - (Moved)
careca replied to malicioussoap's topic in AutoIt General Help and Support
I did this, it's stringtrigger, the way i did it, is store the typed keys, and when they match a word i want, something happens, can be starting an app or pasting text, after deleting the trigger word. I think you can do the same, but it's not as simple as you show there. -
Click on item listview - display a button
careca replied to mickdu59's topic in AutoIt General Help and Support
You could add a context menu into the listview, does it really have to be a button? -
need help to do a youtube search using autoit
careca replied to nacerbaaziz's topic in AutoIt General Help and Support
If you mean to get the links from the search results: ;============================================================================= #Region ;Include + Opt #include <IE.au3> #include <ProgressConstants.au3> ;============================================================================= Global $oIE, $Load = 0, $Failed = 0, $Visible = 0 ;Change to show or hide the IE window. Global $oLinks, $iNumLinks, $sTxt, $PrevLink = '' ;============================================================================= QuerySite('chillstep') ;============================================================================= Func QuerySite($Name) $GMarquee = GUICreate("Working", 240, 70, -1, @DesktopHeight / 4) $Progress_1 = GUICtrlCreateProgress(10, 10, 220, 20, 0x0008) $LabelP = GUICtrlCreateLabel('Working...', 10, 40, 100) GUISetState(@SW_SHOW) _ProgressMarquee_Start($Progress_1) ;Start ;============================================================================= $oIE = _IECreate("https://www.youtube.com/results?search_query=" & $Name, 0, $Visible, 0, 0) If $oIE <> @error Then Sleep(2000) Do $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks If StringInStr($oLink.href, 'youtube.com/watch?v=') <> 0 Then If $oLink.href <> $PrevLink Then ConsoleWrite($oLink.href & @CRLF) $PrevLink = $oLink.href EndIf EndIf If StringInStr($oLink.href, 'reporthistory') <> 0 Then ConsoleWrite('Found "about" link'&@CRLF) $Load = 1 ExitLoop EndIf Next Sleep(100) Until $Load = 1 Else _ProgressMarquee_Stop($Progress_1) ;Stop GUIDelete($GMarquee) MsgBox(64 + 262144, 'Failed', 'Error:' & @error & ' in: _IECreate') _IEQuit($oIE) EndIf _ProgressMarquee_Stop($Progress_1) ;Stop GUIDelete($GMarquee) EndFunc ;==>QuerySite ;============================================================================= Func _ProgressMarquee_Start($iControlID) Return GUICtrlSendMsg($iControlID, $PBM_SETMARQUEE, True, 50) EndFunc ;==>_ProgressMarquee_Start ;============================================================================= Func _ProgressMarquee_Stop($iControlID, $fReset = False) Local $fReturn = GUICtrlSendMsg($iControlID, $PBM_SETMARQUEE, False, 50) If $fReturn And $fReset Then GUICtrlSetStyle($iControlID, $PBS_MARQUEE) EndIf Return $fReturn EndFunc ;==>_ProgressMarquee_Stop ;=============================================================================