[AutoIt] Finding Player's Name menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    kalixe's Avatar Member
    Reputation
    12
    Join Date
    Nov 2009
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [AutoIt] Finding Player's Name

    This is my first contribution, I hope it will help beginners :homer:

    Finding Player's name it isn't the easiest ! But this is a simple ObjectManager.

    I offer you my autoit code available for the current client 3.3.5 (offsets).

    required : nomadMemory.au3

    We'll just use a simple ObjectManager only with the type we are interested (type: 4) for players and the aim is to list the players around our character.

    Read() is a simplification of the function _MemoryRead() With less arg and one optional.

    ConvertUTF8() for convert string ASCII to UTF8.




    Code:
    #include <NomadMemory.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    
    #RequireAdmin
    
    ; Finding Player's Name - Wow 3.3.5
    ; By Kalixe
    
    ; variables
    Global const $IsInGame = 0x00BD0792
    Global const $LevelOffset=0xD8
    Global $WowProcess
    Global $localGUID
    
    ; Offsets Object Manager
    Global Const $ClientConnection = 0x00C79CE0
    Global Const $CurrMgrOffset = 0x2ED0
    Global Const $FirstObjectOffset = 0xAC
    Global Const $NextObjectOffset = 0x3C
    Global Const $LocalGUIDOffset = 0xC0
    Global Const $GuidOffset = 0x30
    Global Const $TypeOffset = 0x14
    Global Const $DescriptorOffset = 0x8
    
    ; Variables for Player Name
    Global const $nameStorePtr= 0xC5D938 + 0x8		; Player name database (updated for 3.3.5 by kalixe)
    Global const $nameMaskOffset=0x024				; offset for the mask used with GUID to select a linked list
    Global const $nameBaseOffset=0x01c				; offset for the start of the named linked list
    Global const $nameStringOffset=0x020			; offset to the C string in a name structure
    
    #Region ### START Koda GUI section ### Form=
    Global $Form1 = GUICreate("Finding Player's Name", 300, 517, 192, 124)
    Global $ScanBouton = GUICtrlCreateButton("Scan", 80, 32, 137, 41, $WS_GROUP)
    Global $PlayersTab = GUICtrlCreateEdit("", 24, 104, 249, 385)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    
    SetPrivilege( "SeDebugPrivilege", 1 )
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    
    		Case $GUI_EVENT_CLOSE
    			Exit
    		Case $ScanBouton
    			if WowManager() then ; If inGame
    				ObjectManager()
    			EndIf
    
    	EndSwitch
    WEnd
    
    Func ObjectManager()
    
    	$ObjectManager = Read(Read($ClientConnection)+$CurrMgrOffset) ; ObjectManager
    	$CurrentObject = Read($ObjectManager+$FirstObjectOffset) ; First Object
    
    	$localGUID = Read($ObjectManager+$LocalGUIDOffset,"int64") ; GUID my player
    
    	$Type = Read($CurrentObject+$TypeOffset)
    
    	$countPlayers = 0
    
    	GUICtrlSetData($PlayersTab, "--- Players List ---" & @CRLF)
    
    	While $Type > 0
    
    		Switch $Type
    
    			Case 4 ; Players
    				$guid= Read($CurrentObject+$GuidOffset,"int64")
    				$Descriptor = Read($CurrentObject+$DescriptorOffset)
    				$lvl = Read($Descriptor+$levelOffset)
    				$name = ConvertUTF8(GetPlayerName($guid))
    
    				if $guid = $localGUID then
    					$name = ">>> " & $name & " <<<"
    				Endif
    
    				GUICtrlSetData($PlayersTab, $name & " - Lvl : " & $lvl & " -" & @CRLF,1)
    				$countPlayers += 1
    
    		EndSwitch
    		$CurrentObject = Read($CurrentObject+$NextObjectOffset) 
    		$Type= Read($CurrentObject+$TypeOffset)
    	WEnd
    
    	GUICtrlSetData($PlayersTab, "-> Total players : " & $countPlayers & @CRLF,1)
    
    EndFunc
    
    Func GetPlayerName($guid)
    
    	$mask=Read($nameStorePtr+$nameMaskOffset)
    	$base=Read($nameStorePtr+$nameBaseOffset)
    
    	$shortGUID = BitAnd($guid, 0xffffffff)		; Only half of the GUID is used to check for a hit
    	if ($mask=0xffffffff) Then
    		return ""
    	EndIf
    
    	$offset = 12 * BitAnd($mask, $shortGUID)	; Select the linked list
    	$current = Read($base+$offset+8)			;first element in the list
    	$offset = Read($base+$offset) 				;this +4 is the offset for the next element
    
    	if (BitAND($current, 0x1) = 0x1) Then
    		return ""
    	EndIf
    
    	$testGUID= Read($current)
    
    	while ($testGUID <> $shortGUID)
    		$current=read($current+$offset+4)
    		if (BitAND($current, 0x1) = 0x1) Then
    			return ""
    		EndIf
    		$testGUID=Read($current)
    	WEnd
    
    	return Read($current+$nameStringOffset, "char[20]")
    
    EndFunc
    
    Func WowManager()
    	local $WowPid
    
    	$WowPid=ProcessExists("wow.exe")
    
    	If $WowPid=0 Then
    		ErrorManager("Please run World of warcraft")
    		return false
    	Else
    		$WowProcess = _MEMORYOPEN($WowPid)
    		if IsInGame() then
    			return true
    		Else
    			ErrorManager("Please log in your character")
    			return false
    		EndIf
    	EndIf
    EndFunc
    
    Func ErrorManager($message)
    
    	MsgBox(48, "Warning", $message)
    
    EndFunc
    
    Func IsInGame()
    	return read($IsInGame)
    EndFunc
    
    Func ConvertUTF8($String)
        Return BinaryToString(StringToBinary($String, 1), 4)
    EndFunc
    
    Func Read($offset, $type="dword", $process=$WowProcess)
    	return _MemoryRead($offset, $process ,$type)
    EndFunc
    Heyyyy ! Whoever said there are more simple that shows us his code :shutit:

    [AutoIt] Finding Player's Name
  2. #2
    oldmanofmen's Avatar Member
    Reputation
    12
    Join Date
    Jan 2010
    Posts
    104
    Thanks G/R
    4/3
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code is an inspiration to us all.

  3. #3
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My eyes! The goggles do nothing!

  4. #4
    Syltex's Avatar Sergeant Major
    Reputation
    23
    Join Date
    Jul 2010
    Posts
    174
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    My eyes! The goggles do nothing!
    HA!


    filter

  5. #5
    kalixe's Avatar Member
    Reputation
    12
    Join Date
    Nov 2009
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok Sister !

    Try the Jurassic Park Night Vision Goggles


  6. #6
    bonehand's Avatar Member
    Reputation
    2
    Join Date
    Aug 2009
    Posts
    61
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't let the sarcasm get you down. Any example is worth a +Rep, even if we won't be using AutoIt.

  7. #7
    RivaLfr's Avatar Contributor CoreCoins Purchaser Authenticator enabled
    Reputation
    221
    Join Date
    Sep 2010
    Posts
    258
    Thanks G/R
    2/25
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Good sample, thank

  8. #8
    natt_'s Avatar Contributor
    Reputation
    145
    Join Date
    Dec 2007
    Posts
    391
    Thanks G/R
    13/0
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice oop example +rep

Similar Threads

  1. how do i find my database name?
    By Minichili in forum World of Warcraft Emulator Servers
    Replies: 24
    Last Post: 03-22-2008, 11:49 AM
  2. Find out last name on account?
    By valetudo in forum World of Warcraft General
    Replies: 2
    Last Post: 08-12-2007, 10:50 AM
All times are GMT -5. The time now is 03:36 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search