Guide
If I wanted to call a script from a macro, I would type:
/name = script.name
For example, if I wanted to make a macro that hardlines for me, I would type:
/hardline = kernel.hardline
and it would turn into
kernel.hardline
If I wanted the macro to pass arguments, I would replace every curly bracket I would put with DOUBLE curly brackets.
For example, if I wanted to make a macro that disconnects from hardline for me, I would type:
/disconnect = kernel.hardline {{dc : true}}
and that would turn into
kernel.hardline {dc : true}
If I wanted to make a macro that let you change arguments, you can put {n} in the place of that argument, but instead of n, you would type which argument you would want. Note, that it counts from 0, so 0 would be the first argument, 1 would be the second, and so on.
For example, if I wanted to make a macro that shows one of my upgrades for me, I would type:
/upg = sys.upgrades {{i : {0}}}
and if I used it like
/upg 0
it would turn into
sys.upgrades {i : 0}
Now let's make a macro that lists all my upgrades. It's easy right? Just use the first example.
But what if I wanted to make it show me the full upgrades? I could add a {0} for full, but I'm too lazy to always type in true or false. Luckily, we can give it a default value.
So, if I would type:
/upg = sys.upgrades {{full : {0=false}}}
and if I used it like
/upg
it would turn into
sys.upgrades {full : false}
but if I used it like
/upg true
it would turn into
sys.upgrades {full : true}
What if I wanted to make a macro that chats in 0000 for me? Because of how macros work, if I try to use {0}, it will stop at the first space, and not being able to put spaces in your chats is bad.
Instead, you can use {$}. Which essentially means, dump every argument that isn't used elsewhere in a {n} here.
So, if I would type:
/chat = chats.send {{channel : "0000", msg : "{$}"}}
and if I used it like
/chat hello world!
it would turn into
chats.send {channel : "0000", msg : "hello world!"}
Let's say that I wrote a cracker. It takes an argument t, a scriptor, that it cracks.
If I wanted to make a macro for it, I would type: // replace your.cracker with your actual cracker
/crack = your.cracker {{t : #s.{0}}}
and if I used it like // replace example.loc with an actual loc
/crack example.loc
it would turn into
your.cracker {t : #s.example.loc}
Common Macros
Here are some common macros for the average player.
/hl = kernel.hardline
/dc = kernel.hardline {{ dc: true }}
/bal = accts.balance
/upgs = sys.upgrades
/upg = sys.upgrades {{ i: {0} }}
/xfer = accts.xfer_gc_to {{ to: "{0}", amount: "{1}" }}
/xferupg = sys.xfer_upgrade_to {{ to: "{0}", i: {1} }}
/load = sys.manage {{ load: {0} }}
/unload = sys.manage {{ unload: {0} }}
/cull = sys.cull {{ i: [{0}], confirm: true }}
Caveats
* You can not create a global macro that exists across all of your users. You can modify the macro files of your users in your hackmud directory, but DO NOT SYMLINK the files, because it will crash the hackmud client.
* Macros can not be used with /auto.