OK to ask for exploit/Scripting help here...

09/15/2020 05:46 phat34#271
-- bumping this thread because if you are trying to learn scripting... there is quite a bit here!

:rtfm:
09/27/2020 22:38 natanders#272
Having a bit of trouble here.

Map_Id travel func
10/20/2020 02:41 natanders#273
Code:
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
Code:
Global Const $MODEL_ID_MOBSTOPPER = 32558
Global Const $MODEL_ID_CAPTURED_SKELETON = 32559

why is it not using a mobstopper on top of skeleton
10/26/2020 01:07 list comprehension#274
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.
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
EDIT: Found an edge case where it grabbed 15 -5e and 15 -10 weapons so updated patterns so those are skipped now.
11/05/2020 16:48 natanders#275
;~ Description: Same as hitting spacebar.
Code:
Func ActionInteract()
	Return PerformAction(0x80, 0x1E)
EndFunc   ;==>ActionInteract
Code:
ChangeTarget(GetAgentByName('Lever'))
Actioninteract()
Is there another/better solution to this?
11/06/2020 07:28 ayyy_lmao#276
Quote:
Originally Posted by natanders View Post
;~ Description: Same as hitting spacebar.
Code:
Func ActionInteract()
	Return PerformAction(0x80, 0x1E)
EndFunc   ;==>ActionInteract
Code:
ChangeTarget(GetAgentByName('Lever'))
Actioninteract()
Is there another/better solution to this?
Code:
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
A rough way to do it. Forgot if you're using action interact that you need to change target to the agent before interacting but hopefully you get the idea

Quote:
Originally Posted by list comprehension View Post
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.
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
EDIT: Found an edge case where it grabbed 15 -5e and 15 -10 weapons so updated patterns so those are skipped now.
Code:
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
I usually do something along those lines. Experiment with GetModByIdentifier it will make your life easy.
Code:
Func IsDualVampZeal($aItem)
    Local $Type = DllStructGetData($aItem, "Type")
    Local $Rarity = GetRarity($aItem)
alot of times you already read those in the function that's calling IsDualVampZeal so you if you want to speed it up just send it with the function Func IsDualVampZeal($aItem,$Type,$Rarity)
11/08/2020 21:06 Greg76#277
Hi, can someone explain to me how the GetAgEntexists func works?
i tried something like this:


I just want him to check if there is an NPC, if there is one, go see him, do the dialogue and continue, but if there is no one, skip this step and continue to moving forward
the NPC I'm looking for isn't always there
11/09/2020 02:21 ayyy_lmao#278
Search the agent array for renks modelid/playernumber and if it doesn't find it then he's not there
01/09/2021 15:09 Colekangaroo#279
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:
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
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 :)
01/10/2021 23:49 DerMoench14#280
Quote:
Originally Posted by Colekangaroo View Post
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:
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
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 :)

Try this:

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
Edit:
Ohh, I totally missunderstood your question :)
Well, "GetTarget()" doesn't work because nobody updated the related Function "CreateTargetLog()"
01/11/2021 12:16 Colekangaroo#281
Quote:
Originally Posted by DerMoench14 View Post
Try this:

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
Edit:
Ohh, I totally missunderstood your question :)
Well, "GetTarget()" doesn't work because nobody updated the related Function "CreateTargetLog()"
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!
01/11/2021 15:46 DerMoench14#282
Quote:
Originally Posted by Colekangaroo View Post
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!
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 ...
Is there any useful use for it beside pvp?
01/11/2021 17:25 zolf02#283
Hello everyone !

My boreal chest runner 1.8 doesn't work with the latest GWA2, is there any new version please ?

Thanks by advance !

Edit : found someone who fixed it [Only registered and activated users can see links. Click Here To Register...] ! Thanks !
01/20/2021 19:00 Mad head Trip#284
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?
01/21/2021 01:05 list comprehension#285
Quote:
Originally Posted by Mad head Trip View Post
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?
Chest run bot such as the pong mei or boreal basically does all of that but instead of flowers looks for chests.