mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-25 03:35:29 +01:00
commit
ed8356c185
7
start.py
7
start.py
@ -1,6 +1,7 @@
|
|||||||
import getpass
|
import getpass
|
||||||
import sys
|
import sys
|
||||||
import Utils
|
import Utils
|
||||||
|
import time
|
||||||
from pluginloader import PluginLoader
|
from pluginloader import PluginLoader
|
||||||
from networking import PacketSenderManager, NetworkManager
|
from networking import PacketSenderManager, NetworkManager
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
@ -34,6 +35,10 @@ if __name__ == "__main__":
|
|||||||
parser.add_option("-f", "--fun-bot-names", dest="funBotNames",
|
parser.add_option("-f", "--fun-bot-names", dest="funBotNames",
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
help="use more fun bot names")
|
help="use more fun bot names")
|
||||||
|
|
||||||
|
parser.add_option("-t", "--throttle", dest="throttle",
|
||||||
|
action="store_true", default=False,
|
||||||
|
help="throttle bot connections to join 1 per second")
|
||||||
|
|
||||||
# pluginLoader
|
# pluginLoader
|
||||||
pluginLoader = PluginLoader("plugins")
|
pluginLoader = PluginLoader("plugins")
|
||||||
@ -77,6 +82,8 @@ if __name__ == "__main__":
|
|||||||
print "Connecting with " + str(options.bots) + " bots"
|
print "Connecting with " + str(options.bots) + " bots"
|
||||||
connections = []
|
connections = []
|
||||||
for i in range(options.bots):
|
for i in range(options.bots):
|
||||||
|
if options.throttle:
|
||||||
|
time.sleep(1)
|
||||||
if options.funBotNames and i < len(names):
|
if options.funBotNames and i < len(names):
|
||||||
name = names[i]
|
name = names[i]
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user