Leaderboard
Popular Content
Showing content with the highest reputation on 01/14/2016 in all areas
-
I think this is an excellent piece for how every part is broken out, and reasonably named. Getting novices and kids involved in scripting by having easily swap-able resources is great work, even if it was your early work. Swapping out 'thrust.wav' with 'pelvicthrust.wav' is too easy, but hilarious. swapping the func names 'alien_ship_draw' and 'Human_Spaceship' - where you get to fly as the alien ship, but with the alien ships weird physics and lack of collision, and you lose when the human_ship comes in and crashes into an asteroid because it still has your properties, is a little more fun.1 point
-
[GAME] AUTOITEROIDS v1.019 Build 2016-01-14 Final
argumentum reacted to mLipok for a topic
this old link is not actuall http://games.atari.com/arcade.php?game=asteroids here is new https://www.atari.com/arcade#!/arcade/asteroids/play1 point -
Uploaded new version. Please test it again. Nothing changed in initial code - only those two issues were fixed!1 point
-
also stdout may help #include <AutoItConstants.au3> $sCommands = "ipconfig /all" $iPID = Run(@ComSpec & " /c " & $sCommands, "", @SW_HIDE , $stdout_child) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd msgbox(0, '' , $sOutput)1 point
-
StdoutRead(...) StringRegExp(...)hint: StderrRead shows better example how to use StdoutRead1 point
-
Autoit get a specific element in the array
electrons reacted to JLogan3o13 for a topic
@Renderer we have a Wiki page that covers this very topic... https://www.autoitscript.com/wiki/Arrays1 point -
[SOLVED] GUI with command line options
Skysnake reacted to JLogan3o13 for a topic
This is by no means a finished script, as you didn't specify what you were trying to do in your gui (I took an educated guess with font and icon). But this should give you an idea: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Local $font, $icon Switch $CmdLine[0] Case 1 $font = $CmdLine[1] Case 2 $font = $CmdLine[1] $icon = $CmdLine[2] Case Else Exit(MsgBox($MB_ICONERROR, "My App", "Incorrect Number of Parameters")) EndSwitch $hGUI = GUICreate("Test", 300, 300) GUISetFont(11, 400, Default, ($font = Null) ? "Arial" : $font) ;Set font to Arial unless otherwise specified. GUISetState(@SW_SHOW) $inp = GUICtrlCreateInput("Test Font", 10, 20, 280, 40) $icon = GUICtrlCreatePic(($icon = "") ? @DesktopDir & "\Error.jpg" : $icon, 10, 80, 280, 200) ;Set pic path unless otherwise specified. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd1 point -
How to convert this array to this
GordonFreeman reacted to Danyfirex for a topic
Just for fun... #include <Array.au3> Global $aNamesID[10][2] = _ [["Stephany", 9851] _ , ["Franklin", 3001] _ , ["Lisa", 9851] _ , ["Dylan", 9851] _ , ["Ashley", 3001] _ , ["Jimmy", 2115] _ , ["Hilary", 2115] _ , ["Johnson", 2115] _ , ["Eno", 1500] _ , ["Gal", 2115]] _ArrayDisplay($aNamesID) Local $aNewArray[0][0] Local $aFound = 0 Local $iFlagIndex = 0 local $iMaxIndex = 0 Local $c = 0 For $i = 0 To UBound($aNamesID) - 1 $iMaxIndex = _ArrayMax($aNamesID, 1, Default, Default, 1) $aFound = _ArrayFindAll($aNamesID, $iMaxIndex, 0, 0, 0, 0, 1) ;_ArrayDisplay($aFound) If IsArray($aFound) Then ReDim $aNewArray[UBound($aNewArray, 1) + 1][UBound($aNewArray, 2)] If UBound($aNewArray, 2) < UBound($aFound) Then ReDim $aNewArray[UBound($aNewArray, 1)][UBound($aFound)] For $x = 0 To UBound($aFound) - 1 $aNewArray[UBound($aNewArray, 1) - 1][$x] = $aNamesID[Int($aFound[$x])][0] $aNamesID[Int($aFound[$x])][1] = Null Next $iFlagIndex += UBound($aFound) EndIf If $iFlagIndex = UBound($aNamesID, 1) Then ExitLoop Next _ArrayDisplay($aNewArray)Saludos1 point -
Minesweeper (source released)
AJLBarroso reacted to AlmarM for a topic
Hey! Prepare to be amazed! Instead of writing a bot for Minesweeper, I created the game itself! Source status Released! Check downloads! Screenshots Any tips, feedback, comments, features would be great! EDIT (22-11-2010): Increased timer input widthFixed "Win/Lose" label textFixed the 'first-click-game-over' bug.EDIT (23-11-2010): Added IconFixed a few problemsEDIT (26-11-2010): Added flag system (needs testing, feedback appreciated)Fixed some bugsDecided to release source in a few updates.Note: I tried creating a mouseOverHover effect, but it results in a massive lag (wich gets worse everytime you start a new game). EDIT (29-11-2010): Fixed some bugsAdded second SkinPackIncluded source, check 'Downloads'EDIT (11-12-2013): Updated the download links Downloads The source code can now be found in the attached files. Minesweeper Source Code.zip1 point -
Sense key presses in specific order without GUI
Melba23 reacted to InunoTaishou for a topic
Why does your script need to sense keys in a specific order? What you're asking about is pretty much a keylogger and you won't get any help with writing one of those from this forum.1 point -
Virtualbox and snapshot
JohnOne reacted to JLogan3o13 for a topic
Yes, the first snapshot should be your "base image". Then when you have everything configured as you see fit, take another snapshot from the current state so you have something to revert to once you want to roll back changes.1 point -
31290, Here is LarsJ's code integrated into mine - I enjoyed doing that: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StringConstants.au3> #include <Array.au3> #include <GuiListView.au3> ; Read file and replace tabs $sContent = StringReplace(FileRead("EPES18.txt"), @TAB, " ") ; Replace orphaned dashes $sNoDashes = StringReplace($sContent, " - ", " ") ; Expand possible single space before connection status $sExpanded = StringRegExpReplace($sNoDashes, "(\x20(connected|notconnect|err-disabled))", " $1") ; Replace multiple spaces with | delimiter - max 19 to allow for empty fields $sDelimed = StringRegExpReplace($sExpanded, "(\x20{2,19})", "|") ; Split on @CRLF $aLines = StringSplit($sDelimed, @CRLF, $STR_ENTIRESPLIT) ;_ArrayDisplay($aLines, "", Default, 8) $hGUI = GUICreate("Test", 500, 500) ; Create ListView with first 4 headers $cLV = GUICtrlCreateListView(StringRegExpReplace($aLines[1], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), 10, 10, 480, 380) ; Set column widths For $i = 0 To 3 _GUICtrlListView_SetColumnWidth($cLV, $i, 110) Next ; Add content of first 4 fields in each line For $i = 2 To $aLines[0] $cLVItem = GUICtrlCreateListViewItem(StringRegExpReplace($aLines[$i], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), $cLV) Next GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") GUISetState() ; Set sort state Local $aSortSense[_GUICtrlListView_GetColumnCount($cLV)] While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $imsg, $wParam, $lParam) ; Struct = $tagNMHDR and "int Item;int SubItem" from $tagNMLISTVIEW Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If @error Then Return Local $iCode = BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) Switch $iCode Case $LVN_COLUMNCLICK ; Get column index Local $iCol = DllStructGetData($tStruct, 5) If $iCol <> 0 Then ; Sort column _GUICtrlListView_SimpleSort($cLV, $aSortSense, $iCol) EndIf Case $NM_DBLCLK $iRow = DllStructGetData($tStruct, 4) ; Row 0 in ListView is row 2 in the array $sData = $aLines[$iRow + 2] ; Split $aData = StringSplit($sData, "|") ConsoleWrite("Row Data: " & $aData[1] & " - " & $aData[2] & " - " & $aData[3] & " - " & $aData[4] & @CRLF) Case $NM_CUSTOMDRAW Local $tNMLVCUSTOMDRAW = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $dwDrawStage = DllStructGetData($tNMLVCUSTOMDRAW, "dwDrawStage") Switch $dwDrawStage ; Holds a value that specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins Return $CDRF_NOTIFYITEMDRAW ; Notify the parent window of any item-related drawing operations Case $CDDS_ITEMPREPAINT ; Before painting an item Return $CDRF_NOTIFYSUBITEMDRAW ; Notify the parent window of any subitem-related drawing operations Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM) ; Before painting a subitem Local $iItem = DllStructGetData($tNMLVCUSTOMDRAW, "dwItemSpec") ; Item index Local $iSubItem = DllStructGetData($tNMLVCUSTOMDRAW, "iSubItem") ; Subitem index ; Gte text of item $sText = _GUICtrlListView_GetItemText($cLV, $iItem, $iSubItem) ; Set default back colour $iBkColour = 0xC0B0B0 ; Now check for our spoecific items Switch $iSubItem Case 2 ; connection Switch $sText Case "connected" $iBkColour = 0x00FF00 Case "notconnect" $iBkColour = 0x0000FF Case "err-disabled" $iBkColour = 0xC4C4C4 EndSwitch Case 3 ; vlan Switch $sText Case "trunk" $iBkColour = 0x00FFFF Case "1" $iBkColour = 0xFFFF00 Case "10" $iBkColour = 0xC4FFC4 Case "13" $iBkColour = 0xFF00FF EndSwitch EndSwitch ; Set required back colour DllStructSetData($tNMLVCUSTOMDRAW, "ClrTextBk", $iBkColour) Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch EndSwitch EndFunc ;==>_WM_NOTIFY It looks as if the file parsing could do with a bit more work - there are a couple of lines where the delimiters are not correct. It does not help that the file uses a mixture of spaces and tabs to separate the items on each line - and on some lines there are items missing. Can you get the file in a more reasonable CSV format or are you stuck with what you have posted? M23 Edit: Recoded the file parsing - it now works for the test file, but I would still recommend trying to get a better delimited file initially as the parsing requirements are a bit arbitrary at the moment.1 point
-
31290, This should get you started: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Array.au3> #include <GuiListView.au3> ; Read file and replace tabs $sContent = StringReplace(FileRead("EPES18.txt"), @TAB, " ") ; Expand possible single space before connection status $sExpanded = StringRegExpReplace($sContent, "(\x20(connected|notconnect|err-disabled))", " $1") ; Replace multiple spaces with | delimiter - max 19 to allow for empty fields $sDelimed = StringRegExpReplace($sExpanded, "(\x20{2,19})", "|") ; Split on @CRLF $aLines = StringSplit($sDelimed, @CRLF, $STR_ENTIRESPLIT) ;_ArrayDisplay($aLines, "", Default, 8) $hGUI = GUICreate("Test", 500, 500) ; Create ListView with first 4 headers $cLV = GUICtrlCreateListView(StringRegExpReplace($aLines[1], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), 10, 10, 480, 380) GUICtrlSetBkColor($cLV, 0x808080) ; Set column widths For $i = 0 To 3 _GUICtrlListView_SetColumnWidth($cLV, $i, 110) Next ; Add content of first 4 fields in each line For $i = 2 To $aLines[0] $cLVItem = GUICtrlCreateListViewItem(StringRegExpReplace($alines[$i], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), $cLV) ; Colour according to status If StringInStr($alines[$i], "|connected|") Then GUICtrlSetColor($cLVItem, 0x00FF00) ElseIf StringInStr($alines[$i], "|notconnect|") Then GUICtrlSetColor($cLVItem, 0xFF0000) Else GUICtrlSetColor($cLVItem, 0xC4C4C4) EndIf Next GUISetState() ; Set sort state Local $aSortSense[_GUICtrlListView_GetColumnCount($cLV)] GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $imsg, $wParam, $lParam) ; Struct = $tagNMHDR and "int Item;int SubItem" from $tagNMLISTVIEW Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If @error Then Return Local $iCode = BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) Switch $iCode Case $LVN_COLUMNCLICK ; Get column index Local $iCol = DllStructGetData($tStruct, 5) ; Sort column _GUICtrlListView_SimpleSort($cLV, $aSortSense, $iCol) Case $NM_DBLCLK $iRow = DllStructGetData($tStruct, 4) ; Row 0 in ListView is row 2 in the array MsgBox($MB_SYSTEMMODAL, "Row Data", $aLines[$iRow + 2]) EndSwitch EndFunc M23 Edit; I amended the file slightly to add some "err-disabled" lines:1 point
-
PEscobar, As all you seem to ask about are gamebots, and now you have decided to grossly insult us all when offered pointers to answers that are easily available in the Help file, I think it best that you do indeed "quit the AutoIt forums". And to help you with this admirable desire, I will now ensure that you do. M231 point
-
For login you can use standard _ie.au3 UDF use _IE... functions. But I see you are talking about Flash. Can you be more specyfic ? btw. Welcome to the forum.1 point
-
Forum Rules
edenwheeler reacted to Jon for a topic
We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.1 point