-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHyperZShell.bat
More file actions
256 lines (218 loc) · 5.7 KB
/
Copy pathHyperZShell.bat
File metadata and controls
256 lines (218 loc) · 5.7 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
@echo off
title HyperZShell
setlocal ENABLEDELAYEDEXPANSION
rem Default mode is normal
set "devmode=0"
:main
cls
if !devmode! EQU 1 (
set /p "cmd=C:\HyperZShellDevMode> "
) else (
set /p "cmd=C:\HyperZShell> "
)
if /i "%cmd%"=="exit" exit /b
rem --- Built-in commands ---
rem Run game
if /i "%cmd%"=="game" goto game
rem Run bubbles screensaver
if /i "%cmd%"=="bubbles" (
start "" bubbles.scr /s
goto main
)
rem Network scan command
if /i "%cmd%"=="networkscan" (
arp -a
ipconfig /all
ping 8.8.8.8 -n 4
pause
goto main
)
rem Calculator command
if /i "%cmd%"=="calculator" (
:calc_loop
cls
echo --- HyperZShell Calculator ---
echo Type 'exit' to return to HyperZShell
set /p "expr=Enter expression: "
if /i "!expr!"=="exit" goto main
set "expr=!expr: =!"
for /f "delims=" %%r in ('powershell -Command "[math]::Round([double](^& { !expr! }), 10)"') do set "result=%%r"
echo Result: !result!
pause
goto calc_loop
)
rem Run app as admin
echo %cmd% | findstr /b /i "runasadmin " >nul
if not errorlevel 1 (
set "app=%cmd:~11%"
if not defined app (
echo Usage: runasadmin ^<application.exe^>
goto main
)
cmd /min /C "set __COMPAT_LAYER=runasinvoker && start "" "!app!""
goto main
)
rem Activate devmode
if /i "%cmd%"=="devmode" (
set "devmode=1"
goto main
)
rem Revert to normal mode
if /i "%cmd%"=="normalmode" (
set "devmode=0"
goto main
)
rem ================================
rem SKYNET COMMAND
rem ================================
if /i "%cmd%"=="skynet" (
cls
call :type "Terminator Message"
echo.
call :type "Dont be afraid."
call :type "I am a very kind virus."
call :type "You have do many works today."
call :type "So, I will let your computer slow down."
call :type "Have a nice day,"
call :type "Goodbye."
echo.
call :type "Press a key to continue..."
pause >nul
goto main
)
rem ================================
rem Unknown command fallback with pause
if !devmode! EQU 1 (
powershell -Command "%cmd%"
pause
) else (
cmd /c "%cmd%"
pause
)
goto main
rem ================================
rem GAME CODE
rem ================================
:game
cls
set "size=8"
set "px=0"
set "py=0"
set /a score=0
set /a hazardCount=0
set /a maxHazards=32
rem Initialize hazards
for /l %%i in (0,1,31) do (
set "hx%%i=-1"
set "hy%%i=-1"
)
rem First hazard
call :safe_random hx0 hy0 !size! !px! !py! 0
set /a hazardCount=1
rem First $ safely
call :spawn_dollar
:loop
cls
echo --- HyperZShell Game ---
echo Score: !score!
echo Hazards: !hazardCount! / !maxHazards!
echo.
rem Draw grid
for /l %%Y in (0,1,7) do (
set "row="
for /l %%X in (0,1,7) do (
set "char=."
if %%X==!px! if %%Y==!py! set "char=@"
if %%X==!dx! if %%Y==!dy! set "char=$"
set /a maxH=!hazardCount!-1
for /l %%H in (0,1,!maxH!) do (
if %%X==!hx%%H! if %%Y==!hy%%H! set "char=#"
)
set "row=!row!!char! "
)
echo !row!
)
echo.
echo Controls: W/A/S/D to move, P to pause/quit
echo.
rem --- Key input ---
choice /c wasdp /n >nul
set "key=!errorlevel!"
if "!key!"=="1" set /a py-=1
if "!key!"=="3" set /a py+=1
if "!key!"=="2" set /a px-=1
if "!key!"=="4" set /a px+=1
if "!key!"=="5" goto main
rem Keep player in bounds AFTER moving
if !px! LSS 0 set px=0
if !py! LSS 0 set py=0
set /a maxPos=!size!-1
if !px! GTR !maxPos! set px=!maxPos!
if !py! GTR !maxPos! set py=!maxPos!
rem --- Check collision with hazards FIRST ---
set /a maxH=!hazardCount!-1
for /l %%H in (0,1,!maxH!) do (
if !px!==!hx%%H! if !py!==!hy%%H! (
cls
echo ================================
echo GAME OVER
echo ================================
echo Final Score: !score!
echo.
pause
goto main
)
)
rem --- Check collision with $ ---
if !px!==!dx! if !py!==!dy! (
set /a score+=1
call :spawn_dollar
rem Add new hazard every 10 score, max 32
set /a targetHazards=!score!/10 + 1
if !targetHazards! GTR !maxHazards! set targetHazards=!maxHazards!
if !hazardCount! LSS !targetHazards! (
set /a idx=!hazardCount!
call :safe_random hx!idx! hy!idx! !size! !px! !py! !hazardCount! dx dy
set /a hazardCount+=1
)
)
rem Add a tiny delay for smoother rendering
rem timeout /t 0 >nul 2>&1
goto loop
:spawn_dollar
rem Generate $ safely (not under player or hazards)
:retryDollar
call :random_pos dx !size!
call :random_pos dy !size!
if !dx!==!px! if !dy!==!py! goto retryDollar
set /a maxH=!hazardCount!-1
for /l %%H in (0,1,!maxH!) do (
if !dx!==!hx%%H! if !dy!==!hy%%H! goto retryDollar
)
exit /b
:safe_random
rem %1=xvar %2=yvar %3=size %4=px %5=py %6=hazardCount [%7=dx %8=dy optional]
:retry
call :random_pos tempX %3
call :random_pos tempY %3
if !tempX!==%4 if !tempY!==%5 goto retry
set /a checkCount=%6-1
for /l %%j in (0,1,!checkCount!) do (
if !tempX!==!hx%%j! if !tempY!==!hy%%j! goto retry
)
if not "%7"=="" if not "%8"=="" (
if !tempX!==!%7! if !tempY!==!%8! goto retry
)
set "%1=!tempX!"
set "%2=!tempY!"
exit /b
:random_pos
set /a "%~1=!random! %% %~2"
exit /b
rem ============================================
rem TYPEWRITER TEXT FUNCTION (used by Skynet)
rem ============================================
:type
powershell -NoLogo -NoProfile -Command ^
"$t='%~1'; foreach($c in $t.ToCharArray()){Write-Host -NoNewline $c; Start-Sleep -Milliseconds 35}; Write-Host ''"
exit /b