EDIT:
A prepackaged binary would be helpful, as I'm just poking in the dark with installing POE and JSON.
I just followed a guide to setting up cpan, went in and installed them with the install command.
EDIT2:
It might be useful to have chat triggers record the sayer.
EDIT3:
I fixed the problem with the hello by changing it to one line.
Rollback Post to RevisionRollBack
I disagree with you, therefore you are wrong.
Quality of output = Skill * Effort
The synthax error only appears when I run the binary, but I'll post the JSON for ref.
// Minecraft Admin perl (mcadmin_v0_3_1.pl) version 0.3.1 config file (config.json)
{
// Change the password
"password": "removed to to parnoinia",
// Change the listening port to suit your needs
"port": 1245,
// Add timers with intervals in seconds. Uncomment(remove the first // per-line) to use the examples.
"intervals": [
// [15, ["one"], "say Fifteen second interval."] // every 15 seconds, server one does say Fifteen second interval.
// , // every 30 seconds server one and three does say Thirty second interval.
// [30, ["one", "three"], "say Thirty second interval."]
// , // every 20 seconds server two does say Twenty second interval.
// [20, ["two"], "say Twenty second interval."]
// , // New format for multiple lines
// [33, ["two"], ["say Multiple...", "say ...lines...", "say ...yeah."]]
],
// Add chat triggers, you can use regex as demonstrated by '^hello'. Uncomment(remove the first // per-line) to use the examples.
"chat_triggers": [
//["^Hello", "say Hi."] // Hello at the beginning of a line triggers say Hi.
// , // bye anywhere in a line(even goodbye) triggers say Bye.
["bye", "say Bye."],
["gtg", "say Bye."]
// , // grief anywhere in a line(even griefer) triggers say Oh no!
// ["grief", "say Oh no!"]
//["grief", "say Oh no! Please votekick/ban!"]
// , // New format for multiple lines. Responds to (any character)tp at the beginning of a line with:
// tp?
// Toilet Paper?
// ["^.tp", ["say tp?", "say Toilet Paper?"]]
],
// Set which servers use which triggers (-1 uses all triggers). Uncomment(remove the first // per-line) to use the examples.
"chat_trigger_servers": {
"one": [-1], // server one triggers on ^Hello and grief
"two": [-1], // server one triggers on ^Hello and grief
"three": [-1] // server one triggers on ^Hello and grief
// , // server three triggers on bye and grief
// "three": [1, 2]
// , // server four triggers on all triggers in @chat_triggers
},
// Enable votekick by uncommenting(removing the first // in front of) "servers", "trigger", "say"(optional) and "votes"
"votekick": {
"servers": ["two"], // Which servers to use the feature on, ["all"] for all servers
"trigger": "^!votekick ([\\w\\d\\.]+)", // The regex for the votekick chat trigger
"say": "%v has voted to kick %u.", // What to say when a vote is cast, %v is the name of the voter(optional), %u is the name of the voted(optional)
"votes": 3 // The amount of votes needed to kick
},
// Enable voteban by uncommenting(removing the first // in front of) "servers", "trigger", "say"(optional) and "votes"
"voteban": {
"servers": ["two"], // Which servers to use the feature on, ["all"] for all servers
"trigger": "^!voteban ([\\w\\d\\.]+)", // The regex for the voteban chat trigger
"say": "%v has voted to ban %u.", // What to say when a vote is cast, %v is the name of the voter(optional), %u is the name of the voted(optional)
"votes": 4 // The amount of votes needed to ban
},
// Enable server level backups.
"backup": {
"interval_minutes": 10, // Backup interval in minutes
"keep_days": 2, // How long a history of backups to keep in days
"dir": "../minecraft_backup" // Directory to back up to
},
// Enable IRC bot for administering
//"irc": {
// "nick": "changeme", // Make sure this is IRC-appropriate
// "server": "irc.esper.net",
// "channel": "#changeme",
// "port": "6668",
// "ircname": "changeme", // Make sure this is IRC-appropriate
// "username": "changeme", // Make sure this is IRC-appropriate
// "stderr_capture": "^(?:\\s+\\d{1,2}:\\d{2}:\\d{2}\\s+)?(.+)", // What kind of lines to capture"(.+)" from stderr and send to IRC
// "prefix_char": "!" // The start-of-line character to capture commands "!servername say Hi there" or "!say Hi there" which goes to all servers
// , // Say to all servers if a line doesn't start with perfix_char (optional)
// "autosay": 1,
// "autosay_prefix": " " // Prefix for autosay lines.(optional) %n is the nick of the IRC user(optional)
// , // Nickserv password of your bot
// "nickserv_pass": "changeme"
// },
// Exclude dirs by name for the check for servers
//"exclude_dirs": [
// "not_a_server",
// "backups"
//],
// Capture lines from stderr and (over)write or append them to a file with an optional preceding unix timestamp
//"stderr_line_to_file": [
// Capture regex, ["servername", "servername2"]("all" for all servers), format(%1 is what was capture, %t is a unix timestamp(optional)), write mode(> overwrites, >> appends), file name relative to server dir
// ["Level saved! Load: (\\d{1,2}/\\d{1,2})", ["all"], "%t %1\n", ">>", "load.txt"] // Appends a timestamp'd server load(X/Y)
// , // (Over)writes the server listening port
// ["Now accepting input on (\\d+)", ["two", "three"], "%1", ">", "port.txt"]
// ],
// Add connect triggers. %n is the name of the user and %i is the IP
"connect_triggers": [
// Seconds after connect that the messages are fired(0 is instant, but might seem like it was sent before they see the join message), ["servername", "servername2"]("all" for all servers), message or ["multiple", "messages"] to send
[0, ["one"], ["say Welcome to the server!", "say Build what you want, just don't grief."]],
[0, ["two"], ["say Welcome to the server!", "say Build what you want, just don't grief.", "say This server has votekick/ban, btw." ]],
[0, ["three"], "say Hello, %n!"]// Say "Welcome to the server username@IP!" instantly after a connection
// , // Say three lines of welcomes 2 seconds after a connection
// [2, ["two", "three"], ["say Welcome!", "say Welcome!!", "say Welcome!!!"]]
]
}
Rollback Post to RevisionRollBack
I disagree with you, therefore you are wrong.
Quality of output = Skill * Effort
I think that mail2345 is talking about how I wanted to have a thing so that when you typed, "!spleef" the server would say, "START SPLEEF IN 5..." than a second later say, "4..." and then a second later say, "3..." and so on. I tried to do it like this:
But I do not think that this works. Could this feature get put in to the next version either as the way I did it here or as a command that is done with some crazy magic that I am sure you would be able to cook up. :tongue.gif:
P.S. I would give you a hug!
Rollback Post to RevisionRollBack
This text is just here to take up space. Congratulations. You found it!-Zachariasmith
Sorry this post took so long Adura, got a little tied up in some stuff today.
Feature Request: Auto IP Banning / Admin list banning
Here's my general outline. Of course these are all suggestions, and implementing them is 100% up to Adura (his script is not the only one this request can apply for, though it's the one I use and recommend for server admins, having not used the other ones).
The ban / banip systems will have to be segregated due to different methods of banning.
Here's my idea for the ban system:
The script pulls a txt from a pre-defined URL on a regular basis (say 5 minutes). It calculates the MD5 for this txt, and compares it to the one in a file. If the MD5 (or any other hash/comparison method) matches, it does nothing, as it assumes the execution is complete. If the hash (comparison) turns up a different file, it'll parse each one of the lines as an argument for a defined command.
Config probably looking something like (not written in JSON of course):
txt file, interval, command to use line for as arg
Which would pull bans.txt every 5 minutes, perform the check, and if it's different, execute each line as ban [x], followed by writing the new hash to the file.
This would also work for unban, which would of course require a separate file and therefore, line in the config.
Unfortunately, the ban-ip process has been made by Notch to be much more complicated. I'm thinking something along these lines... (try to follow me here).
Same getting process, but this time, if the hash is different, append the new lines to a file of one's choice (defined in the config). When the script starts, either remove all of the lines in that file, or add all of the lines in that file, based on what's described in the config. Then wipe the file (keep the hash of course).
Might have been hard to follow, so I'll provide to examples. The first is for banning the IPs.
Something like http://minecraft.net/banned-ip.txt, 300, /home/user/Minecraft/ipbansadd.txt, add, /home/user/Minecraft/[all]/banned-ip.txt
Would pull that file from the minecraft server every 5 minutes, append it to ipbansadd.txt locally if the hash differs, and append all of the lines in ipbansadd.txt to banned-ip.txt when the server is reset (in all subdirectories of Minecraft).
Unbanning would work much the same way, except possibly with remove rather than add.
I know that was all a bit long and unclear, I can surely clarify. Thanks for reading, and thanks for the support in general. Adura++ :biggrin.gif:
xdcx@sweetprince:~/minecraft/perltest$ perl mcadmin_v0_3_1.pl
Can't locate JSON.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at mcadmin_v0_3_1.pl line 50.
BEGIN failed--compilation aborted at mcadmin_v0_3_1.pl line 50.
when i try to run the binary,
xdcx@sweetprince:~/minecraft/perltest$ sh ./mcadmin_v0_3_1
./mcadmin_v0_3_1: 5: Syntax error: ")" unexpected
The script doesn't record if you've connected in the past.
Works fine.
EDIT:
Ugh, I need to update alot of perl modules.
Quality of output = Skill * Effort
EDIT:
A prepackaged binary would be helpful, as I'm just poking in the dark with installing POE and JSON.
I just followed a guide to setting up cpan, went in and installed them with the install command.
EDIT2:
It might be useful to have chat triggers record the sayer.
EDIT3:
I fixed the problem with the hello by changing it to one line.
Quality of output = Skill * Effort
Sorry if I'm being an inconvenience.
Quality of output = Skill * Effort
You have to know know json syntax if you intend to edit the config file beyond simple uncommenting.
Quality of output = Skill * Effort
And possibly delayed chat responses(for like a spleef timer).
Quality of output = Skill * Effort
message 1 every 5 minnutes after 1 min from start.
So that rotating messages work.
Quality of output = Skill * Effort
Message1 5mins Message 2 5 mins Message3 5 mins Message1
Quality of output = Skill * Effort
But I do not think that this works. Could this feature get put in to the next version either as the way I did it here or as a command that is done with some crazy magic that I am sure you would be able to cook up. :tongue.gif:
P.S. I would give you a hug!
Feature Request: Auto IP Banning / Admin list banning
Here's my general outline. Of course these are all suggestions, and implementing them is 100% up to Adura (his script is not the only one this request can apply for, though it's the one I use and recommend for server admins, having not used the other ones).
The ban / banip systems will have to be segregated due to different methods of banning.
Here's my idea for the ban system:
The script pulls a txt from a pre-defined URL on a regular basis (say 5 minutes). It calculates the MD5 for this txt, and compares it to the one in a file. If the MD5 (or any other hash/comparison method) matches, it does nothing, as it assumes the execution is complete. If the hash (comparison) turns up a different file, it'll parse each one of the lines as an argument for a defined command.
Config probably looking something like (not written in JSON of course):
txt file, interval, command to use line for as arg
An example would be:
http://minecraft.net/bans.txt, 300, ban
Which would pull bans.txt every 5 minutes, perform the check, and if it's different, execute each line as ban [x], followed by writing the new hash to the file.
This would also work for unban, which would of course require a separate file and therefore, line in the config.
Unfortunately, the ban-ip process has been made by Notch to be much more complicated. I'm thinking something along these lines... (try to follow me here).
Same getting process, but this time, if the hash is different, append the new lines to a file of one's choice (defined in the config). When the script starts, either remove all of the lines in that file, or add all of the lines in that file, based on what's described in the config. Then wipe the file (keep the hash of course).
Might have been hard to follow, so I'll provide to examples. The first is for banning the IPs.
Something like
http://minecraft.net/banned-ip.txt, 300, /home/user/Minecraft/ipbansadd.txt, add, /home/user/Minecraft/[all]/banned-ip.txt
Would pull that file from the minecraft server every 5 minutes, append it to ipbansadd.txt locally if the hash differs, and append all of the lines in ipbansadd.txt to banned-ip.txt when the server is reset (in all subdirectories of Minecraft).
Unbanning would work much the same way, except possibly with remove rather than add.
I know that was all a bit long and unclear, I can surely clarify. Thanks for reading, and thanks for the support in general. Adura++ :biggrin.gif:
Quality of output = Skill * Effort
Can't locate JSON.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at mcadmin_v0_3_1.pl line 50.
BEGIN failed--compilation aborted at mcadmin_v0_3_1.pl line 50.
when i try to run the binary,
xdcx@sweetprince:~/minecraft/perltest$ sh ./mcadmin_v0_3_1
./mcadmin_v0_3_1: 5: Syntax error: ")" unexpected
I really want to try this script :smile.gif: