-- bumping this thread because if you are trying to learn scripting... there is quite a bit here!
:rtfm:
:rtfm:
Func SkeleBoom()
Local $lSkeleID = GetSkeleID()
; spike it.
ChangeTarget($lSkeleID)
Out("Pulling Skeleton...")
UseSkill($Dash, -2)
UseSkill($HoS, $lSkeleID)
Do
Sleep(300)
Until GetSkillbarSkillRecharge($HoS) > 0 Or GetIsDead(-2)
UseSkill($ShadowSanctuary, -2)
Sleep(750)
Out("Spiking...")
UseSkill($smokepowderdefense, -2)
Sleep(300)
UseSkill($DeathsCharge, $lSkeleID, True)
Do
Sleep(150)
Until GetSkillbarSkillRecharge($DeathsCharge) > 0 Or GetIsDead(-2)
UseSkill($YMLaD, $lSkeleID)
Sleep(100)
UseSkill($BaneSignet, $lSkeleID)
Do
Sleep(50)
Until DllStructGetData(GetAgentByID($lSkeleID), 'HP') < .5 Or GetIsDead(-2) Or GetIsDead($lSkeleID)
UseSkill($FinishHim, $lSkeleID)
Do
Sleep(50)
Until GetIsDead($lSkeleID) Or GetIsDead(-2)
If Not GetIsDead(-2) Then
Out("Harvesting Skeleton Soul")
UseItem(GetItemByModelID($MODEL_ID_MOBSTOPPER))
Out("Checking for Ectos and shinies.")
Else
$fails += 1
EndIf
Out("Run over, resigning")
Resign()
WaitForPartyWipe()
Sleep(150)
Out("Returning to City")
If DllStructGetData(GetAgentByID(-2), 'PlayerNumber') == 1 Then ReturnToOutpost()
Sleep(500)
If getmapID() = Then
Do
Sleep(500)
If DllStructGetData(GetAgentByID(-2), "PlayerNumber") == 1 Then ReturnToOutpost()
Until getmapID() <> 72
EndIf
EndFunc ;==>SkeleBoom
Global Const $MODEL_ID_MOBSTOPPER = 32558 Global Const $MODEL_ID_CAPTURED_SKELETON = 32559
Func IsDualVampZeal($aItem)
Local $Type = DllStructGetData($aItem, "Type")
Local $Rarity = GetRarity($aItem)
Local $DV15 = 0
Local $DV14 = 0
Local $DZ15 = 0
Local $DZ14 = 0
If $Rarity == $RARITY_GOLD Then
If $Type == $TYPE_BOW Or $Type == $TYPE_SWORD Or $Type == $TYPE_HAMMER Or $Type == $TYPE_AXE Then
Local $ModStruct = GetModStruct($aItem)
$DV15 = StringInStr($ModStruct, "0F0038220100E820", 0, 1) ;DV15%
$DV14 = StringInStr($ModStruct, "0E0038220100E820", 0, 1) ;DV14%
$DZ15 = StringInStr($ModStruct, "0F0038220100C820", 0, 1) ;DZ15%
$DZ14 = StringInStr($ModStruct, "0E0038220100C820", 0, 1) ;DZ14%
EndIf
EndIf
If $DV15 > 0 Or $DV14 > 0 Or $DZ15 > 0 Or $DZ14 > 0 Then
Return True
Else
Return False
EndIf
EndFunc
Func ActionInteract() Return PerformAction(0x80, 0x1E) EndFunc ;==>ActionInteract
ChangeTarget(GetAgentByName('Lever'))
Actioninteract()
Quote:
;~ Description: Same as hitting spacebar.
Code:Func ActionInteract() Return PerformAction(0x80, 0x1E) EndFunc ;==>ActionInteractIs there another/better solution to this?Code:ChangeTarget(GetAgentByName('Lever')) Actioninteract()
Func _GetAgentByGadgetID($nGadgetID) Local $aAgentArray = GetAgentArray();This may differ depending on GWA2 possible to get it already filtered For $i = 1 To $aAgentArray[0] ;Do this for every agent in agent array If DllStructGetData($aAgentArray[$i], 'Type' ) <> 0x200 Then ContinueLoop ;If agent isn't gadget go to next agent If DllStructGetData($aAgentArray[$i], 'ExtraType') = $nGadgetID Then ;Extra type = Gadget ID Return $aAgentArray[$i];return the agent EndIf Next Return 0; returns 0 if Gadget wasn't found EndFunc Do $Lever = _GetAgentByGadgetID($GadgetID_Lever) ActionInteract(); Can send packet instead of using perform action Sleep(100) Until DllStructGetData($Lever,'NameProperties') = $LeverNamePropertiesAfterUse ;Or If IAmDead() Or Timerdiff($DeadlockTimer) > $TimeItTakes
Quote:
I didn't find a modstruct string for dual vamp/zeal OS weapons, so I found the byte pattern and made a simple func. I figure maybe someone will have a use for it.
EDIT: Found an edge case where it grabbed 15 -5e and 15 -10 weapons so updated patterns so those are skipped now.Code:Func IsDualVampZeal($aItem) Local $Type = DllStructGetData($aItem, "Type") Local $Rarity = GetRarity($aItem) Local $DV15 = 0 Local $DV14 = 0 Local $DZ15 = 0 Local $DZ14 = 0 If $Rarity == $RARITY_GOLD Then If $Type == $TYPE_BOW Or $Type == $TYPE_SWORD Or $Type == $TYPE_HAMMER Or $Type == $TYPE_AXE Then Local $ModStruct = GetModStruct($aItem) $DV15 = StringInStr($ModStruct, "0F0038220100E820", 0, 1) ;DV15% $DV14 = StringInStr($ModStruct, "0E0038220100E820", 0, 1) ;DV14% $DZ15 = StringInStr($ModStruct, "0F0038220100C820", 0, 1) ;DZ15% $DZ14 = StringInStr($ModStruct, "0E0038220100C820", 0, 1) ;DZ14% EndIf EndIf If $DV15 > 0 Or $DV14 > 0 Or $DZ15 > 0 Or $DZ14 > 0 Then Return True Else Return False EndIf EndFunc
Local $BrawnOverBrains = StringInStr($sModString,"0500B820", 0, 1);Energy -5
Local $ToThePain = StringInStr($sModString,"0A001820", 0, 1);Armor -10 (while attacking)
Local $HealthRegen = StringInStr($sModString,"0100E820", 0, 1);Health regeneration -1
Local $DamageAlwaysRoll = GetAlwaysDmgRoll($aItem)
If $DamageAlwaysRoll > 14 And $HealthRegen > 0 Then ; if 15% dmg and -1hp
If $ToThePain > 0 Or $BrawnOverBrains > 0 Then Return False; if 15% -10 vamp Or 15% -5energy vamp return false
Return True ; if it made it here then its a dual vamp
EndIf
;returns roll of dmg modifier $DamageAlways = StringInStr($iModString,"0F00[3822]", 0, 1);Damage +15%
Func GetAlwaysDmgRoll($aItem)
Local $1Mod = GetModByIdentifier($aItem, "3822")
Return $1Mod[0]
EndFunc
Func IsDualVampZeal($aItem)
Local $Type = DllStructGetData($aItem, "Type")
Local $Rarity = GetRarity($aItem)
While 1
For $i = 1 To GetMaxAgents()
$lAgent = GetAgentByID($i)
$aEnemy = DllStructGetData($lAgent, 'Allegiance')
$Skill = DllStructGetData($lAgent, "Skill")
If $aEnemy == 3 Then
$tTarget = GetTarget($lAgent)
MsgBox(1, "AgentID", $tTarget)
EndIf
Next
WEnd
Quote:
Hi everyone,
i'm new to coding and I hope this is the right place to ask. I'm trying to learn by doing some simple scripts. Therefore I want to output the id of an enemy target into a MsgBox.
This is my code:
Somehow it returns always 0. Is my logic behind this wrong? Is there any approach to get the correct agent ID? Thanks very much in advance :)Code:While 1 For $i = 1 To GetMaxAgents() $lAgent = GetAgentByID($i) $aEnemy = DllStructGetData($lAgent, 'Allegiance') $Skill = DllStructGetData($lAgent, "Skill") If $aEnemy == 3 Then $tTarget = GetTarget($lAgent) MsgBox(1, "AgentID", $tTarget) EndIf Next WEnd
While 1
For $i = 1 To GetMaxAgents()
$lAgent = GetAgentByID($i)
$lEnemy = DllStructGetData($lAgent, 'Allegiance')
If $lEnemy = 3 Then
$lAgentID = DllStructGetData($lAgent, 'ID')
MsgBox(1, "AgentID", $lAgentID )
EndIf
Next
WEnd
Thank you very much for your reply! :) Could you give me any hint where I can find information in the forum regarding to update the function? Or a rough direction on steps that are needed? (I'm aware, that I might not have the skills yet to do so and it is a complicated task)Quote:
Try this:
Edit:Code:While 1 For $i = 1 To GetMaxAgents() $lAgent = GetAgentByID($i) $lEnemy = DllStructGetData($lAgent, 'Allegiance') If $lEnemy = 3 Then $lAgentID = DllStructGetData($lAgent, 'ID') MsgBox(1, "AgentID", $lAgentID ) EndIf Next WEnd
Ohh, I totally missunderstood your question :)
Well, "GetTarget()" doesn't work because nobody updated the related Function "CreateTargetLog()"
I believe the very most of the community here do not have the skill to update such low level stuff. Also i don't share the updated function because it can be used to (rupt)bot in pvp which is a no-go for me ...Quote:
Thank you very much for your reply! :) Could you give me any hint where I can find information in the forum regarding to update the function? Or a rough direction on steps that are needed? (I'm aware, that I might not have the skills yet to do so and it is a complicated task)
Thank you!
Chest run bot such as the pong mei or boreal basically does all of that but instead of flowers looks for chests.Quote:
ok so i wanna learn how to code! My idea for a Red Iris Flower Farmer... i dont know what func im looking for....
1. Get map ID
2. if not ashford, map there
3. when mapping random District
4. when mapped, retreive spawn point
5. when spawn is located, start pathing to portal
6. exit portal, load
7. done loading, path to x,y,z
8. while pathing look for flower
9. once located flower interact with flower to pick up
10. once picked up map with random district
11. loop
Is there somewher i can look for reference?