Hello,
Well im trying to make a Fish bot. I can detect blobbers but that detects all blobbers which is bad. So i though $OBJECT_FIELD_CREATED_BY would do the trick.
But It fails. Proberly my code, heres what im using:
Code:
Const $aClientConnection = 0x12705B0
Const $ObjManagerOffset = 0x2d94
Const $ObjManagerFirstObject = 0xAC
Const $ObjManagerPlayerGUID = 0xC0
Const $ObjDescriptorOffset = 0x8
Const $ObjectTypeOffset = 0x14
Const $ObjectGUIDOffset = 0x30
Const $ObjectNextOffset = 0x3C
Const $GAMEOBJECT_NAMEOFFSET_1 = 0x1A4
Const $GAMEOBJECT_NAMEOFFSET_2 = 0x90
Const $aMouseOverGUID = 0x113D798
Const $aPlayerGUID = 0x4763A0
Const $OBJECT_FIELD_CREATED_BY = 0x6
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_Log("Bot exited")
Exit
EndSwitch
$ObjectManager = _BMReadUInt($handle, (_BMReadUInt($handle, $aClientConnection) + $ObjManagerOffset))
$FirstObject = _BMReadUInt($handle, ($ObjectManager + $ObjManagerFirstObject))
$curobject = _BMReadUInt($handle, ($curobject + $ObjectNextOffset))
$name = _BMReadASCIIString($handle, _BMReadUint($handle, (_BMReadUInt($handle, ($curobject + $GAMEOBJECT_NAMEOFFSET_1)) + $GAMEOBJECT_NAMEOFFSET_2)), 30)
$curGUID = _BMReadMemory($handle, ($curobject + 0x30), 'uint64')
$created_by = _WoWGetKnownField($handle, $curGUID, $OBJECT_FIELD_CREATED_BY)
If _WoWObjectIsFishingBobber($Handle, $curGUID) = "False" Then
Else
_log("Possible Fishing Blober found")
If $created_by = _WoWGetLocalGUID($Handle) Then
_log("Fishing Blober found - Waiting for bite")
Do
$blobbing = _BMReadShort($Handle, $curGUID + 0xBC)
Until $blobbing = 1
_Memorywrite($aMouseOverGUID, $handle, $curGUID, "byte[8]")
_BMWriteInt($handle, $aMouseOverGUID + 0x1C, "7") ;fish
EndIf
EndIf
WEnd
Func _WoWObjectIsFishingBobber($Handle, $ObjectBase)
Return (_WoWGetKnownField($Handle, $ObjectBase, $GAMEOBJECT_DISPLAYID) = $FishingBobberDisplayId)
EndFunc ;==>_WoWObjectIsFishingBobber
Func _WoWGetLocalGUID($Handle)
Return _BMReadInt($Handle, $aPlayerGUID)
EndFunc ;==>_WoWGetLocalGUID
I have a feeling $OBJECT_FIELD_CREATED_BY is incorrect, however im not sure. Am I doing this the right way?