The Message Bot


#1

What is this?

The Message Bot is a program which lets you set up your server so that it automatically responds to events. You can configure it to automatically welcome players to your server, respond to common questions, and make announcements.

How do I get it on my server?

First, you need to “install” it. Once you have installed it and launched it, you can use the buttons at the top of the page to add “messages”. Each button creates a different type of message. After clicking on a button, look for the box added to the page and fill in what you what to say. By default, all messages but trigger messages will be sent for everyone.

How do I install the bot?

Important: Once the bot is launched, that page MUST stay open in your browser for the bot to work. Additionally, if you are running the bot on iOS or Android, the browser must be open (for most devices) for the bot to function.

Video Tutorials:

Text Tutorial

  • Bookmark this page
  • Copy this code:
javascript:(function(){if (typeof MessageBot == "undefined"){var s=document.createElement('script'); s.src='http://blockheadsfans.com/messagebot/bot/load'; s.crossOrigin='anonymous'; document.head.appendChild(s);}}())
  • Edit the bookmark, look for the URL of this page and change it to the code you copied. Be sure to remove all the previous text!
  • Install complete!

How do I start the bot?

  • Go to http://portal.theblockheads.net
  • Choose the world you want to run the bot on
  • Make sure the world is started and navigate to the “console” page
  • Click the bookmark (while still on the same page)
  • Configure as you wish. Your messages will automatically be saved.

Is there anything else important I need to know?

Unfortunately, yes, there is. Because of the limitations of the blockheads portal API, names which contain non-standard (e.g. not printed on a US computer keyboard) characters, may return incorrect values when you use {{name}}. Because of this, I must advise that you avoid the use of {{name}} when using commands.

Troubleshooting **On iOS, the bot doesn't work in private browsing** This is caused by Apple, nothing I can do about it really.

Nothing happens when I click the bookmark!
You most likely forgot to remove the original page from the bookmark. Look at the bookmark, does the url start with http? If so, follow the installation instructions again. Though I do my best to keep loading times fast, it is possible that the bot hasn’t loaded completely yet. Try clicking the bookmark and then waiting for a few seconds.

There is also an issue with Internet Explorer which causes the bot to fail when it is first loaded. Loading the bot, refreshing the page, and then reloading the bot fixes this issue so long as your cache is on.

The bot isn’t sending messages!
On iOS 8 and under, and Android devices, you need to have your device on and the tab with the bot active. Unfortunately this means that you can’t play blockheads on the same device as the bot is open too. If you are running the bot on a computer, your web browser must be open. Also, if you refresh the page, the bot will be stopped and you will need to re-launch it.

Triggers aren’t working!
The most common cause of this is the trigger you specified has a space before or after the word. If there is a space, then the player needs to put a space too or it won’t work.

It doesn’t work!
Try clearing your cache

Still can’t figure out what’s going wrong?
Post in this thread, or start an issue here. Please include any errors in your console if you are on a computer (Press F12 and click on the console tab)

FAQ **Is it free?** Yes! You are free to use the bot in any way and modify it if you wish. The bot is open source and you can view the code [here](https://github.com/Bibliofile/Blockheads-MessageBot).

Can I make the bot run without a computer/phone?
Not yet… maybe someday… See here.

Do you track how I use the bot?
No. However, the bot will automatically report any errors which occur so that I can make it better.

Do you save my password?
Nope, your password stays secure.

Are there any dangers to running this bot on my server?
Unfortunately, due to the limitations imposed on the bot by the API, I cannot guarantee that {{name}} will return an the correct name. Due to this, I advise avoiding the use of commands tied to {{name}}.

For example: when someone says “DIE NOOB!” send the message “/ban {{name}}”

If “PLAYER” is online, a malicious player could join and use special characters that the API does not process to impersonate PLAYER.

For Developers **The best way to learn is looking at the source.** - [GitHub Repo](https://github.com/Bibliofile/Blockheads-MessageBot) - [Marco Polo Extension](https://github.com/Bibliofile/Blockheads-MessageBot/wiki/Development:-Start-Here). (Start Here) - [Extension API Reference](https://github.com/Bibliofile/Blockheads-MessageBot/wiki) - WIP - [Current source](https://github.com/Bibliofile/Blockheads-MessageBot/blob/master/dist/bot.js) (compiled into a single file)
---

I have a suggestion

Please reply to this thread and I will give your idea careful consideration.

Advanced Use

The bot is mostly self explanatory, however there are a few options that require a bit of explanation. See here.


Custom staff members commands?
How can I set up a server bot on my IPad?
Server Bots
What's the owner portal?
Unable to edit own posts
Help I don't know how to use Message Bot?!
New admin command
Bots?
Is there a way to mod Blockheads Mac Server?
[Server] Legitimacy
Search Player IGN
1.8/1.9 Suggestions (mostly multiplayer)
How do I set up the Message Bot?
How do I set up the Message Bot?
iOS Server
The almost complete list of guides
Creating a new server called Majic Gardens
Ban the above game!
We need a new chat filter system
Cloud server chat are not monitored only but also recorded
Make server commands by ourselves?
Has anyone else noticed that player history is no longer in the Owners Portal?
MDC Universe reopened!
How can I find out my second account?
How do you do the player join Message Bot message thing?
My thoughts and questions about some of the badges
Fix censored chat stuff
Programmed bots
Server spawn chat
An apology from majicDave
My server Louie awes
Automated messages?
Discord Message Bot Extension
Console BUG
#2

Thank you so much! I’ve added this to my server and modified the code so it bans people too. I’ve given you full credit via a timed message :smiley:

Edit: I have a bug. When I refresh the page, it keeps my Join and Timed messages, but deletes all my trigger ones.


#3

Very nice bib!

You’ve inspired me to create an original banning bot :slight_smile: idk if I’ll post it here, 2 people have requested I pm them the code…


#4

I used it and it was very clean. I made it ban people that said “that mad face when you swear”. So i said it, went on the console on the computer, copied the red face from the chat, and pasted in into the trigger box, it turned out a square but it works the same.

One problem, if people say stuff after the trigger, then it wont trigger.

EX)

Trigger word: :mad::mad::mad::mad: = result = /ban {{name}}

Chat:
Noob: :mad::mad::mad::mad: you, im better

Would it still ban?


#5

Thanks for this thread. we’ve set ours up and tested it a few times over…


#6

Sorry for the bug! When removing a redundant feature I removed the wrong line and thus my code was one character off. It should work now :slight_smile:

Thanks for the credit!

Please check for any spaces after your trigger word, I just tested with

Trigger = “bla” (no quotes)
And sent the message “bla testing”

The message was sent correctly.

I currently do not trim input to make sure there is no space before/after the word. Thus if you have a space then it won’t work unless the user puts a space as well.

I love this idea :slight_smile:

(Since when to smiles count as images?)


#7

I haven’t looked into this new version of yours, but is it possible to have it not message when admins arrive on the server?


#8

What would be cool is if there was a way to send a welcome message to first time joiners only… Other than that the bot is AMAZING!


#9

Bib, thank you so much for making this. This is a very handy tool/software! :wink:


#10

Here’s a tip guys!
In the trigger text box, type in some offensive words players might use… I mean offensive, like bad bad words.
And set the message text box to /BAN {{NAME}}
This will autoban players who use these words making it easier for staff to keep the server clean :slight_smile:
Enjoy!


#11

Nice tip, Smeeglefied!
Also, Bib.
There is a bug where all automatic messages disappeared without me pressing clear all.


#12

Possible, yes, I haven’t added that yet.

I’d love to do this but I have one huge problem, ram usage and/or storage space.

There are a few ways I could do this:

  1. Create an array of all players that join the server, check if the player is in the array before sending messages
    Problem: If you refresh your browser window then you lose all the info and players will trigger the message again.
  2. Do the same as #1 but save the variable to local storage so that it persists across sessions.
    Problem: LocalStorage is limited to 5mb. If you have a lot of worlds or a very active world, then you will run out of space.
  3. When the bot is launched, grab a copy of the server logs and build a list of players who have joined. Then loop through the logs and get a list of player names who have joined (the code for this already exists… I wrote a JS based log parsing program a while ago…)
    Problem: Requires extra startup time for the bot and another request. If the bot is running on a mobile device the page starts to get a bit heavier than I’d like it to be.

If I end up adding this, I will probably go with option #3.

You can achieve the same thing with a message in your welcome message using cookies if you are so inclined… I can give you some code if you want.

This is a problem for sure! Are you sure you saved your messages? What happened right before they disappeared?

Also, anyone using this please answer the following questions to help me improve the bot :slight_smile:

  1. What device type are you using it on? Computer, Tablet, or Phone?
  2. Would you prefer that the bot automatically saves messages as you edit them or do you like the save button?
  3. Which of the following features would you like added? (Please rank them; e.g. 2, 4, 1, 3)
    [ol]
    [li]Sending messages in response to only one “usergroup”. Example usergroups: Everyone, Staff, Admins (user defined?)
    [/li][li]Send messages when users leave – I actually removed this feature because I never had a use for it, should it be re-added?
    [/li][li]Should I add a regex trigger check? (If you don’t know what regex is, you probably should vote no here as it can be very confusing. It can also be quite powerful though…)
    [/li][li]Your suggestion???
    [/li][/ol]

I’m glad to see that people are finding a use for this :slight_smile:

Current bugs:
Inability to add more than 4 trigger messages – Unable to duplicate so far…
Messages disappearing randomly – Awaiting clarification from reporter.


#13
  1. What device type are you using it on? Computer, Tablet, or Phone? - Computer
  2. Would you prefer that the bot automatically saves messages as you edit them or do you like the save button? - auto save would be great
  3. Which of the following features would you like added? (Please rank them; e.g. 2, 4, 1, 3) I’m assuming 1 is the best.
    Sending messages in response to only one “usergroup”. Example usergroups: Everyone, Staff, Admins (user defined?) - #1 I would love this!
    Send messages when users leave – I actually removed this feature because I never had a use for it, should it be re-added? - #2 Definitely readd
    Should I add a regex trigger check? (If you don’t know what regex is, you probably should vote no here as it can be very confusing. It can also be quite powerful though…) - Regular expression? Erm, too Confuzzling #3
    Your suggestion??? - N/A #4

#14

Thanks :slight_smile: That’s exactly what I was looking for. Auto save is officially on the pending feature list.


#15

Thanks Bib for this useful tool!

  1. What device type are you using it on? Computer

  2. Would you prefer that the bot automatically saves messages as you edit them or do you like the save button? Auto-save would be great

  3. Which of the following features would you like added? (Please rank them; e.g. 2, 4, 1, 3)
    1.Sending messages in response to only one “usergroup”. Example usergroups: Everyone, Staff, Admins (user defined?) Yes that would be awesome! #1

2.Send messages when users leave – I actually removed this feature because I never had a use for it, should it be re-added? Yes please #2

3.Should I add a regex trigger check? (If you don’t know what regex is, you probably should vote no here as it can be very confusing. It can also be quite powerful though…) Confused #3

4.Your suggestion??? None #4


#16

Thanks for the feedback :slight_smile:

Change log for tonight:
Re-added leave messages
Removed the save button - messages now automatically save!

To get the new version just refresh your page if you have the bot open and launch it again.

Usergroups tomorrow maybe?


#17

Groups have been completed!!!

You can now require that a user be in one of the following “groups” for the message to be triggered/sent.

[ul]
[li]New Player (Only available in join messages)
[/li][li]Any Player
[/li][li]Staff (Mod + Admin)
[/li][li]Admin
[/li][li]Not Staff (Regular player, not mod or admin)
[/li][li]Not Admin (Mod + regular player)
[/li][/ul]
NOTE: If your name is not on the admin list (as a server owner), then you will not be counted as an admin.

So far as I know this is working correctly :slight_smile: I think I tested all combinations… If I missed something and something doesn’t work let me know!


#18

Awesome Bib!! I love it!!
Thanks so much!!
400th post :smiley:


#19

Thanks again Bib! This allows greater flexibility to target the appropriate messages to desired groups, it works really well!


#20

So that’s what I saw when I entered Skylands… I didn’t know this was possible, thanks for making this!