This plugin can be used to select the first character that appears in the listing. This plugin will not function until 21.2.1 or 16.1.6.
from phBot import *
def character_listing(args):
for name in args:
if not name.startswith('*'):
log('Selecting %s' % name)
select_character(name)
break
return 0
log('[%s] Loaded' % __name__)
This plugin creates a character with a random name if no other characters exist on the account - otherwise it will auto select the first one in the listing.
Change âCHâ to âEUâ to create a European character. This will not function until 21.2.2 / 16.1.6.
from phBot import *
from struct import pack
import string
import random
CHARACTER_TYPE = 'CH'
create = False
request_listing = False
def create_character(name):
global CHARACTER_TYPE, request_listing
if CHARACTER_TYPE == 'CH':
c_model = get_monster_string('CHAR_CH_MAN_ADVENTURER')['model']
chest = get_item_string('ITEM_CH_M_HEAVY_01_BA_A_DEF')['model']
legs = get_item_string('ITEM_CH_M_HEAVY_01_LA_A_DEF')['model']
shoes = get_item_string('ITEM_CH_M_HEAVY_01_FA_A_DEF')['model']
weapon = get_item_string('ITEM_CH_SWORD_01_A_DEF')['model']
elif CHARACTER_TYPE == 'EU':
c_model = get_monster_string('CHAR_EU_MAN_NOBLE')['model']
chest = get_item_string('ITEM_EU_M_HEAVY_01_BA_A_DEF')['model']
legs = get_item_string('ITEM_EU_M_HEAVY_01_LA_A_DEF')['model']
shoes = get_item_string('ITEM_EU_M_HEAVY_01_FA_A_DEF')['model']
weapon = get_item_string('ITEM_EU_DAGGER_01_A_DEF')['model']
else:
log('Invalid character type (CH or EU)')
return
if c_model == 0 or chest == 0 or legs == 0 or shoes == 0 or weapon == 0:
log('Could not retrieve item models')
return
log('Creating character with name %s and type %s' % (name, CHARACTER_TYPE))
p = b'\x01'
p += pack('H', len(name))
p += name.encode('ascii')
p += pack('I', c_model)
p += pack('B', 0)
p += pack('I', chest)
p += pack('I', legs)
p += pack('I', shoes)
p += pack('I', weapon)
inject_joymax(0x7007, p, False)
request_listing = True
def character_listing(args):
global create
if len(args) == 0:
create = True
else:
for name in args:
if not name.startswith('*'):
log('Selecting %s' % name)
select_character(name)
break
return 0
def event_loop():
global create, request_listing
if create:
create = False
name = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(10))
create_character(name)
elif request_listing:
request_listing = False
inject_joymax(0x7007, b'\x02', False)
log('[%s] Loaded' % __name__)
Hi, Iâve never used plugin before, can you pls walk me through it?
like how to use or where to add and how to use in manager⌠etc? ^^
thanks in advance.
Possible. It is using like condition : âNot having any character at the accountâ
Replace this function only and this will create characters âif the account is not full of chars at deleting modeâ or thatâs what I think
def character_listing(args):
global create
if len(args) == 0:
create = True
else:
deleting = 0
for name in enumerate(args):
if not name.startswith('*'):
log('Selecting %s' % name)
select_character(name)
deleting = -1
break
else:
deleting += 1
if deleting != -1 and deleting < 4:
create = True
else:
log('Account full, all your chars are at deleting mode')
return 0
A better condition will be like âif the character to select is level > 39â but require more editing than thisâŚ
Ok thought I could help with something, but it seems that âinject_joymaxâ is set to GatewayServer until a character is selected and joined_game() is triggered.
Thatâs not accurate. If you are sending that the instant you get the character listing packet itâs possible the server is not allowing it. The bot sends whatever packet you inject no matter if you are in game or not.
Edit: I donât think youâre sending the name length in the delete character function.