> For the complete documentation index, see [llms.txt](https://plugins.phbot.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plugins.phbot.org/phbot-api/packet-injection.md).

# Packet Injection

## inject\_joymax(opcode, data, encrypted)

Sends a packet to Joymax (the server).

## inject\_silkroad(opcode, data, encrypted)

Sends a packet to Silkroad (the game).

#### Example

`inject_joymax(0x704F, b'\x04', False)`

* `opcode`
  * unsigned short
* `data`
  * bytes
* `encrypted`
  * boolean

For complex packets you should use a packet building class. I have written one which can be found here: <https://github.com/ProjectHax/pySilkroadSecurity/blob/master/python/stream.py>
