Page 29 of 30 FirstFirst ... 1927282930 LastLast
Results 281 to 290 of 295

Thread: OK to ASK FOR HELP HERE!

  1. #281
    looks fine to me, keep in mind that you arent checking for enemies in the path between you and the item

  2. #282
    Junior Member
    Join Date
    Jul 2014
    Posts
    27
    Quote Originally Posted by Maverick View Post
    Ok I want to add this to my CanPickup(), if an item drops and it's far from other enemies (i.e. picking it up does not cause aggro) pick it up. I tried this but doesn't work:

    Code:
    	Local $ItemX = DllStructGetData($aItem, 'X')
    	Local $ItemY = DllStructGetData($aItem, 'Y')
            Local $NearestEnemy = GetNearestEnemyToCoords($ItemX, $ItemY)
            Local $EnemyDistance = ComputeDistance($ItemX, $ItemY, DllStructGetData($NearestEnemy, 'X'), DllStructGetData($NearestEnemy, 'Y'))
            If $EnemyDistance > 1400 Then Return True
    I now wrote this but not sure if this would help either:

    Code:
    Func GetNumberOfEnemiesInRangeOfItem($aItem, $aRange = 1400)
    	Local $lDistance
    	Local $nOfEnemies = 0
    	Local $lAgentArray = GetAgentArray(0xDB)
    	For $i = 1 To $lAgentArray[0]
    		If DllStructGetData($lAgentArray[$i], 'Allegiance') <> 3 Then ContinueLoop
    		If DllStructGetData($lAgentArray[$i], 'HP') <= 0 Then ContinueLoop
    		If BitAND(DllStructGetData($lAgentArray[$i], 'Effects'), 0x0010) > 0 Then ContinueLoop
    		$lDistance = (DllStructGetData($aItem, 'X') - DllStructGetData($lAgentArray[$i], 'X')) ^ 2 + (DllStructGetData($aItem, 'Y') - DllStructGetData($lAgentArray[$i], 'Y')) ^ 2
    		If $lDistance < $aRange Then
    			$nOfEnemies += 1
    		EndIf
    	Next
    	Return $nOfEnemies
    EndFunc   ;==>GetNumberOfEnemiesInRangeOfItem
    This can not work lol . There is no X and Y within the Item Struct ... you must call it with Agent Struct!

  3. #283
    Senior Member Maverick's Avatar
    Join Date
    Dec 2009
    Posts
    474
    Quote Originally Posted by DerMoench View Post
    This can not work lol . There is no X and Y within the Item Struct ... you must call it with Agent Struct!
    Correct! I figured it out eventually and added it in my pickup func which deals with the agents Thanks for your reply nonetheless!
    (╯□)╯︵ ┻━┻

  4. #284
    Junior Member
    Join Date
    Jan 2016
    Posts
    7
    hey guys,
    how can i prevent a bot to not attack a vertain modelid?
    i tryed something like this
    Do
    RndSleep(250)
    $nearestenemy = GetNearestEnemyToAgent(-2)
    Until DllStructGetData($nearestenemy, 'ID') <> 0 AND DllStructGetData($nearestenemy, 'ID') <> 2228 AND DllStructGetData($nearestenemy, 'ID') <> 5710
    but i don't know why it doesn't work.
    maybe someone can give me a hint

  5. #285
    Junior Member
    Join Date
    Jan 2017
    Posts
    19
    hi guys im having trouble running frog scepter bot, ive tried the master collection one but it just disconects me, so ive tried the one here and i get this error

    if $DeadOnTheRun = 0 Then Fight($z $s)
    if $DeadOnTheRun = 0 then ^ ERROR

    Error Unknown function name.

    can someone help me fix this plz ive tried deleting it but the bot doesnt work proply then ty in advance.

  6. #286
    Senior Member
    Join Date
    Oct 2009
    Posts
    205
    you have a problem with your fight function.

  7. #287
    Junior Member
    Join Date
    Jul 2014
    Posts
    27
    I would say he doesn't have that Func

  8. #288
    Junior Member
    Join Date
    Jan 2017
    Posts
    19
    how would i fix it plz

  9. #289
    Junior Member
    Join Date
    Jan 2017
    Posts
    19
    Func AggroMoveToEx2($x, $y, $s = "", $z = 1450)
    Local $TimerToKill = TimerInit()
    Update("Hunting " & $s)
    $random = 50
    $iBlocked = 0

    If $DeadOnTheRun = 0 Then Move($x, $y, $random)

    $lMe = GetAgentByID(-2)
    $coordsX = DllStructGetData($lMe, "X")
    $coordsY = DllStructGetData($lMe, "Y")

    If $DeadOnTheRun = 0 Then
    Do
    If $DeadOnTheRun = 1 Then ExitLoop
    ;If $DeadOnTheRun = 0 Then RndSlp(250) //////
    $oldCoordsX = $coordsX
    $oldCoordsY = $coordsY
    $nearestenemy = GetNearestEnemyToAgent(-2)
    $lDistance = GetDistance($nearestenemy, -2)
    If $DeadOnTheRun = 1 Then ExitLoop
    If $lDistance < $z And DllStructGetData($nearestenemy, 'ID') <> 0 And $DeadOnTheRun = 0 Then
    ;If $lDistance < $z AND DllStructGetData($nearestenemy, 'ID') <> 0 Then
    If $DeadOnTheRun = 0 Then Fight($z, $s)
    EndIf
    ;If $DeadOnTheRun = 0 Then RndSlp(250) /////
    $lMe = GetAgentByID(-2)
    $coordsX = DllStructGetData($lMe, "X")
    $coordsY = DllStructGetData($lMe, "Y")
    If $oldCoordsX = $coordsX And $oldCoordsY = $coordsY Then
    $iBlocked += 1
    If $DeadOnTheRun = 0 Then Move($coordsX, $coordsY, 500)
    If $DeadOnTheRun = 0 Then RndSlp(350)
    If $DeadOnTheRun = 0 Then Move($x, $y, $random)
    EndIf
    Until ComputeDistanceEx($coordsX, $coordsY, $x, $y) < 250 Or $iBlocked > 20 Or $DeadOnTheRun = 1
    EndIf
    $TimerToKillDiff = TimerDiff($TimerToKill)
    $text = StringFormat("min: %03u sec: %02u ", $TimerToKillDiff / 1000 / 60, Mod($TimerToKillDiff / 1000, 60))
    FileWriteLine($File, $enemy & " en ================================== > " & $text & @CRLF)
    EndFunc ;==>AggroMoveToEx2

    is this the fight function?

  10. #290
    Senior Member
    Join Date
    Oct 2009
    Posts
    205
    Start here: http://wiki.gamerevision.com/index.php/GWA2
    Learn what a function is and try to find the one you are missing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •