Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
wolfxmc-money
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
wolfxmc-money
Commits
35094731
Commit
35094731
authored
Feb 18, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stub bot
parent
564408f1
Pipeline
#2443
passed with stages
in 2 minutes and 53 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
15 deletions
+34
-15
minecraft.ts
minecraft.ts
+27
-6
stack/china.sh
stack/china.sh
+2
-2
stack/docker-compose-china.yml
stack/docker-compose-china.yml
+1
-1
stack/docker-compose.yml
stack/docker-compose.yml
+1
-1
stack/run.sh
stack/run.sh
+3
-5
No files found.
minecraft.ts
View file @
35094731
import
{
Bot
,
BotOptions
,
ChatMessage
,
createBot
}
from
"
mineflayer
"
;
import
Bunyan
,
{
LogLevel
}
from
"
bunyan
"
;
import
{
delay
}
from
"
q
"
;
export
type
MessageQueueMap
=
Map
<
string
,
(
message
:
string
)
=>
void
>
;
...
...
@@ -33,12 +34,25 @@ export class Minecraft {
}
}
}
constructor
(
options
:
BotOptions
,
debugLevel
?:
LogLevel
)
{
this
.
log
=
Bunyan
.
createLogger
({
name
:
options
.
username
,
level
:
debugLevel
});
this
.
options
=
options
;
this
.
bot
=
createBot
(
options
);
this
.
messageWaitQueue
=
new
Map
();
this
.
messageRejectQueue
=
new
Map
();
private
async
stubBot
()
{
const
bot
=
createBot
(
this
.
options
);
await
new
Promise
<
void
>
((
resolve
)
=>
{
bot
.
once
(
"
spawn
"
,
()
=>
{
this
.
log
.
info
(
"
stub sapwn
"
);
bot
.
end
();
});
bot
.
once
(
"
end
"
,
()
=>
{
this
.
log
.
info
(
"
stub end
"
);
resolve
();
});
});
}
private
async
launchBot
()
{
//for (let i = 0; i < 3; ++i) {
await
this
.
stubBot
();
await
delay
(
3000
);
//}
this
.
bot
=
createBot
(
this
.
options
);
this
.
bot
.
once
(
"
spawn
"
,
()
=>
{
this
.
log
.
info
(
"
connected
"
);
if
(
this
.
spawnCallback
)
{
...
...
@@ -66,7 +80,14 @@ export class Minecraft {
this
.
resolveQueue
(
line
);
}
});
}
constructor
(
options
:
BotOptions
,
debugLevel
?:
LogLevel
)
{
this
.
log
=
Bunyan
.
createLogger
({
name
:
options
.
username
,
level
:
debugLevel
});
this
.
options
=
options
;
this
.
messageWaitQueue
=
new
Map
();
this
.
messageRejectQueue
=
new
Map
();
this
.
died
=
false
;
this
.
launchBot
();
}
waitForConnect
()
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
...
...
stack/china.sh
View file @
35094731
#!/bin/bash
# curl https://
water.mycard.moe:9000/nanahira
/wolfx/china.sh | sudo bash -
# curl https://
cdn01.moecube.com
/wolfx/china.sh | sudo bash -
apt-get update
apt-get
-y
install
docker.io python3-pip
/usr/bin/pip3
install
-U
pip
/usr/local/bin/pip
install
-U
docker-compose
echo
'nameserver 114.114.114.114'
>
/etc/resolv.conf
wget
-O
docker-compose.yml https://
water.mycard.moe:9000/nanahira
/wolfx/docker-compose-china.yml
wget
-O
docker-compose.yml https://
cdn01.moecube.com
/wolfx/docker-compose-china.yml
docker-compose up
stack/docker-compose-china.yml
View file @
35094731
...
...
@@ -4,4 +4,4 @@ services:
image
:
ccr.ccs.tencentyun.com/nanahira/wolfx:latest
scale
:
5
environment
:
USERNAME
:
Ayane
USERNAME
:
Momobako
stack/docker-compose.yml
View file @
35094731
...
...
@@ -4,4 +4,4 @@ services:
image
:
nanahira/wolfx-money
scale
:
5
environment
:
USERNAME
:
Ayane
USERNAME
:
Momobako
stack/run.sh
View file @
35094731
#!/bin/bash
# curl https://
water.mycard.moe:9000/nanahira
/wolfx/run.sh | sudo bash -
# curl https://
cdn01.moecube.com
/wolfx/run.sh | sudo bash -
apt-get update
apt-get
-y
install
docker.io python3-pip
/usr/bin/pip3
install
-U
pip
/usr/local/bin/pip
install
-U
docker-compose
wget
-O
docker-compose.yml https://water.mycard.moe:9000/nanahira/wolfx/docker-compose.yml
apt-get
-y
install
docker.io docker-compose
wget
-O
docker-compose.yml https://cdn01.moecube.com/wolfx/docker-compose.yml
docker-compose up
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment