yo for this script im writing I need to check if the retards spawned but getagentarray sometimes isn't finding them even though they are in compass so I've tried gettingnpcnearestcoords/getagentnearcoords then I tried seeing the furthest distance of an agent in getagentarray and walk to it but it seems to only like signposts. Any one have clue on what range of agents should be in agentarray? Here was test thing
Code:
Func AutisticTest()
$Yo = GetAgentPtr(-2)
local $aXcoordinate = MemoryRead($Yo + 160, 'float')
local $aYcoordinate = MemoryRead($Yo + 164, 'float')
local $lastAgentDistance = 0
local $Furthestagent = 0
Local $OnIndex = 0
$nice = GetAgentArray()
For $i = 1 To $nice[0]
$OnIndex += 1
$lAgentCoords = GetAgentXY($nice[$i])
$currentAgentDistance = ComputeDistance($aXcoordinate, $aYcoordinate, $lAgentCoords[0], $lAgentCoords[1])
Out($OnIndex & " " &$currentAgentDistance)
If $currentAgentDistance > $lastAgentDistance and $currentAgentDistance > $Furthestagent Then
$Furthestagent= $nice[$i]
EndIf
Next
$OutAgentPlayernumber = dllstructgetdata($Furthestagent, 'Playernumber')
Out($OutAgentPlayernumber & " " & $Furthestagent)
gotonpc($Furthestagent)
EndFunc
and here is the code for looking for spawn
Code:
Func LookForUglyAssRetards()
Local $AllAgentsArray = GetAgentArray()
For $i = 1 To $AllAgentsArray[0]
If DllStructGetData($AllAgentsArray[$i], 'PlayerNumber') == $1ModelId Then
$DidTheySpawn = True
return true
EndIf
If DllStructGetData($AllAgentsArray[$i], 'PlayerNumber') == $2ModelId Then
$DidTheySpawn = True
return true
EndIf
Next
$DidTheySpawn = False
Return False
EndFunc
also im trying to use the event system to update some vars but Its not seeing "you pick up" "you droped" like those type of messages I looked at how tb handles the chat because I know they block some of the messages and it looks like TB goes through every packet of chat which is probably not possible with api im using anyone have idea?
I've always checked for agents using name, never fails for me.
Code:
Local $NameToSearch = ""
TargetNearestAlly()
$lAgent = GetNearestNPCToCoords(xxxxxxxx)
$lName = GetAgentName($lAgent)
If $lName = $NameToSearch Then
$bCanContinue = True
Else
$bCanContinue = False
EndIf
If thats not what your looking for since you mentioned Coords, you could try GetAgentByName. That seems to cycle through Agents similar to how your trying to, and I use it for most Merchant functions, however it does not always work iirc.
If it is a unique agent maybe something like:
Code:
For $i = 1 To GetMaxAgents()
$lAgent = GetAgentByID($i)
$lName = GetAgentName($lAgent)
If $lName = $NameToSearch Then ContinueLoop
Next
;~ Or
For $i = 1 To GetMaxAgents()
If GetAgentExists(GetAgentByName($NameToSearch)) Then ContinueLoop
Next
You would probably have to to give him your asm for that function as well DerMonench14 as he is probably using the gwa2 that most people have migrated to,,,
I need your help / advice on a function of mine...
Code:
; ~ Description: Returns number of foes which meet certain conditions, given by the parameter
; ~ $HPPercentage = from 0(=0%) to 1(=100%), set the HP in % to return all valid enemies with less than your set %
; ~ $aKilledFoes = start this function if a certain amount of foes are killed (only works in HM)
; ~ $aRange = returns all valid enemies within this range
Func GetRemainingFoes($HPPercentage = 1, $aKilledFoes = 0, $aRange = $RANGE_NEARBY)
If GetFoesKilled() > $aKilledFoes Then
Local $lAgentArray = GetAgentArray(0xDB)
Local $lMe = GetAgentById(-2)
Local $lFoeCount = 0
For $i = 1 To $lAgentArray[0]
;If $lAgentArray[$i] = 0 Then ContinueLoop ; no Agent
If Not GetIsEnemy($lAgentArray[$i]) Then ContinueLoop ; not an enemy
If Not GetIsAlive($lAgentArray[$i]) Then ContinueLoop ; not alive
$Distance = GetDistance($lAgentArray[$i], -2)
If $Distance > $aRange Then ContinueLoop ; not in range
If GetTarget($lAgentArray[$i]) <> $lMe Then ContinueLoop ; not targeting me
$HP = DllStructGetData($lAgentArray[$i], 'HP')
If $HP > $HPPercentage Then ContinueLoop ; ignore the enemy if it has more than the set HP %
$lFoeCount += 1
Next
Return $lFoeCount
EndIf
EndFunc ;==>CheckRemainingFoes
Is this viable to check the remaining amount of foes in a kill loop?
Since my problem is that most functions don't work in loops (i think because they are called too much in a loop so they simply return 0).
I tried to use this function in a killing loop:
Code:
Func GetEnemiesWithinRange($aRange = $RANGE_AREA)
Local $lAgentArray = GetAgentArray(0xDB)
Local $lSubArray[$lAgentArray[0] + 1]
$lSubArray[0] = 0
Local $lMeXY = GetAgentXY(-2)
For $i = 1 To $lAgentArray[0]
If GetIsEnemy($lAgentArray[$i]) = 0 Or GetIsDead($lAgentArray[$i]) Then ContinueLoop
Local $lTargetXY = GetAgentXY($lAgentArray[$i])
If ComputeDistance($lMeXY[0], $lMeXY[1], $lTargetXY[0], $lTargetXY[1]) > $aRange Then ContinueLoop
$lSubArray[0] += 1
$lSubArray[$lSubArray[0]] = $lAgentArray[$i]
Next
ReDim $lSubArray[$lSubArray[0] + 1]
Return $lSubArray
EndFunc ;==>GetEnemiesWithinRange
Hello guys, i got hacked and gm didnt help me :( so i ask for help here 12/22/2009 - Kal Online - 25 Replies Hello guys, i got hacked 7 days ago, i sent a c/s to gms connected my id card, they told me twrite back after 7 days...
GM Reply
Hello.
This is Kalonline.
We checked over your report and blocked hackers.
HELP! I need help scripting 02/06/2007 - Conquer Online 2 - 1 Replies OK, I want to know how u ppl do it! I what program do u use to make them? cause i wanna help but i dun know how... somone plz reply!
L2Walker, scripting questions/help 12/13/2006 - Lineage 2 - 0 Replies Hey, just asking a few questions hope you don't mind ^_^
I'm looking to make a script so when I cast magic on something, the walker bot will cast, say Wind Strike, on the same thing, at the same time.
I've looked through the options in walker and have it setup now, but it doesn't cast at the same time, but when I've finished casting.
If this isn't possible, last time I checked Walker scripts could not pickup what was said in chat, is this still the case?
Thanks. ^_^
Note: If you...
I need help scripting 09/05/2006 - General Coding - 0 Replies Ok I am tired of leeching I am ready to try my hand at scripting but I dont know where to start and I was wondering if someone could help me get started or tell me a website that can help me learn so I can make my own hacks and contribute to the epvp community that we all love :D