pyrobloxbot package

Submodules

pyrobloxbot.exceptions module

exception pyrobloxbot.exceptions.InvalidSlotNumberException

Bases: Exception

Raised by equip_slot when slot isn’t between 0 and 9

exception pyrobloxbot.exceptions.InvalidWalkDirectionException

Bases: Exception

Raised by walk when given a direction that isn’t in literals.WALK_DIRECTIONS.VALUES

exception pyrobloxbot.exceptions.NoRobloxWindowException

Bases: Exception

Raised when a function can’t find a roblox window to focus

pyrobloxbot.literals module

class pyrobloxbot.literals.KEYBOARD_KEYS

Bases: object

Valid strings to pass to keyboard_action and hold_keyboard_action

VALUES

alias of Literal[’t’, ‘n’, ‘r’, ‘ ‘, ‘!’, ‘”’, ‘#’, ‘$’, ‘%’, ‘&’, “’”, ‘(’, ‘)’, ‘*’, ‘+’, ‘,’, ‘-’, ‘.’, ‘/’, ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘:’, ‘;’, ‘<’, ‘=’, ‘>’, ‘?’, ‘@’, ‘[’, ‘\’, ‘]’, ‘^’, ‘_’, ‘`’, ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘{’, ‘|’, ‘}’, ‘~’, ‘accept’, ‘add’, ‘alt’, ‘altleft’, ‘altright’, ‘apps’, ‘backspace’, ‘browserback’, ‘browserfavorites’, ‘browserforward’, ‘browserhome’, ‘browserrefresh’, ‘browsersearch’, ‘browserstop’, ‘capslock’, ‘clear’, ‘convert’, ‘ctrl’, ‘ctrlleft’, ‘ctrlright’, ‘decimal’, ‘del’, ‘delete’, ‘divide’, ‘down’, ‘end’, ‘enter’, ‘esc’, ‘escape’, ‘execute’, ‘f1’, ‘f10’, ‘f11’, ‘f12’, ‘f13’, ‘f14’, ‘f15’, ‘f16’, ‘f17’, ‘f18’, ‘f19’, ‘f2’, ‘f20’, ‘f21’, ‘f22’, ‘f23’, ‘f24’, ‘f3’, ‘f4’, ‘f5’, ‘f6’, ‘f7’, ‘f8’, ‘f9’, ‘final’, ‘fn’, ‘hanguel’, ‘hangul’, ‘hanja’, ‘help’, ‘home’, ‘insert’, ‘junja’, ‘kana’, ‘kanji’, ‘launchapp1’, ‘launchapp2’, ‘launchmail’, ‘launchmediaselect’, ‘left’, ‘modechange’, ‘multiply’, ‘nexttrack’, ‘nonconvert’, ‘num0’, ‘num1’, ‘num2’, ‘num3’, ‘num4’, ‘num5’, ‘num6’, ‘num7’, ‘num8’, ‘num9’, ‘numlock’, ‘pagedown’, ‘pageup’, ‘pause’, ‘pgdn’, ‘pgup’, ‘playpause’, ‘prevtrack’, ‘print’, ‘printscreen’, ‘prntscrn’, ‘prtsc’, ‘prtscr’, ‘return’, ‘right’, ‘scrolllock’, ‘select’, ‘separator’, ‘shift’, ‘shiftleft’, ‘shiftright’, ‘sleep’, ‘space’, ‘stop’, ‘subtract’, ‘tab’, ‘up’, ‘volumedown’, ‘volumemute’, ‘volumeup’, ‘win’, ‘winleft’, ‘winright’, ‘yen’, ‘command’, ‘option’, ‘optionleft’, ‘optionright’]

class pyrobloxbot.literals.WALK_DIRECTIONS

Bases: object

Valid strings to pass to walk

VALUES

alias of Literal[‘f’, ‘fw’, ‘forward’, ‘forwards’, ‘l’, ‘left’, ‘r’, ‘right’, ‘b’, ‘back’, ‘backward’, ‘backwards’]

Module contents

pyrobloxbot.chat(message: str)

Sends a message in chat

Parameters:

message (str) – The message to send

pyrobloxbot.equip_slot(slot: int)

Equip a given item slot

Parameters:

slot (int) – The item slot to equip

Raises:

InvalidSlotNumberException – Raised when slot isn’t between 0 and 9

pyrobloxbot.hold_keyboard_action(*actions: KEYBOARD_KEYS.VALUES, duration: float)

Holds one or more keyboard keys for a given time. If more than one key is provided, all keys will be held and released simultaneously

Parameters:
  • actions (KEYBOARD_KEYS) – The keys to be held

  • duration (float) – How long to hold for, in seconds

pyrobloxbot.jump(number_of_jumps: int = 1, delay: float = 0)

Jumps for a given number of times

Parameters:
  • number_of_jumps (int) – How many times to jump, defaults to 1

  • delay (float) – How much time between jumps, in seconds, defaults to 0

pyrobloxbot.jump_continuous(duration: float)

Holds jump for a given time

Parameters:

duration (float) – How long to hold jump for, in seconds

pyrobloxbot.keyboard_action(*actions: KEYBOARD_KEYS.VALUES)

Presses one or more keyboard keys

Parameters:

actions (KEYBOARD_KEYS) – The keys to be pressed

pyrobloxbot.leave_game(interval: float = 0.5)

Leaves the current game

Parameters:

interval (float) – How long between each keyboard input, in seconds, defaults to 0.5

pyrobloxbot.require_focus(fn)

A decorator that ensures the roblox window is in focus before running the decorated function. This is used by all pyrobloxbot functions

Raises:

NoRobloxWindowException – Raised when can’t find a roblox window to focus

pyrobloxbot.reset_player(interval: float = 0.5)

Resets player character

Parameters:

interval (float) – How long between each keyboard input, in seconds, defaults to 0.5

pyrobloxbot.toggle_shift_lock()

Toggles shift lock (Shift lock switch must be enabled in roblox settings)

pyrobloxbot.toggle_ui_navigation()

Toggles ui navigation mode. This is called by all ui navigation functions if ui navigation mode is disabled

pyrobloxbot.ui_click()

Click on currently selected ui element

pyrobloxbot.ui_navigate_down()

Navigate down in ui elements

pyrobloxbot.ui_navigate_left()

Navigate left in ui elements

pyrobloxbot.ui_navigate_right()

Navigate right in ui elements

pyrobloxbot.ui_navigate_up()

Navigate up in ui elements

pyrobloxbot.walk(direction: WALK_DIRECTIONS.VALUES, duration: float)

Walks in a direction for a given time

Parameters:
  • direction (WALK_DIRECTIONS) – The direction to walk in

  • duration (float) – How long to walk for, in seconds

Raises:

InvalidWalkDirectionException – Raised when given direction isn’t in literals.WALK_DIRECTIONS.VALUES

pyrobloxbot.walk_back(duration: float)

Walks back for a given time

Parameters:

duration (float) – How long to walk for, in seconds

pyrobloxbot.walk_forward(duration: float)

Walks forward for a given time

Parameters:

duration (float) – How long to walk for, in seconds

pyrobloxbot.walk_left(duration: float)

Walks left for a given time

Parameters:

duration (float) – How long to walk for, in seconds

pyrobloxbot.walk_right(duration: float)

Walks right for a given time

Parameters:

duration (float) – How long to walk for, in seconds