hiho ich habe folgendes Problem...vorweg ich weiß das es kein Multitasking bei autoit gibt aber es mmuss ja auch was anderes geben
also
ich habe ein Func die über einen langen Zeitraum ausgeführt wird...und während diese Func läuft soll eine andere Func etwas machen
ich share einfach mal die komplette source...
er soll halt während der Move Func nach Erze etc suchen
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=WoW Icon Pack\ICO's\WoW Logo.ico
#AutoIt3Wrapper_Res_Description=WOW Harvester Bot
#AutoIt3Wrapper_Res_Fileversion=0.1.1
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Script Start - Add your code below here
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WoWConstants.au3>
#include <BlackMagicAU3.au3>
#include <DifferentWoWMemoryThings.au3>
#include <string.au3>
#include <NomadMemory.au3>
#Region ### START Koda GUI section ### Form=
[/autoit][autoit][/autoit][autoit]; Main GUI
[/autoit][autoit][/autoit][autoit]$ConfigForm = GUICreate("Config", 200, 91, 120 , 200, -1, $WS_EX_TOOLWINDOW)
$Form1 = GUICreate("Harvester", 332, 200, 280, 150, -1, $WS_EX_TOOLWINDOW)
$m_lDeaths = GUICtrlCreateLabel("Tode :", 197, 201, 44, 17)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
$m_lDeathsCount = GUICtrlCreateLabel("0", 256, 200, 10, 17)
$m_lHerbs = GUICtrlCreateLabel("Kräuter:", 200, 184, 35, 17)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
$m_lHerbsCount = GUICtrlCreateLabel("0", 256, 184, 10, 17)
$m_lMines = GUICtrlCreateLabel("Erze:", 200, 168, 35, 17)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
$m_lMinesCount = GUICtrlCreateLabel("0", 256, 168, 10, 17)
$m_lRunningFor = GUICtrlCreateLabel("Läuft seit:", 200, 152, 54, 17)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
$m_lRunningForcount = GUICtrlCreateLabel("0 minutes", 256, 152, 54, 17)
$Console = GUICtrlCreateEdit("", 5, 5, 190, 189, $WS_VSCROLL)
$StartBot = GUICtrlCreateButton("Start Bot", 197, 145, 132, 50)
$StopBot = GUICtrlCreateButton("Starte Searcher", 197, 125, 132, 20)
$Path = GUICtrlCreateButton("Path...", 197, 105, 132, 20)
$Saveb = GUICtrlCreateButton("Save config", 197, 145, 132, 50)
$back = GUICtrlCreateButton("Zurück", 197, 125, 132, 20)
$pic = GUICtrlCreatePic( @ScriptDir & "\img\Logo.jpg", 197, 5, 132, 97)
_Log("Harvester geladen...")
_BMInitialize()
$PID = WinGetProcess("World of Warcraft")
$handle = _BMOpenProcess($PID)
$ptr1 = _BMReadMemory($handle, $PlayerBase, "ptr")
$ptr2 = _BMReadMemory($handle, $ptr1 + $PlayerBaseOffset1, "ptr")
$pBase = _BMReadMemory($handle, $ptr2 + $PlayerBaseOffset2, "ptr")
$ObjectManager = _BMReadUInt($handle, (_BMReadUInt($handle, $aClientConnection) + $ObjManagerOffset))
$FirstObject = _BMReadUInt($handle, ($ObjectManager + $ObjManagerFirstObject))
$SaveDir = @ScriptDir & "\Profiles\"
$curobject = $FirstObject
_HideGUI($Saveb)
_HideGUI($ConfigForm)
_HideGUI($back)
_HideGUI($m_lDeaths)
_HideGUI($m_lDeathsCount)
_HideGUI($m_lHerbs)
_HideGUI($m_lHerbsCount)
_HideGUI($m_lMines)
_HideGUI($m_lMinesCount)
_HideGUI($m_lRunningFor)
_HideGUI($m_lRunningForcount)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
WinSetOnTop($Form1, "", 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $m_lDeaths
Case $m_lDeathsCount
Case $Console
Case $StartBot
_ShowRun()
_StartBot()
Case $Stopbot
Run("baut.exe", "", @SW_MAXIMIZE)
Case $Saveb
Case $back
_ShowGUI($Console)
_HideGUI($back)
_HideGUI($Saveb)
_HideGUI($Path)
_ShowGUI($Startbot)
_ShowGUI($Stopbot)
Case $Path
$open = FileOpenDialog("Path auswählen", @ScriptDir & "\Profile", "All (*.*)", 1 + 4)
Sleep(500)
_Log("Path ausgewählt")
EndSwitch
$ObjectManager = _BMReadUInt($Handle, (_BMReadUInt($Handle, $aClientConnection) + $ObjManagerOffset))
$FirstObject = _BMReadUInt($Handle, ($ObjectManager + $ObjManagerFirstObject))
$curobject = _BMReadUInt($Handle, ($curobject + $ObjectNextOffset))
$name = _BMReadASCIIString($Handle, _BMReadUint($Handle, (_BMReadUInt($Handle, ($curobject + $GAMEOBJECT_NAMEOFFSET_1)) + $GAMEOBJECT_NAMEOFFSET_2)), 30)
$curGUID = _BMReadMemory($handle, ($curobject + 0x30), 'uint64')
$Dllinformation = _Memoryopen($PID)
WEnd
Func _StartBot()
[/autoit][autoit][/autoit][autoit]_Log("Bot wird gestartet...")
_Log("Suche jetzt nach World of Warcraft...")
If $PID = -1 Then
_Log("konnte World of Warcraft nicht finden")
Else
_Log("World of Warcraft PID : " & $PID)
EndIf
$X = _GetX($handle, $pBase)
$Y = _GetY($handle, $pBase)
$Z = _GetZ($handle, $pBase)
;_Log($X & " + " & $Y & " + " & $Z)
$lineNumber = 1
_Log("Movement started.")
$Movement = True
$curobject = $FirstObject
[/autoit][autoit][/autoit][autoit]while ($Movement == True)
$pName = $open
$profileFile = FileReadLine($pName, $lineNumber)
$content = _StringBetween($profileFile, "<Waypoint>", "</Waypoint>")
If Not @error Then
$split = StringSplit($content[0], " ")
If IsArray($split) Then
If $split[0] = 3 Then
$XCoord = $split[1]
$YCoord = $split[2]
$ZCoord = $split[3]
$X = _GetX($handle, $pBase)
$Y = _GetY($handle, $pBase)
$Z = _GetZ($handle, $pBase)
$dist = Sqrt(($x - $XCoord) ^ 2 + ($y - $YCoord) ^ 2)
[/autoit][autoit][/autoit][autoit]$lineNumber = $lineNumber + 1
[/autoit][autoit][/autoit][autoit]_Move($handle, $XCoord, $YCoord, $ZCoord) ; das is die Move Func die er halt die ganze zeit ausführt
; die _Search() Func soll er halt während der Move Func ausführen
EndIf
EndIf
EndIf
WEnd
EndFunc ;==>_StartBot
Func _Search()
_Log("suceh")
If $name="Saronitablagerung" or $name="Titanvorkommen" Then
_Log("Found : " & $name)
_Move($handle, _getObjectX($handle, $curobject), _getObjectY($handle, $curobject), _getObjectZ($handle, $curobject) )
Sleep(3000)
_log("baua jetzt ab")
Sleep(500)
_interact($handle)
EndIf
EndFunc
Func _interact($handle)
_Memorywrite(0x01127770,$DllInformation,$curguid,"byte[8]")
ControlSend("World of Warcraft","","","l")
EndFunc ;==>_interact
Func _getObjectX($handle,$curobject)
Return Floor(_BMReadMemory($Handle, $curobject + 0xE8, "float"))
EndFunc
Func _getObjectY($handle,$curobject)
return Floor(_BMReadMemory($Handle, $curobject + 0xEC, "float"))
EndFunc
Func _getObjectZ($handle,$curobject)
return Floor(_BMReadMemory($Handle, $curobject + 0xF0, "float"))
EndFunc
Func _ShowGUI($ControlID)
GUICtrlSetState($ControlID, $GUI_SHOW)
EndFunc ;==>_ShowGUI
Func _HideGUI($ControlID)
GUICtrlSetState($ControlID, $GUI_HIDE)
EndFunc ;==>_HideGUI
Func _Log($data)
;GUICtrlSetData($Console, @CRLF &"[L] : " & $data & @CRLF)
GUICtrlSetData($Console, "" & $data & @CRLF, 1)
EndFunc ;==>_Log
Func _Move($handle, $XCoord, $YCoord, $ZCoord)
_BMWriteFloat($handle, 0x012818C4, $XCoord)
_BMWriteFloat($handle, 0x012818C8, $YCoord)
_BMWriteFloat($handle, 0x012818CC, $ZCoord)
_BMWriteInt($handle, 0x01281854, "4")
$X = Round(_GetX($handle, $pBase))
$Y = Round(_GetY($handle, $pBase))
$lastDist = 10000000
$dist = Sqrt(($X - $XCoord) ^ 2 + ($Y - $YCoord) ^ 2)
;MsgBox(0, "Wrote that Shit", "")
$distance = False
[/autoit][autoit][/autoit][autoit]While ($distance == False)
$distancewp = Round(Sqrt(($XCoord - _GetX($handle, $pBase)) ^ 2 + ($YCoord - _GetY($handle, $pBase)) ^ 2))
If $distancewp < 5 Then
$distance = True
EndIf
If $distancewp > 6 Then
Sleep(100)
EndIf
WEnd
EndFunc ;==>_Move
Func _ShowRun()
[/autoit][autoit][/autoit][autoit];Hide Standart GUICreate
[/autoit][autoit][/autoit][autoit]_HideGUI($Startbot)
[/autoit][autoit][/autoit][autoit][/autoit][autoit];Show Running GUICreate
[/autoit][autoit][/autoit][autoit]_ShowGUI($m_lDeaths)
_ShowGUI($m_lDeathsCount)
_ShowGUI($m_lHerbs)
_ShowGUI($m_lHerbsCount)
_ShowGUI($m_lMines)
_ShowGUI($m_lMinesCount)
_ShowGUI($m_lRunningFor)
_ShowGUI($m_lRunningForcount)
EndFunc