-
Notifications
You must be signed in to change notification settings - Fork 0
Home
THIS WIKI IS NOT FINISHED AND MAY BE MISSING CRITICAL INFO
Here you will find info on what this program does and how it works.
import os
- Used for locating files within the program and (hopefully) a program reload feature (coming soon)
This is the main way of interacting with the program
- help - Displays help page
- status - Displays status of specified function/process
- exit/escape/stop - Exits the console and in most cases stops the program
- execute - Runs a specified function (Usage: execute OR execute [pid:])
The welcome screen is an essential part to helping the user get started with the program.
In this section we use colorama (import colorama as c
) which has been set to the variable 'c'.
A somewhat simple input() function here, the print statement which comes just before it (print(consoleSyntaxInput, end='')
) is used to display the 'bots@main:~$' prefix to the input. It has been done this way because colorama doesn't support colouring inside of inputs as of now.
This section finds all the brackets in the command and then adds spaces on either sides of them, this is done so that the split() function used just after it regards it as a space.
For example:
execute kahootbot() --> ["execute", "kahootbot", "(", ")"]
This list is then assigned to the variable 'command'.
The variable 'arguments' is assigned to the result of splitting 'console' into separate values with the separator being a comma.
arguments = tempConsole.split(",")
This section is basically a lot of if statements checking what the command is, then executing it.
Not much to be said here, apart from the filtering done for the execute command
All it does is it finds the arguments passed in kahootbot(arg1, arg2, arg3)
for example and sets it to a list named arguments.
This then proceeds to execute KahootBot() with the amount of variables given (maximum 3).
All this basically is, is it's just checking whether Console() was called with an argument or not e.g. Console("arg1") | passedCommand = True OR Console() | passedCommand = False
This class holds all the functions which make KahootBot do what it does
Assigns the variables 'pin', 'user' and 'quiz_name' to whatever was set when the function was initialised
**Unfinished**