Lol ofc it doesn't work. You need to call the Function with the Player-ID (Agent-ID), not the Player-Struct :D
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
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
I've always checked for agents using name, never fails for me.Quote:
-snip-
Local $NameToSearch = "" TargetNearestAlly() $lAgent = GetNearestNPCToCoords(xxxxxxxx) $lName = GetAgentName($lAgent) If $lName = $NameToSearch Then $bCanContinue = True Else $bCanContinue = False EndIf
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
ty alot! i didnt saw it!Quote:
yes there is. if you use [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...] you can do:Code:;~ Description: Change online status. 0 = Offline, 1 = Online, 2 = Do not disturb, 3 = Away SetPlayerStatus($iStatus)
#Region Online Status ;<-- change player status ;~ Description: Change online status. 0 = Offline, 1 = Online, 2 = Do not disturb, 3 = Away Func SetPlayerStatus($iStatus) If (($iStatus >= 0 And $iStatus <= 3) And (GetPlayerStatus() <> $iStatus)) Then DllStructSetData($mChangeStatus, 2, $iStatus) Enqueue($mChangeStatusPtr, 8) Return True Else Return False EndIf EndFunc ;==>SetPlayerStatus Func GetPlayerStatus() Return MemoryRead($mCurrentStatus) EndFunc ;==>GetPlayerStatus ;<-- change player status #EndRegion Online Status
i got client crash while the bot is changing statusQuote:
I was just about to copy you those functions... Let me know if that worked?
Code:#Region Online Status ;<-- change player status ;~ Description: Change online status. 0 = Offline, 1 = Online, 2 = Do not disturb, 3 = Away Func SetPlayerStatus($iStatus) If (($iStatus >= 0 And $iStatus <= 3) And (GetPlayerStatus() <> $iStatus)) Then DllStructSetData($mChangeStatus, 2, $iStatus) Enqueue($mChangeStatusPtr, 8) Return True Else Return False EndIf EndFunc ;==>SetPlayerStatus Func GetPlayerStatus() Return MemoryRead($mCurrentStatus) EndFunc ;==>GetPlayerStatus ;<-- change player status #EndRegion Online Status
Try this:Quote:
i dont know what im doing wrong.. didnt happen anything
$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', 106))
SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", 74), 8))
_('ScanChangeStatusFunction:')
AddPattern('8D56088D4E3050')
nothing again i think i will remove this func on my botsQuote:
Try this:
Code:$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', 106)) SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", 74), 8)) _('ScanChangeStatusFunction:') AddPattern('8D56088D4E3050')
; ~ 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
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