anbei ein Skript zum HA Syncen. Autoinvite, Zaishen klatschen, leaven, repreat.
Ich denke das sit selbsterklärend.
Quote:
#include "GWA2.au3"
#include "File.au3"
#include <GUIConstantsEx.au3>
#include <Array.au3>
HotKeySet("{end}","ende")
Opt('GUIOnEventMode', 1)
Global $mGWProcHandle, $mKernelHandle, $mCharname
Global $gCharacterSelector, $gCharacterName, $gCharacterName2, $gCharacterStart, $gCharacterEnd, $CharacterName
Global $CharName
Global $skillCost[9]
$skillCost[1] = 10
$skillCost[2] = 10
$skillCost[3] = 10
$skillCost[4] = 10
$skillCost[5] = 10
$skillCost[6] = 10
$skillCost[7] = 5
$skillCost[8] = 10
Global $cGUI
Global $SelfX, $SelfY, $SelfAgent, $Skillbar, $NearestEnemy, $NearestEnemyDistance, $CombatMode, $bActive = False
Global Const $WayPoints[3][2] = [ _
[7159.9755859375, -612.648803710938], _
[8501.4833984375, -25.7167091369629], _
[9204, 1370] _
]
Global Const $AuraOfRestoration = 0xd2f
Global Const $FireAttunement = 0xb8
;initialize("Killer Piller I",true,true)
;ToolTip(UBound(GetParty()))
;$bActive = True
CharacterSelector()
While 1
Sleep(10000)
If Not $bActive Then
ContinueLoop
EndIf
Local $GetMapLoad = GetMapLoading()
;EnterChallenge()
If $GetMapLoad == 2 Then
;~ ToolTip("Load oben")
LoadSafe()
ContinueLoop
EndIf
InvitePlayers()
If $GetMapLoad == 1 Then
;~ ToolTip("Load unten")
StartLogic()
;ZoneMap(0x14a)
ZoneMap(330)
LoadSafe()
Sleep(1000)
LeaveGroup()
InvitePlayers()
ContinueLoop
EndIf
WEnd
Func StartLogic()
If Not CheckIfPlayersLoaded() Then
Return
EndIf
Local $MoveRandomizer = 150
Local $DeadLock = TimerInit()
MoveTo($WayPoints[0][0], $WayPoints[0][1])
CheckEnches()
MoveTo($WayPoints[1][0], $WayPoints[1][1])
AttackStuff()
EndFunc
Func CheckIfPlayersLoaded()
Local $PlayerCount = 0
Local $DeadLock = TimerInit()
dim $Leechers
_FileReadToArray("Leechers.txt",$Leechers)
While $PlayerCount < 6
$PlayerCount = 0
For $i = 1 To GetMaxAgents()
$Agent = GetAgentByID($i)
For $n = 1 to $Leechers[0]
If DllStructGetData($Agent,"Playernumber") <> 0 and GetPlayerName($Agent) = $Leechers[$n] Then
$PlayerCount += 1
EndIf
Next
Next
WEnd
If TimerDiff($DeadLock) > 100000 Then
Return False
EndIf
Return True
EndFunc
Func InvitePlayers()
dim $Leechers
_FileReadToArray("Leechers.txt",$Leechers)
For $i = 1 To GetMaxAgents()
$Agent = GetAgentByID($i)
For $n = 1 to $Leechers[0]
If DllStructGetData($Agent,"LoginNumber") <> 0 and GetPlayerName($Agent) = $Leechers[$n] and GetPlayerName($Agent) <> GetPlayerName(-2) Then
InvitePlayer($Leechers[$n])
Sleep(200)
EndIf
Next
Next
EndFunc
Func ende()
Exit
EndFunc
Func CharacterSelector()
$gCharacterSelector = GUICreate('Weruda - HA Sync', 250, 100)
GUICtrlCreateGroup('Enter Character Name', 10, 10, 230, 80)
$gCharacterName = GUICtrlCreateCombo('', 20, 30, 200, 20)
$gCharacterStart = GUICtrlCreateButton('OK', 19, 60, 60, 21)
$gCharacterEnd = GUICtrlCreateButton('Abbrechen', 80, 60, 60, 21)
Local $CharacterNames = RetrieveCharacterNames()
GUICtrlSetData($gCharacterName, 'Select a character...|' & $CharacterNames, 'Select a character...')
GUICtrlSetState($gCharacterStart, $GUI_DEFBUTTON)
GUICtrlSetOnEvent($gCharacterStart, 'CharacterEventHandler')
GUICtrlSetOnEvent($gCharacterEnd, 'CharacterEventHandler')
GUICtrlSetOnEvent($GUI_EVENT_CLOSE, 'CharacterEventHandler')
GUISetOnEvent($GUI_EVENT_CLOSE, 'CharacterEventHandler')
GUISetState()
EndFunc
Func CharacterEventHandler()
Switch (@GUI_CtrlId)
Case $gCharacterStart
$CharName = GUICtrlRead($gCharacterName)
Initialize($CharName,True,True)
InvitePlayers()
GUIDelete($cGUI)
$bActive = True
Case $GUI_EVENT_CLOSE
Exit
Case $gCharacterEnd
Exit
EndSwitch
EndFunc
Func RetrieveCharacterNames()
Local $CharacterNames, $aWindows = WinList('[CLASS:ArenaNet_Dx_Window_Class]')
If $aWindows[0][0] == 0 Then Exit MsgBox(0x40030, 'Error!', 'No active game clients found.')
For $i = 1 To $aWindows[0][0]
MemoryOpen(WinGetProcess($aWindows[$i][1]))
Local $sFoundChar = ScanForCharname()
MemoryClose()
$mGWProcHandle = 0
If $sFoundChar == '' Then ContinueLoop
$CharacterNames &= $sFoundChar & '|'
Next
If StringRight($CharacterNames, 1) == '|' Then $CharacterNames = StringTrimRight($CharacterNames, 1)
If $aWindows[0][0] > 1 Then
Local $aCharNames = StringSplit($CharacterNames, '|')
$CharacterNames = ''
_ArraySort($aCharNames, 0, 1)
For $i = 1 To $aCharNames[0]
$CharacterNames &= $aCharNames[$i]
If $i <> $aCharNames[0] Then $CharacterNames &= '|'
Next
EndIf
Return $CharacterNames
EndFunc
#region controller
Func LoadSafe()
Const $iMapLoading = 2
Local $tDeadLock = TimerInit()
Do
Sleep(50)
Until $iMapLoading == GetMapLoading() Or TimerDiff($tDeadLock) > 40000
Do
Sleep(50)
Until $iMapLoading <> GetMapLoading() Or TimerDiff($tDeadLock) > 40000
Local $iTime = GetInstanceUpTime()
Do
Sleep(50)
Until GetInstanceUpTime() <> $iTime Or TimerDiff($tDeadLock) > 40000
For $i = 1 To 4
$iTime = GetInstanceUpTime()
Do
Sleep(50)
Until GetInstanceUpTime() > $iTime Or TimerDiff($tDeadLock) > 40000
Next
Sleep(500)
EndFunc
Func CheckEnches()
UseSkillEx(8,-2)
Sleep(400)
UseSkillEx(7, -2)
Sleep(1200)
EndFunc
Func UseSkillEx($lSkill, $lTgt = -2, $aTimeout = 3000)
TargetNearestEnemy()
$mSkillbar = GetSkillbar()
If GetIsDead(-2) Then Return
If Not IsRecharged($lSkill) Then Return
If GetEnergy(-2) < $skillCost[$lSkill] Then Return
Local $Skill = GetSkillByID(DllStructGetData($mSkillbar, 'Id' & $lSkill))
If DllStructGetData($mSkillbar, 'AdrenalineA' & $lSkill) < DllStructGetData($lSkill, 'Adrenaline') Then Return False
Local $lDeadlock = TimerInit()
UseSkill($lSkill, $lTgt)
Do
Sleep(50)
If GetIsDead(-2) = 1 Then Return
Until (Not IsRecharged($lSkill)) Or (TimerDiff($lDeadlock) > $aTimeout)
If $lSkill > 1 Then RndSleep(350)
EndFunc ;==>UseSkillEx
Func IsRecharged($lSkill)
Return GetSkillBarSkillRecharge($lSkill) == 0
EndFunc ;==>IsRecharged
Func AttackStuff()
$Enemies = 0
While $Enemies <> 6
$Enemies = 0
for $i = 1 To GetMaxAgents()
$Enemy = GetAgentByID($i)
if StringInStr(GetAgentName($Enemy),"Zaishen") > 0 and GetIsDead($Enemy) = True Then
;~ If GetPlayerName($i) = "" Then
$Enemies += 1
EndIf
Next
; ToolTip($Enemies)
For $i = 1 to 6
If IsRecharged($i) Then
TargetNearestEnemy()
Sleep(300)
UseSkill($i,-1)
ExitLoop
EndIf
Next
WEnd
EndFunc