Jump to content

sdfaheemuddin

Active Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by sdfaheemuddin

  1. $Str="string1" & @CRLF & "string2"
  2. 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)
  3. Can you use If Else statement
  4. 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
  5. 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
  6. 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
  7. 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
  8. Then #include<> Local $IsConnected=0 While 1 If $IsConnected<>_WinApi_IsInternetConnected() Then $IsConnected=_WinApi_IsInternetConnected() If $IsConnected = 0 Then MsgBox(0, "Alert!!!", "F566 Disconnected!!!") ElseIf $IsConnected = 1 Then MsgBox(0, "Alert!!!", "F566 Connected!!!") EndIf EndIf WEnd
  9. 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
  10. 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
  11. 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
  12. Try WinWaitActive("Education Software 2014 December") WinSetTitle(" Education Software 2014 December","","New Title") Send("some keys") ; or controlclick WinWaitActive("Education Software 2014 December") WinSetTitle(" Education Software 2014 December","","New Title") Send("some keys") .. .. ..
  13. 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
  14. Example For x=1 to 4 Winwait("software title") controlclick("software title","","Button1") WinSetTitle ("software title","","Changed title") Next
  15. Better solution Change title of that Windows When the new Windows then click
  16. Text may surely differ Else hidden text
  17. you can just use it without Brackets If GUICtrlRead ($id_user) = "2320012" And GUICtrlRead ($id_pass) = "27199810" Then MsgBox (0,0,0)
  18. You can even use msgbox to see till where your code is correct
  19. Add style to your bottom $button = GUICtrlCreateButton ( "Button" , 5 , 30 , 100 , 25, $BS_DEFPUSHBUTTON ) No need of GUICtrlSetOnEvent ($input,"_Input")
  20. Use fileopen & fileread functions
  21. 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)
  22. #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
  23. 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)
  24. use _ispressed UDF Sleep(250) to 1/4 sec pause
×
×
  • Create New...