I'm trying to print at my bot the target X position, however i'm not getting it. What is being printed is 0 always. My knowledge about programming is only one year of studying C++ at college, so don't judge me. I'm using this code:
Code:
public int getTargetID()
{
return ReadInt32(Tibia.Handle, targetidAdr);
}
Code:
public UInt32 getTargetAdr()
{
int tId = getTargetID();
UInt32 battleListIdAdr = 0x05C68B0;
UInt32 targetAdr = 0;
for (int i = 0; i <= 250; i++)
{
if (ReadInt32(Tibia.Handle, battleListIdAdr + i * 156) == tId)
{
targetAdr = Convert.ToUInt32(battleListIdAdr + i * 156);
}
}
return targetAdr;
}
Code:
public int getTargetXPos()
{
UInt32 targetAdr = getTargetAdr();
int xpos;
xpos = ReadInt32(Tibia.Handle, targetAdr + 32);
return xpos;
}
Code:
txpos = getTargetXPos();
label22.Text = Convert.ToString(txpos);
It's a bot for tibia 7.72, the creature step is 156. Can you guys help me?