Infinite Monkeys
Community Developer
- Joined
- Jul 7, 2012
- Messages
- 224
- Reaction score
- 16
I'm trying to write an addon to capture beasts while mapping. It's currently finding the Bestiary monsters successfully, and approaching them, but the actual net input does nothing. This is what I have for the 'throw net' action:
The check succeeds and the 'throwing net' log message is displayed, but no net is actually thrown. I've also tried simulating a key down then a key up, like this:
That didn't work either. Anyone know how to get this working?
e: Also, when using the Task system, does returning true prevent the next tasks from being executed? It seems like the combat routine is running even when the Bestiary task returns true.
Code:
LokiPoe.Input.HighlightObject(target);
if(LokiPoe.InGameState.CurrentTarget == target)
{
GlobalLog.Warn($"[CaptureBeastTask] Throwing net at Bestiary monster: " + target.Name);
LokiPoe.Input.SimulateKeyEvent(LokiPoe.Input.Binding.throw_net, true, false, false);
return true;
}
The check succeeds and the 'throwing net' log message is displayed, but no net is actually thrown. I've also tried simulating a key down then a key up, like this:
Code:
if(LokiPoe.InGameState.CurrentTarget == target)
{
GlobalLog.Warn($"[CaptureBeastTask] Throwing net at Bestiary monster: " + target.Name);
LokiPoe.Input.SimulateKeyEvent(LokiPoe.Input.Binding.throw_net, true, false, false);
await Wait.Sleep(20);
LokiPoe.Input.SimulateKeyEvent(LokiPoe.Input.Binding.throw_net, false, false, true);
return true;
}
That didn't work either. Anyone know how to get this working?
e: Also, when using the Task system, does returning true prevent the next tasks from being executed? It seems like the combat routine is running even when the Bestiary task returns true.