Skip to content

Commit

Permalink
Add some save entry data to the random command
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 16, 2015
1 parent 3bd47a1 commit 683fd28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -2049,7 +2049,8 @@ public void registerCoreMembers() {
// TODO: Document Command Details

// @Tags
// None
// <entry[saveName].possibilities> returns an Element of the possibility count.
// <entry[saveName].selected> returns an Element of the selected number.

// @Usage
// Use to choose randomly from the following commands
Expand Down
Expand Up @@ -4,6 +4,7 @@
import java.util.LinkedHashMap;
import net.aufdemrand.denizencore.exceptions.CommandExecutionException;
import net.aufdemrand.denizencore.exceptions.InvalidArgumentsException;
import net.aufdemrand.denizencore.objects.Element;
import net.aufdemrand.denizencore.scripts.ScriptEntry;
import net.aufdemrand.denizencore.scripts.queues.ScriptQueue;
import net.aufdemrand.denizencore.scripts.commands.BracedCommand;
Expand Down Expand Up @@ -75,6 +76,8 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
previous3 = previous2;
previous2 = previous;
previous = selected;
scriptEntry.addObject("possibilities", new Element(possibilities));
scriptEntry.addObject("selected", new Element(selected));

dB.report(scriptEntry, getName(), aH.debugObj("possibilities", possibilities) + aH.debugObj("choice", selected + 1));

Expand Down

0 comments on commit 683fd28

Please sign in to comment.