Injecting Attack Skills

Hi,
I am currently trying to make my bot attacking thiefs, but it seems to me, that it is not possible to inject any skill related packets. I would assume that the following code activates the imbue, but it just does not do it. Does phbot block skill related injections?

def castImbue():
    packet = b'\x01\x04\x47\x0D\x00\x00\x00'
    inject_joymax(0x7074,packet,False)

Currently once I have a thief spawn while trading I am just stopping the bot, setting the training area to my current position and then starting the bot again to kill the thiefs. But unfortunately “start bot” actually takes quite a while (up to 15 secs) until it starts attacking monsters in the training area. So now my idea was to try implementing the attacking feature on my own. But somehow I am not able to cast any skills at all.

Cheers

Even though if you might be able to cast a spell with no target (like imbue), you won’t be able to attack thieves, because to cast spells with targets the packet must contain the target unique id.

I was just testing with the imbue and buffs, since it seemed to me to be the easiest way to start.
I was assuming that the unique ID provided from the get_monsters method equals the unique ID which is used to cast skills on monsters.

You can’t do that with the bot.

ok, thanks :slight_smile:
Is there a way you could decrease the time the bot needs to start attacking after pressing “Start Bot”/Executing start_bot() method in a new training area?

Not really. It’s usually going to buff first then it will attack.

1 Like

It seems odd to me, that most of the time it takes quite long (up to 8-15 seconds) until the bot starts attacking and sometimes not (within 5 seconds). Two examples below.
Do you have any idea what could cause the bot taking so much time? I don´t have any buffs set in my buffs settings.

Update:
Guess I found the reason. Is it possible that “Enable collusion detection in the training area” requires some time?

Reacts slow after starting the bot.
[20:02:56] Script: Walking to 4472, 853
[20:02:58] Bot stopped. Botting time [1 minute]
[20:02:58] Setting training position to region:24734 X: 4472.0 Y: 853.0
[20:02:59] Bot started
[20:02:59] Plugin: Starting to kill 5 thiefs at this area.
[20:03:01] Plugin: Killing 5 thiefs at this area.
[20:03:03] Plugin: Killing 5 thiefs at this area.
[20:03:05] Plugin: Killing 5 thiefs at this area.
[20:03:07] Plugin: Killing 5 thiefs at this area.
[20:03:09] Plugin: Killing 5 thiefs at this area.
[20:03:11] Plugin: Killing 5 thiefs at this area.
[20:03:12] Gained 0 experience and 459 SP experience

Reacts fast after starting the bot.
[19:47:34] Script: Walking to 5579, 643
[19:47:35] Bot stopped. Botting time [1 minute]
[19:47:35] Setting training position to region:24484 X: 5579.0 Y: 643.0
[19:47:36] Bot started
[19:47:36] Plugin: Starting to kill 6 thiefs at this area.
[19:47:38] Plugin: Killing 6 thiefs at this area.
[19:47:39] Gained 0 experience and 490 SP experience
[19:47:40] Plugin: Killing 5 thiefs at this area.