AutoIt Latest Topics http://codedeception.net/ipb/index.php?/forum/62-autoit/AutoIt Latest TopicsenSearch for texthttp://codedeception.net/ipb/index.php?/topic/13887-search-for-text/ Can anyone tell me if its possible to make autoit search for text? (im trying to search for a button a pop up(the color changes every time so i cant use img search) so i thought why not try using text search if possible) , the text is following: OK, Okay, Tak, Fedt.

I've searched around most possibilities i found was img search which doesnt work cuz of the color change.. ^^

Any help are HIGHLY appreciatet.

-Dequality.

]]>
13887Sat, 10 Jun 2017 09:46:32 +0000
ControlClick on untitled windowhttp://codedeception.net/ipb/index.php?/topic/11848-controlclick-on-untitled-window/ Nevermind, I fixed it :)

]]>
11848Mon, 21 Dec 2015 00:38:59 +0000
Autoit PixelGetColor of background windowhttp://codedeception.net/ipb/index.php?/topic/8712-autoit-pixelgetcolor-of-background-window/Ok so i made pretty good Eve Online mining / Hauling / Ratting script with AutoIt. The script is perfect for my needs but with one major flaw: Eve window must be active for function PixelGetColor to read pixels. 

When looking at PixelGetColor (

Please login or register to see this link.

) you can see it has an optional parameter of setting window handle for the window the pixel is being read from. Thus it is logical to me that it is possible to read pixels from windows that are not focused (i.e not minimized, but behind another window).

But having tried numerous times, i can't get it to work like i need it to. 

Am i wrong? Does the function only read visible pixels only? Why the window handle option then? And if so, is there any other method you could recommend (that also involves pixel recognition)

]]>
8712Sun, 01 Mar 2015 20:32:48 +0000
_MemoryGetBaseAdress wont return anythinghttp://codedeception.net/ipb/index.php?/topic/9625-_memorygetbaseadress-wont-return-anything/Hi,
 
some days ago I decided to give autoit a shot. I havent been into programming yet.
As a first goal I want to create a simple GUI that shows character stats like health, mana, gold, position, etc.
(BTW it's for a 2.4.3 Server)
 
So I got into memory reading and started to get familiar with NomadMemory. 
I managed to read some static adresses like the choords and the player name.
I now want to read from pointers and im struggling to get wow's base adress. 
I wanted to start with the health and this is the pointer I want to use:
OBPhc.png
 
So the base offset is 00A29D28.
For the base I found this function (see at the bottom).

I'd be really thankful if someone could tell me, why _MemoryGetBaseAdress is returning 0. (see code at the bottom)

 

I'm running Win7 32Bit to prevent any 64Bit Problems.

;===================================================================================================; Function........:  _MemoryGetBaseAddress($ah_Handle, $iHD);; Description.....:  Reads the 'Allocation Base' from the open process.;; Parameter(s)....:  $ah_Handle - An array containing the Dll handle and the handle of the open;                               process as returned by _MemoryOpen().;                    $iHD - Return type:;                       |0 = Hex (Default);                       |1 = Dec;; Requirement(s)..:  A valid process ID.;; Return Value(s).:  On Success - Returns the 'allocation Base' address and sets @Error to 0.;                    On Failure - Returns 0 and sets @Error to:;                  |1 = Invalid $ah_Handle.;                  |2 = Failed to find correct allocation address.;                  |3 = Failed to read from the specified process.;; Author(s).......:  Nomad. Szhlopp.; URL.............:  

Please login or register to see this link.

Note(s).........: Go to Www.CheatEngine.org for the latest version of CheatEngine.;===================================================================================================Func _MemoryGetBaseAddress($ah_Handle, $iHexDec = 0) Local $iv_Address = 0x00100000 Local $v_Buffer = DllStructCreate('dword;dword;dword;dword;dword;dword;dword') Local $vData Local $vType If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf DllCall($ah_Handle[0], 'int', 'VirtualQueryEx', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer)) If Not @Error Then $vData = Hex(DllStructGetData($v_Buffer, 2)) $vType = Hex(DllStructGetData($v_Buffer, 3)) While $vType <> "00000080" DllCall($ah_Handle[0], 'int', 'VirtualQueryEx', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer)) $vData = Hex(DllStructGetData($v_Buffer, 2)) $vType = Hex(DllStructGetData($v_Buffer, 3)) If Hex($iv_Address) = "01000000" Then ExitLoop $iv_Address += 65536 WEnd If $vType = "00000080" Then SetError(0) If $iHexDec = 1 Then Return Dec($vData) Else Return $vData EndIf Else SetError(2) Return 0 EndIf Else SetError(3) Return 0 EndIfEndFunc ;==>_MemoryGetBaseAddress
#include <NomadMemory.au3>#RequireAdminSetPrivilege("SeDebugPrivilege", 1)$ModuleName = "Wow.exe"$pid = ProcessExists($ModuleName)Global $BaseOffset = "00A29D28"Global $HPOffset[3]   $HPOffset[0] = 0   $HPOffset[1] = 120   $HPOffset[2] = 40$handle = _MemoryOpen($pid)$Base = _MemoryGetBaseAddress($handle, 1); + $BaseOffset$BaseAddr = "0x" & Hex($Base + $BaseOffset)_MemoryClose($handle)MsgBox(0,"Test", "Modulname: " & $ModuleName & @CRLF & "Base: " & $Base & @CRLF & "Playerbase: " & $BaseAddr)
]]>
9625Thu, 07 May 2015 16:07:05 +0000
rebot simple demo bypasshttp://codedeception.net/ipb/index.php?/topic/7690-rebot-simple-demo-bypass/as poeple asked for it

 

it,s a pretty simple script that checks if the "start" button is enabled

when it is it clicks on start > run demo

 

left key to start right to close the script

 

HotKeySet("{left}","start")
HotKeySet("{right}","end")
While 1
    Sleep(1000)
WEnd



Func start()
  Local $Data = ProcessExists('ReBot.exe')
 While 1
    $1 = ControlGetText(_GetHwndFromPID($Data),"","[CLASS:WindowsForms10.BUTTON.app.0.3551b1b_r13_ad1; INSTANCE:13]")
    If $1 = "Start" Then
    ControlClick(_GetHwndFromPID($Data),"","[CLASS:WindowsForms10.BUTTON.app.0.3551b1b_r13_ad1; INSTANCE:13]","left")
    Sleep(500)
    ControlClick("Premium Bot","","[CLASS:WindowsForms10.BUTTON.app.0.3551b1b_r13_ad1; INSTANCE:2]","left")
    EndIf
    Sleep(10000)
 WEnd
EndFunc



Func end()
    Exit
EndFunc



Func _GetHwndFromPID($PID)
    $hWnd = 0
    $stPID = DllStructCreate("int")
    Do
        $winlist2 = WinList()
        For $i = 1 To $winlist2[0][0]
            If $winlist2[$i][0] <> "" Then
                DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
                If DllStructGetData($stPID, 1) = $PID Then
                    $hWnd = $winlist2[$i][1]
                    ExitLoop
                EndIf
            EndIf
        Next
        Sleep(100)
    Until $hWnd <> 0
    Return $hWnd
EndFunc ;==>_GetHwndFromPID

]]>
7690Wed, 24 Dec 2014 22:33:11 +0000
Battle.net Auto loginhttp://codedeception.net/ipb/index.php?/topic/1817-battlenet-auto-login/Does anyone know whats wrong with this code?

It SHOULD work but all it does is input the acountName and then stops with the error 

$o_object.fireEvent("OnChange")$o_object.fireEvent("OnChange")^ ERROR

If I enter $password, "PASSWORD" before the $username it does the same thing except this time it only enters the password. Weird stuff...

#include <IE.au3>Call ("signIn")Func SignIn ()Global $oIE = _IECreate ("https://eu.battle.net/login/en")Local $username =_IEGetObjByName ($oIE,"accountName")Local $password = _IEGetObjByName ($oIE,"password")_IEFormElementSetValue ($username, "[email protected]")_IEFormElementSetValue ($password, "PASSWORD")EndFunc
]]>
1817Fri, 21 Jun 2013 12:39:53 +0000
window hiderhttp://codedeception.net/ipb/index.php?/topic/2446-window-hider/this programm simply hides the window/click through

Please login or register to see this link.

refresh button list,s all running wow processes
get window button get the current aktive window with a 5 sec delay

reduced my wow cpu usage by 50% on ultra settings

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>
#include <GuiListView.au3>

AutoItSetOption("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

$Form1 = GUICreate("Window Hider", 200, 260, 361, 346)
$ListView = GUICtrlCreateListView("Process|ID",0,10,200,150)
$Button1 = GUICtrlCreateButton("Get Window", 100, 170, 75, 25)
$Button2 = GUICtrlCreateButton("Hide", 100, 210, 75, 25)
$Button3 = GUICtrlCreateButton("Show", 10, 210, 75, 25)
$Button4 = GUICtrlCreateButton("Refresh",10,170,75,25)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Sleep(5000)
$Hwnd = WinGetProcess("[active]")
$lol = _PIDGetProcessName($Hwnd)
GUICtrlCreateListViewItem($lol & '|' & $Hwnd,$ListView)
Case $Button2
$iSelect = ControlListView($Form1, "", $ListView, "GetSelected")
$Pid = ControlListView($Form1, "", $ListView, "GetText", $iSelect,1)
$Hwnd = _GetHwndFromPID($Pid)
WinSetTrans($Hwnd,"",0)
_GUICtrlListView_SetItemText($ListView,$iSelect,"Hidden")
Case $Button3
$iSelect = ControlListView($Form1, "", $ListView, "GetSelected")
$Pid = ControlListView($Form1, "", $ListView, "GetText", $iSelect,1)
$Hwnd = _GetHwndFromPID($Pid)
WinSetTrans($Hwnd,"",255)
$lol = _PIDGetProcessName($Pid)
_GUICtrlListView_SetItemText($ListView,$iSelect,$lol)
Case $Button4
refresh()
EndSwitch
WEnd

Func refresh()
Local $var = ProcessList("wow.exe")
_GUICtrlListView_DeleteAllItems($ListView)
For $i = 1 To $var[0][0]
GUICtrlCreateListViewItem($var[$i][0] & '|' & $var[$i][1] ,$ListView)
Next
EndFunc

Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i][1]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc ;==>_GetHwndFromPID


Func _PIDGetProcessName($vPID)
$aProcesslist = ProcessList()
For $i = 1 To $aProcesslist[0][0]
If $aProcesslist[$i][1] = $vPID Then Return $aProcesslist[$i][0]
Next
EndFunc ;==>_PIDGetProcess

Download:

Please login or register to see this link.

]]>
2446Wed, 04 Sep 2013 13:37:51 +0000