'online_mode': False
    },
}

# Configure plugins
plugins = default_plugins

plugins.append(('Messenger', MessengerPlugin))
plugins.append(('MineAndPlace', MineAndPlacePlugin))
plugins.append(('NewMovement', NewMovementPlugin))
#plugins.append(('NewPhysics', NewPhysicsPlugin))
plugins.append(('SendMapData', SendMapDataPlugin))
plugins.append(('SendEntityData', SendEntityDataPlugin))
plugins.append(('SpockControl', SpockControlPlugin))
plugins.append(('NewInventory', InventoryPlugin))

# Chose minecraft server
hostname = "localhost"
try:
    # If the environment variable is set use it as the hostname
    hostname = os.environ["MC_SERVER_NAME"]
except KeyError:
    pass

print("Connecting to {} server on port 25565".format(hostname))

# Create and start client
# client.start() with no arguments will automatically connect to localhost
client = Client(plugins=plugins, settings=settings)
client.start(hostname, 25565)
示例#2
0
文件: start.py 项目: ryanpeach/Bat
from spockbot.plugins import default_plugins
from bat import bat, blockfinder, command, \
    inventorycmd, interactcmd, movecmd, pycmd, survival

plugins = default_plugins.copy()
plugins.extend([
    ('bat', bat.BatPlugin),
    ('commands', command.CommandPlugin),
    ('blockfinder', blockfinder.BlockFinderPlugin),
    ('pycmd', pycmd.PyCmdPlugin),
    ('interactcmd', interactcmd.InteractCommandsPlugin),
    ('inventorycmd', inventorycmd.InventoryCommandsPlugin),
    ('movecmd', movecmd.MovementCommandsPlugin),
    ('survival', survival.SurvivalPlugin),
    ('curses', cursingspock.CursesPlugin),
])

# login_credentials should contain a dict with 'username' and 'password'
#from login_credentials import settings
settings = {
    'start': {
        'username': '******'
    },
    'auth': {
        'online_mode': False
    },
}
client = Client(plugins=plugins, settings=settings)

client.start('localhost', 25565)
from spockextras.plugins.helpers.NewMovement import NewMovementPlugin
from spockextras.plugins.helpers.NewPhysics import NewPhysicsPlugin
from spockextras.plugins.helpers.SpockControl import SpockControlPlugin

from spockextras.plugins.helpers.Messenger import MessengerPlugin
from spockextras.plugins.helpers.SendMapData import SendMapDataPlugin
from spockextras.plugins.helpers.SendEntityData import SendEntityDataPlugin



# connect to localhost server
settings = {'start': {'username': '******',},'auth': {'authenticated': False,},}
plugins = default_plugins

plugins.append(('Messenger', MessengerPlugin))
plugins.append(('SendMapData', SendMapDataPlugin))
plugins.append(('SendEntityData', SendEntityDataPlugin))


plugins.append(('MineAndPlace', MineAndPlacePlugin))
plugins.append(('NewMovement', NewMovementPlugin))
#plugins.append(('NewPhysics', NewPhysicsPlugin))
plugins.append(('SpockControl', SpockControlPlugin))
client = Client(plugins = plugins, settings = settings)

print("connecting to localhost on port 25565")

#client.start() with no arguments will automatically connect to localhost
client.start('localhost', 25565)

示例#4
0
# Import the plugins you have created
from example_plugin import ExamplePlugin

from spockbot import Client
from spockbot.plugins import default_plugins

# Change default log level to DEBUG so we can see extra messages
logger = logging.getLogger('spockbot')
logger.setLevel(logging.DEBUG)

# Set the following values:
USERNAME = '******'
PASSWORD = ''
SERVER = 'localhost'

# Enter your credentials and the server information
settings = {'start': {'username': USERNAME}, 'auth': {'authenticated': False}}

# Load the plugins. Any functionality that you want to implement must be called
# from a plugin. You can define new plugins that listen for arbitrary events
# from the game. Furthermore, events can even be periodic timers that trigger a
# method.
plugins = default_plugins
plugins.append(('example', ExamplePlugin))

# Instantiate and start the client, which will then run and wait for events to
# occur
client = Client(plugins=plugins, settings=settings)
client.start(SERVER, 25565)
示例#5
0
from spockbot.plugins import default_plugins

# Change default log level to DEBUG so we can see extra messages
logger = logging.getLogger('spockbot')
logger.setLevel(logging.DEBUG)

# Set the following values:
USERNAME = ''
PASSWORD = ''
SERVER = 'localhost'

# Enter your credentials and the server information
settings = {
    'start': {
        'username': USERNAME,
        'password': PASSWORD,
    },
}

# Load the plugins.
# Any functionality that you want to implement must be called from a plugin.
# You can define new plugins that listen for arbitrary events from the game.
# Furthermore, events can even be periodic timers that trigger a method.
plugins = default_plugins
plugins.append(('example', ExamplePlugin))

# Instantiate and start the client, which will then
# run and wait for events to occur.
client = Client(plugins=plugins, settings=settings)
client.start(SERVER, 25565)
示例#6
0
import logging

from config import plugins, settings
from spockbot import Client

logger = logging.getLogger('spockbot')
logger.setLevel(logging.DEBUG)

if __name__ == '__main__':
    client = Client(plugins=plugins, settings=settings)
    client.start()
# Configure plugins
plugins = default_plugins

plugins.append(('Messenger', MessengerPlugin))
plugins.append(('MineAndPlace', MineAndPlacePlugin))
plugins.append(('NewMovement', NewMovementPlugin))
#plugins.append(('NewPhysics', NewPhysicsPlugin))
plugins.append(('SendMapData', SendMapDataPlugin))
plugins.append(('SendEntityData', SendEntityDataPlugin))
plugins.append(('SpockControl', SpockControlPlugin))
plugins.append(('NewInventory', InventoryPlugin))



# Chose minecraft server
hostname = "localhost"
try:
    # If the environment variable is set use it as the hostname
    hostname = os.environ["MC_SERVER_NAME"]
except KeyError:
    pass

print("Connecting to {} server on port 25565".format(hostname))

# Create and start client
# client.start() with no arguments will automatically connect to localhost
client = Client(plugins=plugins, settings=settings)
client.start(hostname, 25565)

示例#8
0
#!/usr/bin/env python3

from spockbot import Client
from spockbot.plugins import default_plugins

from piuda.piuda_plugin import PiudaPlugin

plugins = default_plugins + [('piuda', PiudaPlugin)]

client = Client(plugins=plugins, settings={
    'start': {
        'username': '******'
    },
    'auth': {
        'authenticated': False
    }
})

client.start('wurstmineberg.de', 25563)