Example Plugins

Plugins must be saved inside the Plugins folder otherwise they will not be loaded.

Packet Processing Plugin

This simple plugin will display all packets going to/from Silkroad/Joymax.

from phBot import *

# Called when the bot successfully connects to the game server
def connected():
    pass

# All packets received from Silkroad will be passed to this function
# Returning True will keep the packet and False will not forward it to the game server
def handle_silkroad(opcode, data):
    log('Python: (Silkroad) 0x%02X' % opcode)
    return True

# All packets received from Joymax will be passed to this function
# Returning True will keep the packet and False will not forward it to the client
def handle_joymax(opcode, data):
    log('Python: (Joymax) 0x%02X' % opcode)
    return True

# Called when the character enters the game world
def joined_game():
    pass

# Called when the character teleports
# This function will also be called after the "joined_game" function
def teleported():
    pass

log('[%s] Loaded' % __name__)

GUI Plugin

This next plugin creates a basic GUI on the Plugins tab inside the bot.

Socket Plugin

Sockets are now supported as of v2.0.0arrow-up-right. Some "pyd" files were missing (aka DLLs) which caused it to not work previously.

Last updated