
sdfaheemuddin
Active Members-
Posts
36 -
Joined
-
Last visited
Everything posted by sdfaheemuddin
-
GDI+ Two lines of text
sdfaheemuddin replied to CodeTinkerer's topic in AutoIt General Help and Support
$Str="string1" & @CRLF & "string2" -
OR statement not working
sdfaheemuddin replied to DigDeep's topic in AutoIt General Help and Support
If $Date > "10" Or $ProcessVer = "2.5" Or $ProcessVer = '2.0' Or Not FileExists("FilePath") Then $Verify = "Appllication not exists." Else $Verify = "Appllication installed successfully." EndIf MsgBox(0, "", $Verify) -
OR statement not working
sdfaheemuddin replied to DigDeep's topic in AutoIt General Help and Support
Can you use If Else statement -
how do i set a hotkey to end a loop?
sdfaheemuddin replied to Derigian's topic in AutoIt General Help and Support
Then SetHotKey("{ESC}","_exit") While 1 $startx = 295 $starty = 353 $x = Int(Random($startx - 20, $startx + 20)) $y = Int(Random($starty - 20, $starty + 20)) MouseClick("left", $x, $y, 1, 0) sleep (2000) $startx = 354 $starty = 131 $x = Int(Random($startx - 20, $startx + 20)) $y = Int(Random($starty - 20, $starty + 20)) MouseClick("left", $x, $y, 1, 0) sleep (2000) $startx = 617 $starty = 157 $x = Int(Random($startx - 20, $startx + 20)) $y = Int(Random($starty - 20, $starty + 20)) MouseClick("left", $x, $y, 1, 0) WEnd Func _exit() Exit EndFunc -
how do i set a hotkey to end a loop?
sdfaheemuddin replied to Derigian's topic in AutoIt General Help and Support
Global $run=True SetHotKey("p","pause") While 1 If $run=False Then ContinueLoop $startx = 295 $starty = 353 $x = Int(Random($startx - 20, $startx + 20)) $y = Int(Random($starty - 20, $starty + 20)) MouseClick("left", $x, $y, 1, 0) sleep (2000) $startx = 354 $starty = 131 $x = Int(Random($startx - 20, $startx + 20)) $y = Int(Random($starty - 20, $starty + 20)) MouseClick("left", $x, $y, 1, 0) sleep (2000) $startx = 617 $starty = 157 $x = Int(Random($startx - 20, $startx + 20)) $y = Int(Random($starty - 20, $starty + 20)) MouseClick("left", $x, $y, 1, 0) WEnd Func pause() $run=Not $run EndFunc This does not end the loop but it skips -
Enter Text in GUICtrlInput and select ENTER
sdfaheemuddin replied to DigDeep's topic in AutoIt General Help and Support
Or $Gui=GUICreate("GUI",300,200,750,350) $combo=GuiCtrlCreateCombo=("",50,50,200,30) GuiCtrlSetData(-1,"Step1|Step2|Step3|Step4|...") $ok=GuiCtrlCreateButton("OK",50,100,75,25) While 1 $nMsg=GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ok $Step=GuiCtrlRead($combo) Call($Step) EndSwitch WEnd Func Step1() Msgbox(0,"","step1") EndFunc Func Step2() Msgbox(0,"","step2") EndFunc Func Step3() Msgbox(0,"","step3") EndFunc Func Step4() Msgbox(0,"","step4") EndFunc -
Enter Text in GUICtrlInput and select ENTER
sdfaheemuddin replied to DigDeep's topic in AutoIt General Help and Support
Can you try it using combo box $Gui=GUICreate("GUI",300,200,750,350) $combo=GuiCtrlCreateCombo=("",50,50,200,30) GuiCtrlSetData(-1,"Step1|Step2|Step3|Step4") $ok=GuiCtrlCreateButton("OK",50,100,75,25) While 1 $nMsg=GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ok $Step=GuiCtrlRead($combo) Switch $Step Case "Step1" Step1() Case "Step2" Step2() Case "Step3" Step3() Case "Step4" Step4() EndSwitch EndSwitch WEnd Func Step1() Msgbox(0,"","step1") EndFunc Func Step2() Msgbox(0,"","step2") EndFunc Func Step3() Msgbox(0,"","step3") EndFunc Func Step4() Msgbox(0,"","step4") EndFunc -
Try This Local $IsConnected=0 While 1 If $IsConnected<>_IsInternetConnected() Then $IsConnected=_IsInternetConnected() If $IsConnected = 0 Then MsgBox(0, "Alert!!!", "F566 Disconnected!!!") ElseIf $IsConnected = 1 Then MsgBox(0, "Alert!!!", "F566 Connected!!!") EndIf EndIf WEnd Func _IsInternetConnected() Local $aReturn = DllCall('connect.dll', 'long', 'IsInternetConnected') If @error Then Return SetError(1, 0, False) EndIf Return $aReturn[0] = 0 EndFunc ;==>_IsInternetConnected
-
ToolTill inside the loop #include <MsgBoxConstants.au3> AutoItSetOption("TrayIconDebug", 1) ;0-off ; Set so that tray displays current line number HotKeySet("{F4}", "ExitProg") HotKeySet("+!d", "StartStop") ; Shift-Alt-d $On = True Adlibregister("cleanup",7200000) While True Sleep(500) ToolTip('Script is "' & $On & '"', 500, 300) WEnd Func cleanup() If $On Then Local $iFreeSpace = DriveSpaceFree("E:" & "\") ; Find the free disk space of the home drive, generally this is the C:\ drive. If $iFreeSpace < 1000 Then ;Less than 1gb $megs = $iFreeSpace * .1024 MsgBox($MB_SYSTEMMODAL, "", "Free Space: " & $megs & " MB") Run("C:\Batch\CleanTemp.bat") EndIf EndIf EndFunc Func StartStop() $On = Not $On EndFunc Func ExitProg() Exit EndFunc If you want to cleanup as soon as shift+alt+d is pressed then call cleanup() in StartStop function
-
Try this include <MsgBoxConstants.au3> AutoItSetOption("TrayIconDebug", 1) ;0-off ; Set so that tray displays current line number HotKeySet("{F4}", "ExitProg") HotKeySet("{F7}", "StartStop") $On = True Adlibregister("cleanup",7200000) While True WEnd Func cleanup()If $On Then Local $iFreeSpace = DriveSpaceFree("E:" & "\") ; Find the free disk space of the home drive, generally this is the C:\ drive. If $iFreeSpace < 1000 Then ;Less than 1gb $megs = $iFreeSpace * .1024 MsgBox($MB_SYSTEMMODAL, "", "Free Space: " & $megs & " MB") Run("C:\Batch\CleanTemp.bat") EndIf EndIf EndFunc Func StartStop() $On = Not $On EndFunc Func ExitProg() Exit EndFunc
-
Imagesearch going out of range
sdfaheemuddin replied to kartune's topic in AutoIt General Help and Support
Try this Func likecone() ;Column 1 check Local $likesearch = _Imagesearcharea ("pic.bmp",0,408,511,799,957,$x,$y,10) If $likesearch = 1 Then MouseMove($x, $y, 10) EndIf EndFunc -
how to control click 4 next buttons in a row
sdfaheemuddin replied to kbabb's topic in AutoIt General Help and Support
Example For x=1 to 4 Winwait("software title") controlclick("software title","","Button1") WinSetTitle ("software title","","Changed title") Next -
how to control click 4 next buttons in a row
sdfaheemuddin replied to kbabb's topic in AutoIt General Help and Support
Better solution Change title of that Windows When the new Windows then click -
how to control click 4 next buttons in a row
sdfaheemuddin replied to kbabb's topic in AutoIt General Help and Support
Text may surely differ Else hidden text -
Button, If unknown error
sdfaheemuddin replied to Villlager's topic in AutoIt General Help and Support
you can just use it without Brackets If GUICtrlRead ($id_user) = "2320012" And GUICtrlRead ($id_pass) = "27199810" Then MsgBox (0,0,0) -
MouseClick skipping "y" coordinate
sdfaheemuddin replied to kjpolker's topic in AutoIt General Help and Support
You can even use msgbox to see till where your code is correct -
Input and button setting data to list.
sdfaheemuddin replied to gottygolly's topic in AutoIt General Help and Support
Add style to your bottom $button = GUICtrlCreateButton ( "Button" , 5 , 30 , 100 , 25, $BS_DEFPUSHBUTTON ) No need of GUICtrlSetOnEvent ($input,"_Input") -
MS Word read whole doc file into var
sdfaheemuddin replied to topten's topic in AutoIt General Help and Support
Use fileopen & fileread functions -
Force Windows CMD to see > in quoted parameter as >
sdfaheemuddin replied to leuce's topic in AutoIt General Help and Support
use msgbox to see how the string looks like $string= @ComSpec & " /c " & '"' & $javapath & '" -jar HTML2TMX.jar "' & $htmlfile & '" "' & $ tmxfile & '" "0>' & $lcodeSL & ',1>' & $lcodeTL & '"' msgbox (0,"test", $string) RunWait($string) -
File size conversion and sum/subtract
sdfaheemuddin replied to Terenz's topic in AutoIt General Help and Support
#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $fItem = -1 Global $actual_size $Form = GUICreate("Form1", 266, 233, 204, 144) $ListView1 = GUICtrlCreateListView("AAA", 8, 8, 250, 150, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT)) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100) $hListView = GUICtrlGetHandle($ListView1) $ListView1_0 = GUICtrlCreateListViewItem("7.03_MB", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("317_byte", $ListView1) $ListView1_2 = GUICtrlCreateListViewItem("113.30_KB", $ListView1) $ListView1_3 = GUICtrlCreateListViewItem("36.61_KB", $ListView1) $ListView1_4 = GUICtrlCreateListViewItem("5.97_MB", $ListView1) $Label = GUICtrlCreateLabel("10000000", 8, 168) _GUICtrlListView_SetItemChecked($ListView1, 0) _GUICtrlListView_SetItemChecked($ListView1, 1) _GUICtrlListView_SetItemChecked($ListView1, 2) _GUICtrlListView_SetItemChecked($ListView1, 3) _GUICtrlListView_SetItemChecked($ListView1, 4) $a = _Convert("7.03_MB") $b = _Convert("317_BYTE") $c = _Convert("113.30_KB") $d = _Convert("36.61_KB") $e = _Convert("5.97_MB") $actual_size=($a + $b + $c + $d + $e) GUICtrlSetData($Label, _Final($actual_size)) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch If $fItem <> -1 Then _Func($fItem) $fItem = -1 EndIf ;==> WEnd Func _Func($fItem) $sTest = _GUICtrlListView_GetItemChecked($ListView1, $fItem) If $sTest = False Then $y = _Convert(_GUICtrlListView_GetItemText($ListView1, $fItem)) $actual_size-=$y ;~ MsgBox(0,$actual_size,$y) GUICtrlSetData($Label, _Final($actual_size)) Else $y = _Convert(_GUICtrlListView_GetItemText($ListView1, $fItem)) $actual_size+=$y ;~ MsgBox(0,$actual_size,$y) GUICtrlSetData($Label, _Final($actual_size)) EndIf EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) Local $iItem = DllStructGetData($tInfo, "Index") $fItem = $iItem EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _Convert($sNumber) Switch StringRight($sNumber, 2) Case "GB" Return StringTrimRight($sNumber, 3) * 2 ^ 30 Case "MB" Return StringTrimRight($sNumber, 3) * 2 ^ 20 Case "KB" Return StringTrimRight($sNumber, 3) * 2 ^ 10 Case Else Return StringTrimRight($sNumber, 3) EndSwitch EndFunc ;==>_Convert Func _Final($iSize) Select Case $iSize >= 2 ^ 30 Return StringRegExpReplace($iSize / 1073741824, "(\.\d{2}).*", "$1") & "_GB" Case $iSize >= 2 ^ 20 Return StringRegExpReplace($iSize / 1048576, "(\.\d{2}).*", "$1") & "_MB" Case $iSize >= 2 ^ 10 Return StringRegExpReplace($iSize / 1024, "(\.\d{2}).*", "$1") & "_KB" Case $iSize >= 0 Return StringRegExpReplace($iSize, "(\.\d{2}).*", "$1") & "_BYTE" EndSelect EndFunc ;==>_Final This is Working but with one error Even if i click just on an item, it sums up or subtracts -
File size conversion and sum/subtract
sdfaheemuddin replied to Terenz's topic in AutoIt General Help and Support
I think StringRegExpReplace ( StringTrimRight ( $sNumber , 3 ) * 1073741824 , "(. d{2}).*" , "$1" ) rounds the number. 'I am not good at stringRegExp' Store the value in a different variable without rounding it. Like $actual_size= StringTrimRight ( $sNumber , 3 ) * 1073741824 StringRegExpReplace ( $ actual_size , "(. d{2}).*" , "$1" ) and instead of _Convert ( GUICtrlRead ( $Label )) use _Convert ( $actual_size) -
pressing other keys while script is running
sdfaheemuddin replied to taipan's topic in AutoIt General Help and Support
use _ispressed UDF Sleep(250) to 1/4 sec pause