#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=icon.ico
#AutoIt3Wrapper_Res_Comment=2 Starts Version
#AutoIt3Wrapper_Res_Description=Fiesta Online Bot
#AutoIt3Wrapper_Res_Fileversion=0.1.0.0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <nomadmemory.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIEdit.au3>
FileInstall("Screen.jpg", @TempDir & "/Screen.jpg")
AutoItSetOption('SendKeyDownDelay', 70)
$hGUI = GUICreate('Fiesta Bot', 300, 550, @DesktopWidth - 320)
GUISetBkColor(0x133005)
GUICtrlSetDefBkColor(0x133005)
GUICtrlSetDefColor(0xFF9C00)
$hPic = GUICtrlCreatePic(@TempDir & "/Screen.jpg", 0, 0, 300, 188)
$hLabel1 = GUICtrlCreateLabel('X-Position: ', 70, 200, 200, 21)
$hLabel2 = GUICtrlCreateLabel('Y-Position: ', 70, 220, 200, 21)
$hLabel3 = GUICtrlCreateLabel('Z-Position: ', 70, 240, 200, 21)
$hLabel4 = GUICtrlCreateLabel('Ausgewählter Mob: ', 70, 270, 200, 21)
$hLabel5 = GUICtrlCreateLabel('Zoom-Level: ', 70, 290, 170, 21)
$hLabel6 = GUICtrlCreateLabel('Leben: ', 70, 320, 200, 21)
$hCheckbox = GUICtrlCreateCheckbox('', 70, 348, 17, 17)
GUICtrlSetState($hCheckbox, $GUI_DISABLE)
$hLabel7 = GUICtrlCreateLabel('Zoom-Hack aktivieren', 90, 350, 150, 21)
$hButton = GUICtrlCreateButton('Start', 95, 390, 110, 40)
$hEdit = GUICtrlCreateEdit('', 0, 450, 300, 100, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN))
_GUICtrlEdit_SetLimitText($hEdit, 1000000000000000000000000000000000000000000000000000000000000)
GUISetState(@SW_SHOW)
Local $iPID, $sBaseAdress = 0x008DE73C, $bRunning = 0, $iSelectedMob, $iHP, $iMaxHP
_log('Bot gestartet')
While 1
If $iPID = '' Then
$iPID = ProcessExists('Fiesta.bin')
If $iPID Then
_log('Fiesta Online gefunden!')
GUICtrlSetState($hCheckbox, $GUI_ENABLE)
$hMem = _MemoryOpen($iPID)
$sFiestaBase = _MemoryModuleGetBaseAddress($iPID, 'Fiesta.bin')
$sMobPointer = _memoryread($sFiestaBase + 0x450F28, $hMem, 'dword')
AdlibRegister('_Update_GUI', 1000)
EndIf
EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $hButton
If Not $iPID Then
_log("Fiesta Online läuft nicht!")
ContinueLoop
EndIf
GUICtrlSetState($hCheckbox, $GUI_DISABLE)
GUICtrlSetData($hButton, 'Abrechen = Strg + e')
HotKeySet('^e', '_stop')
$bRunning = True
$iRunningTimer = TimerInit()
$iTimerRandom = Random(30 * 60 * 1000, 60 * 60 * 1000)
_fight()
HotKeySet('^e')
GUICtrlSetData($hButton, 'Start')
GUICtrlSetState($hCheckbox, $GUI_ENABLE)
Case $hCheckbox
If GUICtrlRead($hCheckbox) = 1 Then
_log("Aktiviere Zoom-Hack")
_MemoryWrite($sBaseAdress + 0x08, $hMem, 10000, 'float');Maximum
_MemoryWrite($sBaseAdress + 0x0C, $hMem, 1, 'float');Minimum
_log("Zoom-Hack aktiviert!")
Else
_log("Dektiviere Zoom-Hack")
_MemoryWrite($sBaseAdress + 0x08, $hMem, 360, 'float');Maximum
_MemoryWrite($sBaseAdress + 0x0C, $hMem, 40, 'float');Minimum
_log("Zoom-Hack deaktiviert!")
EndIf
EndSwitch
WEnd
Func _Update_GUI()
$iX = _memoryread($sBaseAdress + 0x3D8, $hMem, 'float')
$iY = _memoryread($sBaseAdress + 0x3DC, $hMem, 'float')
$iZ = _memoryread($sBaseAdress + 0x3E0, $hMem, 'float')
$iZoom = _memoryread($sBaseAdress + 0x64, $hMem, 'float')
$iHP = _memoryread(0x008514EB, $hMem, 'dword')
$iMaxHP = _memoryread(0x008515BC, $hMem, 'dword')
If Not $bRunning Then
$iSelectedMob = _memoryread($sMobPointer + 0xB70, $hMem, 'dword')
GUICtrlSetData($hLabel4, 'Ausgewählter Mob: ' & $iSelectedMob)
EndIf
GUICtrlSetData($hLabel1, 'X-Position: ' & $iX)
GUICtrlSetData($hLabel2, 'Y-Position: ' & $iY)
GUICtrlSetData($hLabel3, 'Z-Position: ' & $iZ)
GUICtrlSetData($hLabel5, 'Zoom-Level: ' & $iZoom)
GUICtrlSetData($hLabel6, 'Leben: ' & $iHP & '/' & $iMaxHP)
EndFunc ;==>_Update_GUI
Func _log($sString)
_GUICtrlEdit_AppendText($hEdit, @HOUR & ':' & @MIN & ':' & @SEC & ' - ' & $sString & @CRLF)
_GUICtrlEdit_LineScroll($hEdit, 0, _GUICtrlEdit_GetLineCount($hEdit))
EndFunc ;==>_log
Func _fight()
_log("Fiesta Online in den Vordergrund bringen")
WinActivate('FiestaOnline')
Sleep(500)
_log("Kamera-Pitch auf 0 setzten")
_MemoryWrite($sBaseAdress + 0x28, $hMem, 0, 'float')
_log("Kamera-Zoom auf 40 setzten")
_MemoryWrite($sBaseAdress + 0x64, $hMem, 40, 'float')
While $bRunning = True
If TimerDiff($iRunningTimer) > $iTimerRandom Then
$iRunningTimer = TimerInit()
$iTimerRandom = Random(10 * 60 * 1000, 30 * 60 * 1000)
_log("Bot wird für " & Round($iTimerRandom / 1000, 1) & " Sekunden pausiert!")
While 1
If $bRunning = False Then ExitLoop 2
Sleep(1000)
$iDiff = TimerDiff($iRunningTimer)
If $iDiff > $iTimerRandom Then ExitLoop
_log("Noch " & Round(($iTimerRandom - TimerDiff($iRunningTimer)), 1) / 1000 & " Sekunden Pause")
WEnd
$iRunningTimer = TimerInit()
$iTimerRandom = Random(30 * 60 * 1000, 1000 * 60 * 1000)
_log("Bot wird fortgestzt!")
Sleep(50)
EndIf
_log("Versuche per Tab einen Mob auszuwählen")
Send('{TAB}')
Sleep(70)
If Not _checktarget() Then
_Log("Nicht erfolgreich, drehe Kamera um 20° nach Links")
$iCameraYaw = _memoryread($sBaseAdress + 0x34, $hMem, 'float')
_MemoryWrite($sBaseAdress + 0x34, $hMem, $iCameraYaw + 30, 'float')
ContinueLoop
EndIf
_log("Erfolgreich Mob mit ID " & $iSelectedMob & " ausgewählt!")
_log("Sende Mob angreifen")
Send('1')
$iTimer = TimerInit()
While _checktarget() = True
Sleep(500)
If TimerDiff($iTimer) > 30 * 60 * 1000 Then
_log("Seit 30 Sec am Angreifen, nächster Versuch!")
ContinueLoop 2
EndIf
If $iHP < ($iMaxHP / 100) * 90 Then
_log("Heile...")
Send("3")
Sleep(100)
EndIf
WEnd
_log("Mob ist tot!")
_log("Warte 3 sec bis Aufsammeln")
Sleep(3000)
_log("Aufsammeln...")
Send('2')
Sleep(100)
Send('2')
Sleep(100)
Send('2')
Sleep(100)
Send('2')
Sleep(100)
Send('2')
Sleep(100)
If $iHP < ($iMaxHP / 100) * 90 Then
_log("Heile...")
Send("3")
Sleep(100)
EndIf
WEnd
EndFunc ;==>_fight
Func _MemoryModuleGetBaseAddress($iPID, $sModule)
Local $PSAPI = DllOpen('psapi.dll')
Local $hProcess
Local $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020) ; CREATE_THREAD, QUERY_INFORMATION, VM_OPERATION, VM_READ, VM_WRITE
If $iPID > 0 Then
Local $hProcess = DllCall('kernel32.dll', 'ptr', 'OpenProcess', 'dword', $PERMISSION, 'int', 0, 'dword', $iPID)
If $hProcess[0] Then
$hProcess = $hProcess[0]
EndIf
EndIf
Local $Modules = DllStructCreate('ptr[1024]')
Local $aCall = DllCall($PSAPI, 'int', 'EnumProcessModules', 'ptr', $hProcess, 'ptr', DllStructGetPtr($Modules), 'dword', DllStructGetSize($Modules), 'dword*', 0)
If $aCall[4] > 0 Then
Local $iModnum = $aCall[4] / 4
Local $aTemp
For $i = 1 To $iModnum
$aTemp = DllCall($PSAPI, 'dword', 'GetModuleBaseNameW', 'ptr', $hProcess, 'ptr', Ptr(DllStructGetData($Modules, 1, $i)), 'wstr', '', 'dword', 260)
If $aTemp[3] = $sModule Then
DllClose($PSAPI)
Return Ptr(DllStructGetData($Modules, 1, $i))
EndIf
Next
EndIf
EndFunc ;==>_MemoryModuleGetBaseAddress
Func _checktarget()
$iSelectedMob = _memoryread($sMobPointer + 0xB70, $hMem, 'dword')
GUICtrlSetData($hLabel4, 'Ausgewählter Mob: ' & $iSelectedMob)
If $iSelectedMob Then Return True
EndFunc ;==>_checktarget
Func _stop()
GUICtrlSetData($hButton, 'wird abgebrochen...')
$bRunning = False
EndFunc ;==>_stop
Func GUICheckBoxSetColor(ByRef $CtrlID, $iColor, $iBkColor = '0xF1EDED')
$CtrlHWnd = $CtrlID
If Not IsHWnd($CtrlHWnd) Then $CtrlHWnd = GUICtrlGetHandle($CtrlID)
$aParent = DllCall('user32.dll', 'hwnd', 'GetParent', 'hwnd', $CtrlHWnd)
$aCPos = ControlGetPos($aParent[0], '', $CtrlID)
$sOldT = GUICtrlRead($CtrlID, 1)
GUICtrlDelete($CtrlID)
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0)
$CtrlID = GUICtrlCreateCheckbox($sOldT, $aCPos[0], $aCPos[1], $aCPos[2], $aCPos[3])
GUICtrlSetColor(-1, $iColor)
GUICtrlSetBkColor(-1, $iBkColor)
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7)
EndFunc ;==>GUICheckBoxSetColor