Multisend is a replacement for servo. No synchronization is needed, just load and go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
1.3 KiB

#include "MultiSend.h"
uint32_t MultiSend::ThreadEntry(void)
{
while (!this->IsTerminated())
{
if (p_MMF->Follow.target_process_id == GetCurrentProcessId())
{
uint16_t zone = m_AshitaCore->GetDataManager()->GetParty()->GetMemberZone(0);
uint16_t myindex = m_AshitaCore->GetDataManager()->GetParty()->GetMemberTargetIndex(0);
uint32_t renderflags = m_AshitaCore->GetDataManager()->GetEntity()->GetRenderFlags0(myindex);
bool isrendered = (((renderflags & 0x200) != 0) && ((renderflags & 0x4000) == 0));
float my_pos_x = m_AshitaCore->GetDataManager()->GetEntity()->GetLocalX(myindex);
float my_pos_z = m_AshitaCore->GetDataManager()->GetEntity()->GetLocalZ(myindex);
if ((zone == 0) || (myindex == 0) || (!isrendered))
{
if (p_MMF->Follow.zone != 0)
{
p_MMF->Follow.lastzone = p_MMF->Follow.zone;
}
p_MMF->Follow.zone = 0;
}
else
{
if (p_MMF->Follow.zone == 0)
{
p_MMF->Follow.idle_count = 0;
}
else if ((my_pos_x != p_MMF->Follow.position_x) || (my_pos_z != p_MMF->Follow.position_z))
{
p_MMF->Follow.idle_count = 0;
}
else p_MMF->Follow.idle_count++;
p_MMF->Follow.zone = zone;
p_MMF->Follow.position_x = my_pos_x;
p_MMF->Follow.position_z = my_pos_z;
}
}
while (ReadCommand()) {}
::Sleep(1);
}
return 0;
}