I haven't actually tested it as of posting it, but here's a little launcher I just wrote mainly as a sample for anyone who'd like one. It's a tad programmer-slanted (config is an associative array), but should be fairly simple to figure out. Just a note about the config, mon_control and item_control take a path name (like control/mon_control_new.txt), and rname is the name you appended to the config file (ex: for control/config-Link.txt, which is my config for Link To The Past, the rname is "Link"). Also, None is a keyword, NOT A STRING. If you quote it, things will break. The acct setting is trivial, it just helps you differentiate between characters on different accounts. Notice I just use "main" and "alt" for mine.
Code: Select all
import os
CONFIG = {
'Flipkick':{
'rname':None,
'acct':'main',
'mon_control':None,
'items_control':None
},
'Malevolyn':{
'rname':None,
'acct':'main',
'mon_control':None,
'items_control':None
},
'Link To The Past':{
'rname':'Link',
'acct':'alt',
'mon_control':None,
'items_control':None
},
'Dash':{
'rname':None,
'acct':'alt',
'mon_control':'control/mon_control-Dash.txt',
'items_control':None
},
'Tike Myson':{
'rname':'Tike',
'acct':'main',
'mon_control':'control/mon_control-Dash.txt',
'items_control':None
}
}
CHAR_LIST = CONFIG.keys()
CHAR_LIST.sort()
print '---- Characters ----'
at = 0
for k in CHAR_LIST:
if 'acct' in CONFIG[k]: acct = ' (Account: %s)' % CONFIG[k]['acct']
else: acct = ''
print '%s: %s%s' % (at,k,acct)
at += 1
print
while 1:
c = raw_input('Choose: ')
try:
c = int(c)
break
except:
print 'Please enter a NUMBER. Try again.'
continue
print '\nStarting bot for %s...\n' % CHAR_LIST[c]
n = CHAR_LIST[c]
if 'rname' in CONFIG[n] and CONFIG[n]['rname']: rn = CONFIG[n]['rname']
else: rn = n
if os.name == 'nt':
execStr = 'perl openkore.pl --config=control/config-' + rn + '.txt'
else:
execStr = 'perl ./openkore.pl --config=control/config-' + rn + '.txt'
if 'mon_control' in CONFIG[n] and CONFIG[n]['mon_control']:
execStr += ' --mon_control=' + CONFIG[n]['mon_control']
if 'items_control' in CONFIG[n] and CONFIG[n]['items_control']:
execStr += ' --items_control=' + CONFIG[n]['items_control']
if 'sys' in CONFIG[n] and CONFIG[n]['sys'] :
execStr += ' --sys=' + CONFIG[n]['sys']
if 'pickupitems' in CONFIG[n] and CONFIG[n]['pickupitems']:
execStr += ' --pickupitems=' + CONFIG[n]['pickupitems']
while 1:
os.system(execStr)
print '\n'
New INI-based version - Use this one if you don't mind having two files (instead of just one) or aren't comfortable editing code.
Code: Select all
import os, ConfigParser
ini = ConfigParser.SafeConfigParser()
ini.read('Launcher.ini')
CHAR_LIST = ini.sections()
CHAR_LIST.sort()
print '---- Characters ----'
at = 0
for k in CHAR_LIST:
if ini.has_option(k, 'acct'): acct = ' (Account: %s)' % ini.get(k, 'acct')
else: acct = ''
print '%s: %s%s' % (at,k,acct)
at += 1
print
while 1:
c = raw_input('Choose: ')
try:
c = int(c)
break
except:
print 'Please enter a NUMBER. Try again.'
continue
print '\nStarting bot for %s...\n' % CHAR_LIST[c]
n = CHAR_LIST[c]
if ini.has_option(n, 'rname'): rn = ini.get(n, 'rname')
else: rn = n
if os.name == 'nt':
execStr = 'perl openkore.pl --config=control/config-' + rn + '.txt'
else:
execStr = 'perl ./openkore.pl --config=control/config-' + rn + '.txt'
if ini.has_option(n, 'mon_control'):
execStr += ' --mon_control=' + ini.get(n, 'mon_control')
if ini.has_option(n, 'items_control'):
execStr += ' --items_control=' + ini.get(n, 'items_control')
if ini.has_option(n, 'sys'):
execStr += ' --sys=' + ini.get(n, 'sys')
if ini.has_option(n, 'pickupitems'):
execStr += ' --pickupitems=' + ini.get(n, 'pickupitems')
while 1:
os.system(execStr)
print '\n'
Code: Select all
[Flipkick]
acct=main
[Malevolyn]
acct=main
[Link To The Past]
BASE: control/Link
rname: Link
acct: alt
items_control: %(BASE)s/item_control-Link.txt
[Dash]
acct=alt
mon_control=control/mon_control-Dash.txt
[Tike Myson]
rname=Tike
mon_control=control/mon_control-Dash.txt
Code: Select all
---- Characters ----
0: Dash (Account: alt)
1: Flipkick (Account: main)
2: Link To The Past (Account: alt)
3: Malevolyn (Account: main)
Choose: 1
Starting bot for Flipkick...
*** OpenKore what-will-become-2.0.7 (SVN Version) - Custom Ragnarok Online client ***
*** http://www.openkore.com/ ***
Loading all plugins...
Loading plugin plugins/critCount.pl...
Loading plugin plugins/koreSnarl.pl...
...