Comments (5)
I added a method to access old chat messages.
Have a look at the example. Is this what you wanted?
There is also an example that stops when a given command was written (stopOnChatMessage).
from minebot.
Yes, this will work very well. And do you have any extra documentation in scripting you can link me to? I'm new to Java and this is what's introducing me to the language. I just need a list of functions Minebot uses and possibly some example of them in a script.
from minebot.
https://gyazo.com/9db76d4bf2192a23ca3e4a6f71c58f4b.png I get this error with this code copied off the documentation
minescript.doStrategy(minescript.stack(
stopOnChatMessage(),
minescript.strategy("minebot", "mine", "dirt")));
function stopOnChatMessage() {
// This should work with the essentials /msg command
// This matches messages sent from myUserName containing stop.
// You can replace \u00a7 with ยง but make sure to change the encoding to UTF-8 in
// your text editor (should only be a problem for windows users)
var re = /^\u00a76[\u00a7c(myUserName)\u00a76 -> \u00a7c(me)\u00a76] \u00a7r.stop.$/;
// Alternatives to this regexp:
// Match server shutting down:
// /^\u00a76.*shut.*down/
// ^ Replace this with the color code your server uses.
// Stop as soon as that person is mentioned (join message, ...)
// /supUserName/
// Stop as soon as the word test is in the message:
// /\btest\b/
// we ignore old messages
var messageCount = minescript.getChatMessages().length;
// we should not just return false once, so we need to store the status.
var stopReceived = false;
return generateStopStrategy(function(h) {
var messages = minescript.getChatMessages();
// this goes through all new messages
for (; messageCount < messages.length; messageCount++) {
stopReceived |= re.test(messages[messageCount].textFormatted + "");
}
return stopReceived;
}, false, "Stop when moving down.");
}
from minebot.
You also need to copy the generateStopStrategy function a few lines above that example.
from minebot.
Oh yeah I see, thanks a lot! :)
from minebot.
Related Issues (20)
- Refuses to use a shovel HOT 1
- Need help on configuring /minebot clear command HOT 1
- Specific version of Forge 1.15.2? Does not show up in mod list HOT 2
- some commands are not aviable
- What do I need to change to add sign reading feature for /minebot store 1.12.2 HOT 3
- Lumberjack broken
- Strategies involving block mining crash the game - 1.12.2 HOT 1
- Farmbot suggestion HOT 1
- Cant create a settings file in 1.15.2 HOT 1
- Plant feature doesn't work when crops are on Y=1 HOT 1
- Getting "Command is not a strategy" while trying to input /minebot stop after 300
- I cannot break ice (Prison) HOT 5
- Forge not detecting .jar HOT 3
- Missing License Information
- 1.17? HOT 2
- 1.8.9 mod says that it will only work on 1.8
- 1.18.2???
- Command Clear on 1.7.10
- minebot mine <block_name> does not work
- LegitMine setting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minebot.