All Activity

This stream auto-updates   

  1. Past hour
  2. @UEZ: Thank you again !! It works sooo goooood
  3. Yesterday
  4. WOW, I feel like a moron now. Looked at that for an hour. Always good to have a second set of eyes. Thanks.
  5. Any help to fix this error? #NoTrayIcon #RequireAdmin #include <Constants.au3> #include <GUIConstants.au3> #include <WinAPI.au3> #include <Security.au3> #include <APIResConstants.au3> #include <WinAPIRes.au3> #include <WinAPIMisc.au3> #include <String.au3> Opt("WinWaitDelay", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) Opt("MouseClickDragDelay", 0) Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 0) Opt("WinTitleMatchMode", 3) ; msdn.microsoft.com/en-us/library/windows/desktop/ff468906%28v=vs.85%29.aspx $hUpdate = _WinAPI_BeginUpdateResource(@WindowsDir & '\en-US\explorer.exe.mui') $tMenuHeader = DllStructCreate('ushort wVersion;ushort cbHeaderSize;') _WinAPI_UpdateResource($hUpdate, $RT_MENU, 205, 1033, DllStructGetPtr($tMenuHeader), DllStructGetSize($tMenuHeader)) _WinAPI_UpdateResource($hUpdate, $RT_MENU, 206, 1033, DllStructGetPtr($tMenuHeader), DllStructGetSize($tMenuHeader)) _WinAPI_UpdateResource($hUpdate, $RT_MENU, 213, 1033, DllStructGetPtr($tMenuHeader), DllStructGetSize($tMenuHeader)) MsgBox(0,_WinAPI_GetLastError(),'end') _WinAPI_EndUpdateResource($hUpdate) Exit
  6. Ghostmaster, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. M23
  7. Try something like this here: ;************FOR GATHER HTML SOURCE CODE********************** #include <IE.au3> #include <InetConstants.au3> ;************FOR GUI*********** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIFiles.au3> ;**********FOR BUTTON ********** #include <ButtonConstants.au3> #include <StaticConstants.au3> ;**********FOR STRINGS ********** #include <StringConstants.au3> #include <String.au3> ;**********FOR COMBOBOX ********** #include <StringConstants.au3> #include <EditConstants.au3> #include <GuiEdit.au3> #include <GuiComboBox.au3> ;**********FOR FONTS ********** #include <FontConstants.au3> ;**********FOR PROCESS ********** #include <Process.au3> #include <SendMessage.au3> #include <GDIPlus.au3> #include <WinAPIDiag.au3> Opt("GUIOnEventMode",1) Global Const $SC_DRAGMOVE = 0xF012 Global $hGUIAccountCreator Global $graphics_path = @ScriptDir ;& "\graphics" Global $fontSize_TextBody = 8.5, $fontName_TextBody = "", $fontWeight_TextBody = $FW_BOLD, $fontColor_TextBody = 0x5A2800 GUI_open_AccountCreator() Func GUI_open_AccountCreator() Global $hGUIAccountCreator = GUICreate("Tibia Account Creator - SubZero", 350, 400, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close_AccountCreator") GUICtrlCreatePic($graphics_path & "\WindowAccountCreator.gif", 0, 0, 350, 400) GUICtrlSetState(-1, $GUI_DISABLE) ;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) ********************************************************************** GUICtrlCreateLabel(" Create New Account", 25,47,103,14,$SS_CENTERIMAGE) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0xFFFFFF) GUICtrlCreateLabel("Account Name:",30,75,75,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_Acc = GUICtrlCreateInput("",130,75,150,20) GUICtrlCreateLabel("Email Adress:",30,100,70,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_Email = GUICtrlCreateInput("",130,100,150,20) GUICtrlCreateLabel("Password:",30,125,55,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_Passwd = GUICtrlCreateInput("",130,125,150,20,$ES_PASSWORD) GUICtrlSetData($inptBox_Passwd, "") GUICtrlCreateLabel("Character Name:",30,170,83,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_CharName = GUICtrlCreateInput("",130,170,150,20) GUICtrlCreateLabel("Sex:",30,195,23,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,$fontColor_TextBody) Global $comboBox_sex = GUICtrlCreateCombo("",130,195,150,20,$CBS_DROPDOWNLIST) ;LoadSexIntoComboBox() GUICtrlCreateLabel("World Location:",30,240,77) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,$fontColor_TextBody) Global $comboBox_world = GUICtrlCreateCombo("",130,240,150,20,BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL)) ;LoadWorldsIntoComboBox() Global $label_status = GUICtrlCreateLabel("",20,360,200,30) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) ********************************************************************** ;********* CONTROL PICS ********************************************************************** Global $btn_randAccName = GUICtrlCreatePic("", 280, 75) GUICtrlSetTip($btn_randAccName, "Generate a random account name") GUICtrlSetCursor($btn_randAccName,0) ;GUICtrlSetOnEvent($btn_randAccName,"GenerateRandomAccName") GUICtrlSetOnEvent($btn_randAccName,"GUIChangeImage") Global $btn_x = GUICtrlCreatePic("", 315, 5, 40, 36) GUICtrlSetTip($btn_x, "Close") GUICtrlSetCursor($btn_x,0) GUICtrlSetOnEvent($btn_x,"GUI_Close_AccountCreator") Global $btn_donate = GUICtrlCreatePic("", 112, 313, 126, 47) GUICtrlSetTip($btn_donate, "Donate") GUICtrlSetCursor($btn_donate,0) ;GUICtrlSetOnEvent($btn_donate,"Donate") ;********* CONTROL PICS ********************************************************************** ;********* GDI+ DRAW ********************************************************************** _GDIPlus_Startup() Global $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\X_Tic-Tac-Toe_Token.gif") Global $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_x, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) Global $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\btn_donateCC_LG.gif") Global $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_donate, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) Global $aGIFs[6] For $i = 2 To 5 $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame" & $i & ".gif") $aGIFs[$i - 1] = _GDIPlus_Convert2HBitmap($hImg, 0xD4C0A1, 32, 32) _GDIPlus_ImageDispose($hImg) Next $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Static.gif") $aGIFs[0] = _GDIPlus_Convert2HBitmap($hImg, 0xD4C0A1, 32, 32) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $aGIFs[0])) _GDIPlus_ImageDispose($hImg) _GDIPlus_Shutdown() ;********* GDI+ DRAW ********************************************************************** _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) GUISetIcon(@ScriptDir & "\TibiaInfo.ico") GUISetState(@SW_SHOW, $hGUIAccountCreator) WinSetOnTop($hGUIAccountCreator,"",1) GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN") EndFunc Func GUIChangeImage() For $i = 1 to 4 _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $aGIFs[$i])) Sleep(200) Next _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $aGIFs[0])) EndFunc Func GUI_Close_AccountCreator() For $i = 0 To 5 _WinAPI_DeleteObject($aGIFs[$i]) Next Exit EndFunc Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hGUIAccountCreator, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc While 1 Sleep(100) WEnd Func _GDIPlus_Convert2HBitmap($hBitmap, $iBgColor, $iNewW = 0, $iNewH = 0) Local $iWidth, $iHeight If $iNewW Then $iWidth = $iNewW Else $iWidth = _GDIPlus_ImageGetWidth($hBitmap) EndIf If $iNewH Then $iHeight = $iNewH Else $iHeight = _GDIPlus_ImageGetHeight($hBitmap) EndIf Local $hBitmap_new = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;$aResult[6] Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_new) _GDIPlus_GraphicsSetPixelOffsetMode($hCtx_new, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iBgColor) _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_new) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BitmapDispose($hBitmap_new) _GDIPlus_GraphicsDispose($hCtx_new) Return $hHBITMAP EndFunc ;==>_GDIPlus_Convert2HBitmap
  8. Weird then we cannot call gettype or tostring on this one   $objPsCollection = $pObjectPS.EndInvoke($objAsync)
  9. You need to pass your array as first parameter to _ArraySort function. EDIT: $viIndex should probably be the fifth param
  10. I'm trying to write a function that takes a 2D Array and a certain Index to calculate a median of that index Func _ArrayMedian ($vaArray, $viIndex) ; Returns the median of the column of data asked for ; Assumes Array sends array dimentions in [0][0] = Rows [0][1] = Columns Local $X ; Counter Local $vsSum ; Sum of data _ArraySort(0, 0, 1, $viIndex) ; Sort Array by the index If $vaArray[0][0] = 0 Then ; Array empty Return 0 ElseIf Mod($vaArray[0][0], 2) = 0 Then ; Array has even number Return ($vaArray[int(($vaArray[0][0] / 2))][$viIndex] + $vaArray[int($vaArray[0][0] / 2) + 1]][$viIndex) / 2 Else ; Array has odd number Return $vaArray[int($vaArray[0][0] / 2) + 1][$viIndex] EndIf EndFunc When I do a Syntex check I get the error "error: _ArraySort() called with Const or expression on ByRef-param(s)" when I call the _ArraySort() function. I guess I don't understand what ByRef means so have no idea how to pass my $viIndex value through the function so it looks at the right column. Anyone able to educate me on this? Thanks
  11. This is a PSOBJECT Example Example_PSObject() Func Example_PSObject() Local $oAssembly = _CLR_LoadLibrary("System.Management.Automation") ConsoleWrite("!$oAssembly: " & IsObj($oAssembly) & @CRLF) ; Get Type ; See https://blogs.msdn.microsoft.com/powershell/2006/11/24/whats-up-with-psbase-psextended-psadapted-and-psobject/ Local $pAssemblyType = 0 $oAssembly.GetType_2("System.Management.Automation.PSObject", $pAssemblyType) ConsoleWrite("$pAssemblyType = " & Ptr($pAssemblyType) & @CRLF) Local $oActivatorType = ObjCreateInterface($pAssemblyType, $sIID_IType, $sTag_IType) ConsoleWrite("IsObj( PSObject ) = " & IsObj($oActivatorType) & @TAB & @CRLF) ; Create Object Local $aText[] = ["Test1"] Local $pPSObject = 0 $oActivatorType.InvokeMember_3(0, $BindingFlags_CreateInstance, 0, 0, CreateSafeArray($aText), $pPSObject) ;~ ConsoleWrite("$pPSObject: " & IsObj($pPSObject) & @TAB & "$pPSObject: " & ObjName($pPSObject) & " - " & ObjName($pPSObject,6) & " - " & ObjName($pPSObject,3) & @CRLF) ConsoleWrite(@CRLF) ConsoleWrite("+GetType() " & ObjName($pPSObject.GetType()) & @CRLF) ConsoleWrite("+ToString() " & $pPSObject.ToString() & @CRLF) ConsoleWrite("+GetHashCode() " & $pPSObject.GetHashCode() & @CRLF) ConsoleWrite("+Equals() " & $pPSObject.Equals($aText) & @CRLF) ; checks that $aText = $aText ;~ $pPSObject.Copy() EndFunc
  12. Hurry edit your question before they lock it
  13. Hello guys! I have been trying to write an autoit script for this new Pokemon MMO 3D game but I have been having no luck. The game has basic W,A,S,D as movements and tab targeting but does not autorun to the targets when using a command like most other MMO's (otherwise this would be much easier) . I was wondering if someone can help guide me in the right direction. Is there any way to make a bot auto run on a specific path I create and attack enemy's that it is only close to? Any help is much appreciated Many thanks guys!!Link to the game I am describing.http://pokemon-mmo-3d.com/
  14. Winwait for that window and controlclick the button you want.
  15. Don't think so. RunAs() runs the program under the different credentials but that doesn't mean it runs the program Elevated. Normally the program's requestedExecutionLevel resource indicates the level it needs to be executed on. Look at AutoIt3Wrapper.au3 where I use the FUNC RunReqAdminDosCommand() to ensure it is elevated in case this is required. Jos
  16. I believe there is a GPO that will allow me to let users toggle services. I can let them toggle the RFID service through a script on their desktops, so they don't even need to know they have access to services. Is this a flaw with RunAs? It would be better to not have to enable access to services for my users.
  17. I used this UDF before but it didnt work for me well because after using _GUICtrlCreateGIF(...) the GUI layer was completely misscolored like in my first picture above and it was flickering even more horrible than my own function. My function is really simple and show every frame with a sleep between. Therefore I needed to save every single frame of my compact gif in my graphics folder. But here is the GIF you mentioned & the GIFAnimation.au3 that I used before GIFAnimation.au3
  18. You're not even using that udf, nor do you have an animated gif.
  19. It is from GitHub Here is the link https://github.com/J2TeaM/AutoIt-UDF-Collection/blob/master/Example Scripts/Iphone UI/UDFs/GIFAnimation.au3
  20. Where is "GIFAnimation.au3" from?
  21. Anyone got a good Gif Animation UDF ?
  22. Perhaps, but problems might arise if area was top of screen, so more coding. Your approach sounds better for your goals.
  23. A more efficient approach would only require 4 rectangles. In my problem multiple black squares are scattered around so this would not be feasible.
  24. Yes, I have read this. The problem is that this approach requires you to know, prior to program execution, the area to exclude. I want to ignore multiple points as the program runs, this means the above approach is not sufficient as there would be way too many rectangles (I.e.: I would have to re-calculate each time a new point is to be ignored). My proposed solution, which I have yet to test, is to iterate through all points on the co-ordinate axis I wish to search (this would be the initial area) and append these values to an array. I.e.: Global $Array = [(x,y), (x2,y2), (...)] [$Array contains all legal pixels to be checked] I would then remove co-ordinates that should be excluded from this array. Each point in $Array would become the parameter of the PixelSearch function, I.e.: PixelSearch ( $Array[0][0], $Array[0][1], $Array[0][0]+1, $Array[0][1]+1, <colour code> ) As each pixel is 1x1 (hence the increment of 1). Checks would be performed in a loop, iterating through all points in $Array. [I am new to AutoIt, the list slicing I am performing is as a result of my Python intuition, also these points may be incorrect]
  25. But here's how it could go in au3 you get the area you want to exclude, and from it calculate 5 areas around it that should be searched. Like I say it's maths and math does my head in. Here's pic to illustrate what I mean... My paint skills are akin to my maths. EDIT: I reckon these might be the calculations. ;$aArea[0]left [1]top [2]right [3]bottom Func _PixelSearchExcludeArea($iColor, $aArea) Local $aSearch1[4] = [0, 0, $aArea[0] - 1, $aArea[1] + 1];1 Local $aSearch2[4] = [$aArea[3] + 1, 0, @DesktopWidth, @DesktopHeight];2 Local $aSearch3[4] = [0, $aArea[1], $aArea[0] - 1, @DesktopHeight];3 Local $aSearch4[4] = [0, $aArea[3] + 1, $aArea[2] + 1, @DesktopHeight];4 Local $aSearch5[4] = [$aArea[0], 0, $aArea[2], $aArea[1] - 1];5 EndFunc ;==>_PixelSearchExcludeArea
  26. Thank you UEZ, I was looking for the download of this UDF too. Cool man.
  1. Load more activity