Skip to content

Commit 955f33e

Browse files
committed
Add roger silly command
1 parent 13591bb commit 955f33e

File tree

6 files changed

+163
-3
lines changed

6 files changed

+163
-3
lines changed

hummingbot/client/command/silly_commands.py

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def be_silly(self, # type: HummingbotApplication
1818
if command == "hummingbot":
1919
safe_ensure_future(self.silly_hummingbot())
2020
return True
21+
elif command == "roger":
22+
safe_ensure_future(self.silly_roger())
23+
return True
2124
else:
2225
return False
2326

@@ -46,6 +49,38 @@ async def silly_hummingbot(self, # type: HummingbotApplication
4649
self.placeholder_mode = False
4750
self.app.hide_input = False
4851

52+
async def silly_roger(self, # type: HummingbotApplication
53+
):
54+
last_output = "\n".join(self.app.output_field.document.lines)
55+
self.placeholder_mode = True
56+
self.app.hide_input = True
57+
self.clear_output_field()
58+
for _ in range(0, 3):
59+
await self.cls_n_display(self.yield_alert("roger"))
60+
await asyncio.sleep(0.4)
61+
self.clear_output_field()
62+
roger_1 = open(f"{RESOURCES_PATH}roger_1.txt").readlines()
63+
roger_2 = open(f"{RESOURCES_PATH}roger_2.txt").readlines()
64+
roger_3 = open(f"{RESOURCES_PATH}roger_3.txt").readlines()
65+
roger_4 = open(f"{RESOURCES_PATH}roger_4.txt").readlines()
66+
for _ in range(0, 2):
67+
for _ in range(0, 3):
68+
await self.cls_n_display(roger_1, 0.1)
69+
await asyncio.sleep(0.3)
70+
await self.cls_n_display(roger_2, 0.35)
71+
await self.cls_n_display(roger_1, 0.25)
72+
await self.cls_n_display(roger_3, 0.35)
73+
await self.cls_n_display(roger_1, 0.25)
74+
await asyncio.sleep(0.4)
75+
for _ in range(0, 2):
76+
await self.cls_n_display(roger_4, 0.125)
77+
await self.cls_n_display(roger_1, 0.3)
78+
await self.cls_n_display(roger_4, 0.2)
79+
await asyncio.sleep(0.15)
80+
self.app.log(last_output)
81+
self.placeholder_mode = False
82+
self.app.hide_input = False
83+
4984
async def cls_n_display(self, lines, delay=0.5):
5085
await asyncio.sleep(delay)
5186
self.clear_output_field()
@@ -54,11 +89,18 @@ async def cls_n_display(self, lines, delay=0.5):
5489
def clear_output_field(self):
5590
self.app.log("\n" * 50)
5691

57-
def yield_alert(self):
58-
return """
92+
def yield_alert(self, custom_alert = None):
93+
alert = """
5994
====================================
6095
║ ║
6196
║ OPEN SOFTWARE FOR OPEN FINANCE ║
6297
║ ║
6398
====================================
64-
""" + ("\n" * 18)
99+
"""
100+
if custom_alert is not None:
101+
try:
102+
lines = open(f"{RESOURCES_PATH}{custom_alert}_alert.txt").readlines()
103+
alert = "".join(lines)
104+
except Exception:
105+
pass
106+
return f"{alert}" + ("\n" * 18)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
%%%
2+
%%%%%%%***********%%%%%%%
3+
%%%%** **%%%%
4+
%%%* *%%%
5+
%%%* *%%%
6+
%%(* ** .*********** %%%%%% *%%%
7+
%%%* .** *****************.%%%%%%%%%% *%%%
8+
%%* ***************** %%%%%%%%%%%%%% .*%%
9+
%%* *************** %%%%%%%%%%^ *%%
10+
%%* .**** ******* %%%%%%%%% ./%%
11+
%%* ** ****** %%%%%%%%%% *%%
12+
%#. ****** %%%%%%%%%%%%%%%%%%%%% ,%%
13+
%%* **^ %%%%%%%%%%%%%%%%%%%%%%%% *%
14+
%#. %%%%%%%%%%%%%%%%%%%%%%% ,%%
15+
%%* *%%%%%%% %%%%%%%%%%%% . *%%
16+
%%* *%%%%%%% %%%%%%%%%%%%%* .(%%
17+
%%* %%%%%%%%%%% %%%%%%%%%%%%% *%%
18+
%%* %%%%%%%%%% %.%%%%%%%%%%% .*%%
19+
%%%* %%%%%% % %%^ %%%%%%%%%% *%%,
20+
%%#* %%%% % *%%%
21+
%%%* % *%%%
22+
%%%* .*%%%
23+
%%%%** **%%%%
24+
(%%%%%%***********%%%%%%(
25+
26+
theholyroger.com
27+
28+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
%%%
2+
%%%%%%%***********%%%%%%%
3+
%%%%** **%%%%
4+
%%%* ** *%%%
5+
%%%* ** ****** *%%%
6+
%%(* ******************* *%%%
7+
%%%* ******************* %%%%% *%%%
8+
%%* *****************, %%%%%%%% .*%%
9+
%%* *** *********** *%%%%%%%%% *%%
10+
%%* ***********. ,%%%%%%%%%%% ./%%
11+
%%* .%%%%% %%%%%%%%%, *%%
12+
%#. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% . ,%%
13+
%%* %%%%%%%%%%%%%%%%%%%%%%%%%%% *%
14+
%#. %%%%%%%%%%%%%%%%%%%%%%% ,%%
15+
%%* %%%%%%%%%%% %%%%%%%%%% *%%
16+
%%* %%%%%%%%%%% %%%%%%%%%% .(%%
17+
%%* .%%/%%%%% % #%%%%%%%%%%% *%%
18+
%%* %%% %% %% %%%%%%%%%%%%%% .*%%
19+
%%%* %%% %%. %%%%%%%%%%% *%%,
20+
%%#* %%%%%%%%%%% *%%%
21+
%%%* * *%%%
22+
%%%* .*%%%
23+
%%%%** **%%%%
24+
(%%%%%%***********%%%%%%(
25+
26+
theholyroger.com
27+
28+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
%%%
2+
%%%%%%%***********%%%%%%%
3+
%%%%** **%%%%
4+
%%%* *%%%
5+
%%%* *%%%
6+
%%(* ***/%%%%%%%%%% % *%%%
7+
%%%* ,******* %%%%%%%%%%%% *%%%
8+
%%* ************ *%%%%%%%%%%%%% .*%%
9+
%%* **************** %%%%%%%%%% *%%
10+
%%* ******************* %%%%%%%%% ./%%
11+
%%* ******* ***** %%%%%%%%% *%%
12+
%#. ***** ***** %%%%%%%%%%%% % ,%%
13+
%%* ** **** %%%%%%%%%%%%%%%%%%%% (%% % *%
14+
%#. *** %%%%%%%%%%%%%%%%%%%%%%%%%%%% ,%%
15+
%%* ** %%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%( *%%
16+
%%* %%%%%%%%%%, /%%%%%%%%%%%%%%%% .(%%
17+
%%* %%%%%%%% %. %%%%%%%%% *%%
18+
%%* %%%%%%%%%% %% .*%%
19+
%%%* %%%%%%,%%# *%%,
20+
%%#* #%%% %%% *%%%
21+
%%%* %%%% *%%%
22+
%%%* .*%%%
23+
%%%%** **%%%%
24+
(%%%%%%***********%%%%%%(
25+
26+
theholyroger.com
27+
28+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
%%%
2+
%%%%%%%***********%%%%%%%
3+
%%%%** **%%%%
4+
%%%* *%%%
5+
%%%* *%%%
6+
%%(* *%%%
7+
%%%* *%%%
8+
%%* .*%%
9+
%%* *%%
10+
%%* ./%%
11+
%%* *%%
12+
%#. ,%%
13+
%%* *%
14+
%#. ,%%
15+
%%* *%%
16+
%%* .(%%
17+
%%* *%%
18+
%%* .*%%
19+
%%%* *%%,
20+
%%#* *%%%
21+
%%%* *%%%
22+
%%%* .*%%%
23+
%%%%** **%%%%
24+
(%%%%%%***********%%%%%%(
25+
26+
27+
28+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
=======================================
3+
║ ║
4+
║ SO YOU THINK YOU'RE A REAL ROGER? ║
5+
║ ║
6+
=======================================

0 commit comments

Comments
 (0)