Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
563 changes: 41 additions & 522 deletions core/Characters/__init__.py

Large diffs are not rendered by default.

Binary file modified core/Characters/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
6 changes: 5 additions & 1 deletion core/Errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ def __str__(self):
if self.b:
return "[ERR] Object w/ id: "+repr(self.b.id)+" is too far."
else:
return "[ERR] "+repr(self.pos)+" is too far."
return "[ERR] "+repr(self.pos)+" is too far."

class DeprecationError(DeprecationWarning, Exception):
def __str__(self):
return 'porco d10 fermete'
Binary file modified core/Errors/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions core/Utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from core.Utils.map import map_parser
Binary file added core/Utils/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added core/Utils/__pycache__/colors.cpython-38.pyc
Binary file not shown.
Binary file added core/Utils/__pycache__/map.cpython-38.pyc
Binary file not shown.
20 changes: 20 additions & 0 deletions core/Utils/colors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
YELLOW = '\033[1;33;40m'
class background:
RED='\033[0;37;41m'
GREEN='\033[0;37;42m'
YELLOW='\033[0;37;43m'
BLUE='\033[0;37;44m'
MAGENTA='\033[0;37;45m'
CYAN='\033[0;37;46m'
WHITE='\033[0;37;47m'
BLACK='\033[0;37;48m'
57 changes: 57 additions & 0 deletions core/Utils/map.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from core.Utils.colors import bcolors as css
import core.Errors as errs
import json

def map_parser(cmd, params):
# TODO add funcs to this parser
if '-h' in params:
raise NotImplementedError

# HELP
if cmd=='help':
if not len(params):
print(css.HEADER+'[*]'+css.ENDC+' List of commands:')
[print(command) for command in json.loads(open('core/commands.json').read())['commands']]
else:
raise NotImplementedError

# SHOW
elif cmd=='show':
raise errs.DeprecationError()
overrideshow=False
if '-a' in params:
overrideshow=True
if 'id' in params or '-id' in params:
showids=True
showpos=False
elif 'pos' in params or '-pos' in params:
showids=False
showpos=True
elif 'null' in params or '-null' in params:
showids=False
showpos=False
else:
raise errs.ParamError(params)
return ['showupdate', showids, showpos, overrideshow]

# SELECT
elif cmd=='select':
pass # now mouse click

# MOVE
elif cmd=='move':
pass # now mouse drag

# EXIT && BYE
elif cmd in ['bye', 'exit']:
pass # now ESC key

# SHOP
elif cmd=='shop':
raise NotImplementedError()

# RECO
elif cmd in ['reco', 'recognitors']:
raise NotImplementedError

return [None]
17 changes: 13 additions & 4 deletions core/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
"reset",
"shop",
"reco",
"recognitors"
"recognitors",
"smtp", "email"
],
"cheatsheet": {
"select": {
"params": [
"-m",
"--method"
"-id",
"-pos"
],
"output": "seleziona un oggetto usando un metodo specifico",
"notes": "puoi selezionare per id o pos, id->botID, pos->x,y"
"notes": "puoi fra id, pos o null, scrittura: select -id ID oppure select -pos X,Y"
},
"show": {
"params": [
Expand Down Expand Up @@ -73,6 +74,14 @@
"params": [],
"output": "entra nella base della reco squad",
"notes": "scrivendo ad esempio 'reco call alex' reco resituir\u00c3\u00a0 l'output di call alex uscendo immediatamente dalla reco base"
},
"smtp":{
"params":[],
"output":"open the mailbox"
},
"email":{
"params":[],
"output":"open the mailbox"
}
}
}
Loading