I try to get my bot program running with the new offsets in 1.0.4. I can move the character. However I cannot make the character attack the monster.
I google many days, I learnt how to diff to find the new offset, however with the new offset the "interact"(attack) is still not working.
I really appreciate if anyone can help. I'm thinking is that in 1.0.4 the interaction parameters has been changed? or the structures? Thanks.
Here is the segment of code about "interact"/attack:
Code:
public static uint interact = 0x1543B84; //Hint: 0x015A0BD4 was the old value before 1.0.4
public static uint interactOffsetA = 0xA8;
public static uint interactOffsetB = 0x58;
public static uint interactOffsetUNK1 = 0x7F20; // set to 777C
public static uint interactOffsetUNK2 = 0x7F44; // set to 1 for NPC interaction
public static uint interactOffsetUNK3 = 0x7F7C; // set to 7546 for NPC interaction, 7545 for loot interaction
public static uint interactOffsetUNK4 = 0x7F80; // set to 7546 for NPC interaction, 7545 for loot interaction
public static uint interactOffsetMousestate = 0x7F84; // mouse state 1 = clicked, 2 = mouse down
public static uint interactOffsetGUID = 0x7F88; // set to the GUID of the actor you want to interact with
public static uint itrInteractA = mem.ReadMemoryAsUint(interact);
public static uint itrInteractB = mem.ReadMemoryAsUint(itrInteractA);
public static uint itrInteractC = mem.ReadMemoryAsUint(itrInteractB);
public static uint itrInteractD = mem.ReadMemoryAsUint(itrInteractC + interactOffsetA);
public static uint itrInteractE = itrInteractD + interactOffsetB;
Code:
public static void PowerUseGUID(uint guid, uint snoPower)
{
Vec3 pos = Data.GetCurrentPos();
mem.WriteMemoryAsInt(Offsets.itrInteractE + Offsets.interactOffsetUNK1, 0x777C);
mem.WriteMemoryAsInt(Offsets.itrInteractE + Offsets.interactOffsetUNK2, 0x1);
mem.WriteMemoryAsInt(Offsets.itrInteractE + Offsets.interactOffsetUNK3, (int)snoPower);
mem.WriteMemoryAsInt(Offsets.itrInteractE + Offsets.interactOffsetUNK4, (int)snoPower);
mem.WriteMemoryAsInt(Offsets.itrInteractE + Offsets.interactOffsetMousestate, 0x1);
mem.WriteMemoryAsInt(Offsets.itrInteractE + Offsets.interactOffsetGUID, (int)guid);
mem.WriteMemoryAsFloat(Offsets.clickToMoveToX, pos.x + 1);
mem.WriteMemoryAsFloat(Offsets.clickToMoveToY, pos.y);
mem.WriteMemoryAsFloat(Offsets.clickToMoveToZ, pos.z);
mem.WriteMemoryAsInt(Offsets.clickToMoveToggle, 1);
mem.WriteMemoryAsInt(Offsets.clickToMoveFix, 69736);
interactTimer.Elapsed += new System.Timers.ElapsedEventHandler(interactTimer_Elapsed);
interactTimer.Enabled = true;
interactTimer.Start();
}