-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmonster.ps1
42 lines (33 loc) · 1.04 KB
/
monster.ps1
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
param(
[Parameter(Mandatory = $true, HelpMessage = "host and port of server")]
[string]$url,
[Parameter(Mandatory = $true, HelpMessage = "your player name")]
[string]$name
)
$token = iwr "$url/join?userName=$name"
read-host -Prompt "Press enter once the game has started."
$size = 0
while ($true) {
$size = $size + 1
write-host "moving right $size"
for ($i = 0; $i -lt $size; $i++) {
iwr "$url/move/right?token=$token" | out-null
#start-sleep -Milliseconds 250
}
write-host "moving down $size"
for ($i = 0; $i -lt $size; $i++) {
iwr "$url/move/down?token=$token" | out-null
#start-sleep -Milliseconds 250
}
$size = $size + 1
write-host "moving left $size"
for ($i = 0; $i -lt $size; $i++) {
iwr "$url/move/left?token=$token" | out-null
#start-sleep -Milliseconds 250
}
write-host "moving up $size"
for ($i = 0; $i -lt $size; $i++) {
iwr "$url/move/up?token=$token" | out-null
#start-sleep -Milliseconds 250
}
}