VotifierScripts
VotifierScripts is a plugin that listens for Votifier votes and allows you to run javascript code when a vote is received (allowing for endless possibilities!) This javascript is enhanced with the power of buscript which gives access to many global functions in order to make an easy to use scripting experience. No programming experience is required, but in that case you may find this plugin harder to use than most.
This plugin requires Votifier but already comes prepackaged with buscript.
The latest development builds can always be found at http://ci.onarandombox.com/job/VotifierScripts/
Commands
Currently there's just one command
/vstest <player> [service [address [timestamp]]]
- This command tests the script that is run when a vote is received.
- Permission: votifierscripts.test
- <player> is used to indicate a target for your script. In general, this should probably be someone that is online if you are going to use it.
- The test command will always reload the vote-script.txt file so there is no need to do anything special should you modify the script.
- The other 3 arguments are optional but each one requires using the one before it, so to use timestamp you have to do all 4. These will help you more fully test a vote script.
Scripts
Scripts are text files that contain Javascript code. This may sound scary to people unfamiliar with coding but luckily VotifierScripts provides several easy to use methods for creating basic scripts.
The primary script that is called when Votifier receives a vote is located at plugins/VotifierScripts/vote-script.txt. You will notice this script initially comes with a simple built in sample. Feel free to modify this!
Any script that the primary script runs must be located in plugin/VotifierScripts/scripts and may have any name/file extension you like.
Script Features
- Easy to use global functions including command running, message broadcasting, permission management and more.
- Any string used in these global functions has access to "%target%" which represents the current target of the script. Example: broadcast("Hello, %target%")
- The ability to run another script at a later time with 100% reliability, even if the server crashes!
- Defines the global variable target so more advanced things can be done with the script's target.
- The global variable server is also available which gives direct access to the Bukkit server variable just as if you were working from within a plugin!
Detailed Script Features
Global Functions and Variables
Additional Global Functions and Variables specific to VotifierScripts
Example Scripts
- Simple broadcast/command sample
- vote-script.txt
broadcast("Hey everyone, %target% is a cool guy!") command("op %target%")
- This is a simple script that tells everyone on the server what a cool guy the target (dumptruckman in this case) is and then ops them.
- Timed permission sample
- vote-script.txt
message("%target%", "You have just been given flight in the creative world for 30 minutes!") addPerm("creative", "%target%", "flight.permission") runLater("remove-perm.txt", "30m", "%target%")
- scripts/remove-perm.txt:
message("%target%", "Your flight power has been removed, hope you weren't up there!") removePerm("creative", "%target%", "flight.permission")
- Please note these two scripts require Vault and a Vault compatible permission manager which allows them to work even when the player is not online.
- It is possible to instead use the command() function to run your own permission commands without using Vault.
- Also note "flight.permission" is not a real permission. Your actual flight enabling permission may vary (or not even exist!)
Click Here for more sample scripts
Click Here for script requests
For Developers
Source code: https://github.com/dumptruckman/VotifierScripts
Maven repository: http://repo.onarandombox.com/content/groups/public/
Maven pom information:
<groupId>com.dumptruckman.minecraft</groupId> <artifactId>votifierscripts</artifactId> <version>1.0-SNAPSHOT</version>
You can add your own functionality to the scripts if you so choose. Here's how to hook into VotifierScripts:
Plugin plugin = Bukkit.getPluginManager().getPlugin("VotifierScripts"); if (plugin != null) { Buscript buscript = ((VotifierScripts) plugin).getScriptAPI(); // Do stuff with buscript object, see documentation below }
For more information about the buscript library, visit: http://dev.bukkit.org/server-mods/buscript/
@TheFluffey
Same here. Please reply if anyone knows how to fix this
@DeadDino
Same issue here
Hey there, my server has Votifier, and VotifierScripts the script is: broadcast("&1===== &1&l%target% &1voted, he got &b15 Diamonds! &1=====") command("give %target% 264 15")
And when I use /vstest it works fine. Yet when I vote nothing happens. I have tested Votifier's connection, It works, but with all my efforts, it does not work.
Very interesting... what is the performance impact on the server for something like this to be continually running on a 100+ player server?
Anyone help? Why this don't work http://dev.bukkit.org/server-mods/votifierscripts/forum/script-help/43439-getting-error-script-not-working-help/#p1
FIXED - Updating votifier to 1.9 and it worked.
I run votifier and votifier scripts obviously. I have been running a minecraft server with both plugins with no problem. On my minecraft server I use the "FlatfileVoteListener" which makes a vote.log and also runs votifier scripts which runs the commands; "broadcast("Thanks for voting for our server, %t! Have 250 FREE Claim Blocks!.") command("acb %t 250")"
This works perfect on my minecraft server.
I have since started a tekkit server with votifier and the FlatfileVote Listener, and for my vote-script, I use the following http://pastebin.com/30C8SQpu. If i do /vstest player it works great, doing exactly what I want it to do, but when someone votes, it only adds the info to the vote.log and the vote-script is never ran. Please help me, I feel like I'm going crazy!
Running Votifier Version 1.7 VotifierScripts v1.0-b21
@dumptruckman
How do i get this to work with GroupManager? http://pastie.org/4703737
It's not working for me.
hello the plugin is flat out not loading up :( the error is http://pastebin.com/NHtav5dU
Do it need a listener to work or no?
@dumptruckman
How can i add two commands to the vote-script.txt
@dumptruckman: Alriiiight - thank you it works now. :] Same is for the colored reminder message.
@Schlumpfpirat
Did you delete your scripts.bin after updating to #28? If so, please pastebin the contents of your scripts.bin file. If not, you need to delete it and then it should be fine.
@deleted_7536780
Yes, the scheduled scripts will still be called in the event of a server restart. If they time passes while the server is down, it will be run as soon as the server is started up.
@dumptruckman: It appears to be, that VotifierScripts no longer "bothers" people to vote. Also it does not broadcast any longer, when somebody voted. No errors. #28 Build /edit: It loaded up all the time, but didn't work. How ever now it pops out an error http://pastie.org/4581715
What if the server restarts after they vote, but before they get the perm removed... does it resume countdown and remove the perm after server is up again?
@1337minecrafer
Something like this is already possible. Please refer to the forums for pre-written scripts that already do this or the script requests section for requesting it.
I would like a feature that adds something where only a certain group can use a certain string of commands, like this maybe: startGroupCommands("group", "%target%") addPerm("world", "%target%", "random.permission") message("%target%", " endGroupCommands("group", "%target%")
So addPerm and message would only go to the targets in that specific group.
Oh thanks! it worked, god bless you man :)!
@dumptruckman:
Great! It works again! :]
Anyhow can not check the ยง thing, since I have a german keyboard and it's not a special mark at all.. so I will try the second method as soon as possible this weekend and let you know how it works out.
I'd really love, if you'd have a look on the forums and the VoteReminder thread. :]
@Endless123
The event error indicates that you are not using Votifier 1.8. You also need to make sure to close your quotes for your commands.
@Gunnerrrrr look at the forum from VotifierScripts!
@dumptruckman 2012-08-22 07:54:56 [INFO] [VotifierScripts] Enabling VotifierScripts v1.1-SNAPSHOT-b26 2012-08-22 07:54:56 [SEVERE] Plugin VotifierScripts is attempting to register event com/vexsoftware/votifier/model/VotifierEvent, which does not exist. Ignoring events registered in class com.dumptruckman.minecraft.votifierscripts.VotifierScripts
Cant seem to get it working right - im trying to get your Vote Reminder Script working, it shows the reminder, but wont broadcast or set permission for permissions EX.
command("world world") command("user %target%") command("pex user %target% add vote.notify.ignore) or command("/pex user %target% add vote.notify.ignore)
Maybe it has something to do with the error? or am i just plain stupid