• Welcome to Aliquam!
  • Recruitment is currently opened!
  • You can apply down below, in the "Applications" board.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Title: we need macros!
#1
Yo, T3s here.

Idea is simple, yet powerful:
we need a plugin, that allows us to record macros.

How should it work?

1. typing /macro <name> record should start new macro
2. you start typing commands
3. you type /macro <name> end to stop recording macro - now your macro should be saved!
4. type /macro <name> run to play given macro

what the plugin should support:
/macro <name> - to show info about macro and help for plugin
/macro <name> record - to start recording
/macro <name> end - to finish recording
/macro <name> run - to finish recording
/macro <name> delete - to delete saved macro
/macro <name> edit - to edit macro in-game without need to rewrite it from the beginning.
/macro list - to show a list of your and global macros
/macro <name> [un]bind - to [un]bind a macro to currently held item and play it using SHIFT+LMB
/macro <name> share - to publish given macro so that other players can use it (must be accepted by administration)
operators:  =, +, -, *, /, %, ^, sqrt(), and (, ) for math grouping
tags: &RANDOM, &AIMPLAYER, &AIMID, &AIMX, &AIMZ, &AIMZ and others you could think of -_-
variables created and accessed via '#'
while recording, all command execution and chat writing event's should be canceled

Variables and tags system:
By typing /#<var>=<string> everything that stands after equation mark would be assigned to #var. You acces variables in macros the same way you create them - by #<varname>. Should be very simple to implement using regex or something. 
Use &RANDOM (the predefined variable you cannot override) to supplement it with random number generated on the go. Make complex macros using math functions - #treeheight=&RANDOM%5+#mintreeheight*#swampconstant

Details:
the simplest way to do this would be to save macros as <macroname>.txt files for each player.
Structure of the file might be:
Code:
@DESCRIPTION
macro for creating a cherry blossom at location of the block you're looking at with random
amount of red and pink wool as leaves
@AUTHOR
T3sT3ro
@START
//hpos1
//hpos2
//toggleplace
/macro createAndSelectTree
#num1=#RANDOM%101
#num2=100-$num1
//replace leaves $num1%wool:pink,$num2%wool:red
//replace log fence
//toggleplace
@END


Labels with @ in front should mark different parts of the macro
each variable/command takes one line. each &TAG is a tag for "pseudomacrocompiler". Each command in macro should be executed as if the player himself executed it (maybe player.chat("/somecommand"); ?). No worry about spamming macros cuz you have AlqChat flood control. Additionaly, to avoid bugs, escape characters are needed. To avoid reference loop with nested macros you can have one "macroRelations.txt" file and each time a macro is created add it to the file and perform a fast analysis by building a directed graph of relation and finding cycles.

Challenging plugin, it's almost like writing new scripting language :P But i think it might be very useful.
and at least

HOW USEFUL WOULD IT REALLY BE?!
imagination is your only limitation.
For admins - /macro meeting - would teleport all staff to the server owner
For players - save your brush presets in voxelsniper, and don't ever repeat endless cycle of /b b mm /b 10 /v 15 /vr 12 ... binding macro to item = easy brush selection
For advanced world edit users - create complex structures with one click - Do you want to generate predefined towers with varying heights using only right click? maybe place random buildins from your schematics? what about big, fancy trees?
AND IT WOULD HAVE LOTS OF APPLICATION - you can think of many clever ways to "exploit" this plugin - if you play with your friends or build often together - write a script that sends them all a private message and invites them all to teleport to you. bind /ptime day and /ptime night to different items so you can fast cycle between them with just one click. Rightclick on somebody to write him an automated msg and invite to friends. AUTOMATION.

If this is too complicated or you think unneded feel free to criticize
 
Reply
  


Messages In This Thread
we need macros! - by Tooster - 14 Jul 2017, 07:11 PM

Forum Jump:


Browsing: 1 Guest(s)