4gotn1
Active Members-
Posts
77 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
4gotn1's Achievements
Wayfarer (2/7)
1
Reputation
-
An example to extract any USB's label (name). #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Local $arDrives = DriveGetDrive("ALL"), $USB = Null For $i = 1 to $arDrives[0] If (DriveGetType($arDrives[$i], $DT_BUSTYPE) = "USB") Then $USB = DriveGetLabel($arDrives[$i]) MsgBox($MB_OK, "USB", "Drive: " & $arDrives[$i] & @CRLF & "Label: " & $USB) EndIf Next
-
Surya reacted to a post in a topic:
Utter - Utilizing more of SAPI (Speech Recognition UDF)
-
Utter - Utilizing more of SAPI (Speech Recognition UDF)
4gotn1 replied to Surya's topic in AutoIt Example Scripts
There's no need to re-declare the variable inside the function, just re-initialize it Declaration Global $someVariable = "SomeData" (re)Initialization $someVariable = "SomeOtherData" If you are only twelve for real, keep it up not many kids your age take interest in jack shit these days. Here is a little stroke for your ego, search for my last post here (Hint: I've been lurking a LONG time lol)- 50 replies
-
- how to add grammar
- sapi
-
(and 3 more)
Tagged with:
-
Excel doesn't close after command
4gotn1 replied to lolipop's topic in AutoIt General Help and Support
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <Date.au3> #include <Excel.au3> #include <ListViewConstants.au3> #include <Array.au3> #include <GuiListView.au3> Global $CurrentTime = @HOUR&":"&@MIN;&":"&@SEC Global $CurrentDate = @YEAR&"/"&@MON&"/"&@MDAY Global $ExcelSignOutArray[3] = [$CurrentDate, $CurrentTime, "Sign-Out"] Global $ExcelSignOutArrayWRemark[4] = [$CurrentDate, $CurrentTime, "Sign-Out", "System Auto Sign-Out"] Global $sFilePath = @ScriptDir & "\temp.xls" Create_Form1() Func Create_Form1() $Form1 = GUICreate("XXX", 485, 531, -1, -1) GUISetBkColor(0xFFFFFF) $Form1_Graphic1 = GUICtrlCreateGraphic(0, 0, 490, 161) GUICtrlSetBkColor(-1, 0x9BBB58) $Form1_Label1 = GUICtrlCreateLabel("XXX", 40, 40, 218, 52) GUICtrlSetFont(-1, 27, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFBF0) GUICtrlSetBkColor(-1, 0x9BBB58) $Form1_Label2 = GUICtrlCreateLabel("XXX", 40, 72, 268, 52) GUICtrlSetFont(-1, 27, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFBF0) GUICtrlSetBkColor(-1, 0x9BBB58) $Form1_Label3 = GUICtrlCreateLabel("XXX", 98, 200, 289, 33) GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif") $Form1_Label4 = GUICtrlCreateLabel("XXX", 64, 296, 151, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Form1_Label5 = GUICtrlCreateLabel("XXX", 64, 320, 154, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Form1_Label6 = GUICtrlCreateLabel("XXX", 64, 416, 160, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Form1_Label7 = GUICtrlCreateLabel("XXX", 64, 440, 106, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Form1_Button1 = GUICtrlCreateButton("Button1", 236, 292, 201, 45, $BS_BITMAP) $Form1_Button2 = GUICtrlCreateButton("Button2", 236, 416, 201, 45, $BS_BITMAP) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $Form1_Result1 = MsgBox(52,"", "Are you sure you want to exit?") If $Form1_Result1 = 6 Then Exit Case $msg = $Form1_Button1 GUIDelete($Form1) Create_Form2() ExitLoop Case $msg = $Form1_Button2 GUIDelete($Form1) If ProcessExists("excel.exe") Then ProcessClose("excel.exe") Global $oExcel = _ExcelBookOpen($sFilePath,0) ExcelFindLastRow() Global $ConcatVal = "Sign-In" Global $aFound = _ExcelFindInRange($oExcel, $ConcatVal, "L1:L"&$iLastRow) ;Found the total number of row with $ConcatVal keyword Global $TotalSignIn = $aFound[0][0] $i = 1 While $i <= $TotalSignIn Global $SelectedRow = $aFound[$i][3] Global $AutoSignOutDateDiffData = _ExcelReadArray($oExcel, $SelectedRow, 1, 13, 0);The individual column data respective to $TotalSignIn $ConvertYear = StringMid ($AutoSignOutDateDiffData[7], 1, 4) $ConvertMonth = StringMid ($AutoSignOutDateDiffData[7], 5, 2) $ConvertDate = StringMid ($AutoSignOutDateDiffData[7], 7, 2) $CombineDate = $ConvertYear&"/"&$ConvertMonth&"/"&$ConvertDate $AutoSignOutDateDiff = _DateDiff("D", $CombineDate, _NowCalcDate()) If $AutoSignOutDateDiff >= 1 Then _ExcelWriteArray($oExcel, ($aFound[$i][3]), 10, $ExcelSignOutArrayWRemark, 0) EndIf $i = $i + 1 WEnd _ExcelBookClose($oExcel,1) Create_Form3() ExitLoop EndSelect WEnd EndFunc Func Create_Form3() $Form3 = GUICreate("X", 485, 531, -1, -1) GUISetBkColor(0xFFFFFF) $Form3_Graphic1 = GUICtrlCreateGraphic(0, 0, 490, 161) GUICtrlSetBkColor(-1, 0x9BBB58) $Form3_Label1 = GUICtrlCreateLabel("X", 40, 40, 218, 52) GUICtrlSetFont(-1, 27, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFBF0) GUICtrlSetBkColor(-1, 0x9BBB58) $Form3_Label2 = GUICtrlCreateLabel("X", 40, 72, 268, 52) GUICtrlSetFont(-1, 27, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFBF0) GUICtrlSetBkColor(-1, 0x9BBB58) Global $Form3_ListView1 = GUICtrlCreateListView("1|2|3|4|5", 0, 161, 485, 250, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SINGLESEL,$LVS_NOSORTHEADER), $LVS_EX_FULLROWSELECT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 35) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 130) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 90) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 130) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 100) $Form3_Button4 = GUICtrlCreateButton("Button4", 145, 420, 201, 45, $BS_BITMAP) $Form3_Button3 = GUICtrlCreateButton("Button3", 8, 496, 73, 30, $BS_BITMAP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE $Form3__Result1 = MsgBox(52,"", "Are you sure you want to exit?") If $Form3__Result1 = 6 Then Exit Case $Form3_Button4 GUIDelete($Form3) Create_Form1() ExitLoop Case $Form3_Button3 GUIDelete($Form3) Create_Form1() ExitLoop EndSwitch WEnd EndFunc Func ExcelFindLastRow() $oExcel1 = ObjGet($sFilePath, "Excel.Application") $oSheet = $oExcel1.ActiveSheet Global $iLastRow = $oSheet.Cells.Find('*', $oSheet.Cells(1, 1), Default, Default, 1, 2).Row EndFunc Func _ExcelFindInRange($oExcel, $sFindWhat, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1, $iDataType = 0, $iWholeOrPart = 2, $fMatchCase = False, $fMatchFormat = "") Local $iCount, $sA1, $sR1C1, $sFound, $Temp1, $Temp2, $sFirst If NOT IsObj($oExcel) Then Return SetError(1, 0, 0) If $iDataType <> 0 Then If $iDataType <> -4163 Or $iDataType <> -4123 Or $iDataType <> -4144 Then Return SetError(4, 0, 0) EndIf EndIf If $iWholeOrPart < 1 Or $iWholeOrPart > 2 Then Return SetError(5, 0, 0) If NOT StringRegExp($sRangeOrRowStart, "[A-Z,a-z]", 0) Then If $sRangeOrRowStart < 1 Then Return SetError(2, 0, 0) If $iColStart < 1 Then Return SetError(2, 1, 0) If $iRowEnd < $sRangeOrRowStart Then Return SetError(3, 0, 0) If $iColEnd < $iColStart Then Return SetError(3, 1, 0) $oExcel.Range($oExcel.Cells($sRangeOrRowStart, $iColStart), $oExcel.Cells($iRowEnd, $iColEnd)).Select Else $oExcel.Range($sRangeOrRowStart).Select EndIf If $iDataType = 0 Then If $fMatchFormat = "" Then $oFound = $oExcel.Selection.Find($sFindWhat, $oExcel.ActiveCell, Default, $iWholeOrPart, Default, Default, $fMatchCase, Default) Else $oFound = $oExcel.Selection.Find($sFindWhat, $oExcel.ActiveCell, Default, $iWholeOrPart, Default, Default, $fMatchCase, Default, $fMatchFormat) EndIf Else If $fMatchFormat = "" Then $oFound = $oExcel.Selection.Find($sFindWhat, $oExcel.ActiveCell, $iDataType, $iWholeOrPart, Default, Default, $fMatchCase, Default) Else $oFound = $oExcel.Selection.Find($sFindWhat, $oExcel.ActiveCell, $iDataType, $iWholeOrPart, Default, Default, $fMatchCase, Default, $fMatchFormat) EndIf EndIf If IsObj($oFound) Then $oFound.Activate Else Local $aFound[1][1] $aFound[0][0] = 0 Return $aFound EndIf While 1 If $iCount > 0 And $iCount < 2 Then $sFirst = $sA1 $Temp1 = $oExcel.ActiveCell.Address $Temp2 = $oExcel.ActiveCell.Address(True, True, $xlR1C1) If $Temp1 = $sFirst Then ExitLoop If $iCount > 0 Then $sA1 = $sA1 & "*" & $Temp1 $sR1C1 = $sR1C1 & "*" & $Temp2 Else $sA1 = $Temp1 $sR1C1 = $Temp2 EndIf $iCount += 1 $oExcel.Selection.FindNext($oExcel.ActiveCell).Activate WEnd Local $aFound[$iCount + 1][4] $sA1 = StringReplace($sA1, "$", "") Local $aA1 = StringSplit($sA1, "*") Local $aR1C1 = StringSplit($sR1C1, "*") $aFound[0][0] = $iCount For $xx = 1 To $iCount $aFound[$xx][0] = $aA1[$xx] $aFound[$xx][1] = $aR1C1[$xx] $Temp1 = StringRegExp($aR1C1[$xx], "[RZ]([^CS]*)[CS](.*)",3) $aFound[$xx][2] = Number($Temp1[1]) $aFound[$xx][3] = Number($Temp1[0]) Next Return $aFound _ExcelBookClose($oExcel, 1, 0) EndFunc Something like this should kill excel.exe when you hit "Button 2". You'll have to elaborate on the temp.xls however. -Cheers -
help with grind macro for 9Dragons
4gotn1 replied to k4niv4's topic in AutoIt General Help and Support
yes game guard will block autoit and most if not all other macro programs... you will have to find a way to disable gameguard.... -
cjconstanine has a good idea, you could even go as far as just adding the new array field at time of character creation
-
YEs its very possible, but it will probably all be done "Visually" not behind the scenes ( I.E. program opens a browser window and manually inserts the information into the port forwarding part of your router )... It could very well be done by sending POST / GET information, but im not familiar with that
-
Well you'll want to look into the TCP functions, start by building a small server / client system and expand upon that
-
do you remove the port forwarding after you play the game or what? cause you should only have to forward it once ^^
-
I don't think you understand what port forwarding is If there is scripts designed to set up port forwarding most likely they are customised to the workstation and router/hub they connect to.... If you are unfamiliar with port forwarding take a look at this: http://en.wikipedia.org/wiki/Port_forwarding
-
dam my comp went dumb and dev beat me to it but here's what i did Dim $Mouse HotKeySet("{F5}", "_Terminate") While 1 $Mouse = MouseGetPos() TrayTip("", "X: "& $Mouse[0] & " Y: "& $Mouse[1], 0) ;or you could do ;ToolTip("X: "& $Mouse[0] &" Y: "& $Mouse[1], $Mouse[0] + 10, $Mouse[1] + 10) Sleep(20) WEnd Func _Terminate() Exit EndFunc ;==> _Terminate()
-
How great is the interest in some extra Math UDF's?
4gotn1 replied to JSThePatriot's topic in AutoIt Example Scripts
#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.1.14 (beta) Author: 4gotn1 Script Function: Tests if a number is even or odd. Returns 1 - If the number is even. Returns 2 - If the number is odd. #ce ---------------------------------------------------------------------------- Func _IsEven($eVal) Local $a = $eVal / 2 Select Case Round($a, 0) = $a Return 1 Case Round($a, 0) <> $a Return 0 EndSelect EndFunc #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.1.14 (beta) Author: 4gotn1 Script Function: Returns Pi of a circle #ce ---------------------------------------------------------------------------- Func _Pi($cRadius) $Sqrd = $cRadius * $cRadius Dim $vNum = ( 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609 * $Sqrd ) Dim $rNum = Round( $vNum, 12 ) Return $rNum EndFunc #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.1.14 (beta) Author: 4gotn1 Script Function: Converts to _Celcius and to _Fahrenheit Usage: _Celcius(32) will convert to 0 degrees celcius _Fahrenheit(0) will convert to 32 degrees fahrenheit Returns: The converted temperature #ce ---------------------------------------------------------------------------- Func _Celcius($fTemp) Local $Decimal = 5 / 9 Local $cTemp = $Decimal * ($fTemp - 32) Local $tNum = Round($cTemp, 2) Return $tNum EndFunc Func _Fahrenheit($cTemp) Local $Decimal = 9 / 5 Local $fTemp = ($cTemp * $Decimal) + 32 Local $tNum = Round($fTemp, 2) Return $tNum EndFunc Here's a quick _IsEven() and _Pi() i made a while ago -edit- Got bored, added a Fahrenheit and Celcius conversion func(s) too -
oIE - Check if user goes to google.com
4gotn1 replied to _Kurt's topic in AutoIt General Help and Support
If StringInStr($oIE.LocationURL, "www.google.com") Then MsgBox(0, "Test", "Hurray! It Worked!") EndIf -edit- This is how to do the same thing, without #include <IE.au3> -
hover over your tray icon when the program gets hung ( using the Opt("TrayIconDebug", 1) line ) that will give you the debugging message(s)
-
#include <GUIConstants.au3> $oIE = ObjCreate("Shell.Explorer.2") GUICreate ("24 Help", @DesktopWidth, @DesktopHeight, 0, 0, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj ( $oIE, 10, 40 , @DesktopHeight, @DesktopWidth) $GUI_Button_Back = GuiCtrlCreateButton ("Back", 5, 3, 100, 30) $GUI_Button_Forward = GuiCtrlCreateButton ("Forward", 105, 3, 100, 30) $GUI_Button_Home = GuiCtrlCreateButton ("Home", 205, 3, 100, 30) $GUI_Button_Stop = GuiCtrlCreateButton ("Stop", 305, 3, 100, 30) GUISetState () $oIE.navigate("www.google.nl") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_Button_Home $oIE.navigate("www.tweakers.net") Do Sleep(1) Until NOT $oIE.Busy ;or you could do Until $oIE.ReadyState = 4 ;) Case $msg = $GUI_Button_Back $oIE.GoBack Case $msg = $GUI_Button_Forward $oIE.GoForward Case $msg = $GUI_Button_Stop $oIE.Stop EndSelect Wend GUIDelete () Exit oÝ÷ Ú(Z½éuæ°y¶ë£®ë"®¶jwH#¡¸ÞrÛ-¢Ê°jyÚ$jÙ²²«qç(uè^è¬jX§Ú-ëh¦'.®