hackmud

hackmud

How do I script?
Title says it all. I just beat vLAN and would like to learn how to write scripts. What language are the scripts in and how to write and upload them?
< >
Showing 1-9 of 9 comments
type in "#help". All scripts are written in JavaScript. Feel free to ask for help in game.
Originally posted by th_pion:
type in "#help". All scripts are written in JavaScript. Feel free to ask for help in game.

i asked for help with scripting multiple times...i still wait for an answer... if it is about scripting the communtiy isn't very helpfull, they ignore you.

thats the exp i've made :/
Do you know javascript? or any other scripting language?
in game commands:
#edit <script name>
creates a new script with name <script name> and opens the script in your OS's default text editor
#dir
opens your file explorer to the directory where you script is saved.
#up <script name>
uploads the script for use. YOU MUST CALL THIS AFTER SAVING CHANGES TO YOUR SCRIPT
#help
more commands/help

without upgrades you can only have one script uploaded at a time for use

you can edit your script to be a simple javascript function. this example takes the s.scripts.lib() library (written and provided by the game developer) and prints all of the object keys within it.

function(context, args) { var caller = context.caller; var l = #s.scripts.lib(); return Object.keys(l); }

upload and then run this in game. then a good start is to explore each of those objects the script outputs. Make your own simple scripts. While this isnt a "terrible" way to get into programming, it's certainly harder if you've had zero experience whatsoever.

kind of a lazy example but y'know. help yourself.

if you're past the single player tutorial, go to the chat channel 7001. dtr is usually in there giving some sage advice.
Originally posted by Tallakah:
Originally posted by th_pion:
type in "#help". All scripts are written in JavaScript. Feel free to ask for help in game.

i asked for help with scripting multiple times...i still wait for an answer... if it is about scripting the communtiy isn't very helpfull, they ignore you.

thats the exp i've made :/
Than you asked when dtr was not around. He did multipe scripting tutorial sessions since launch already.
I'm C# and lua fluent, I can learn kind of easy :)

I'll poke around, and that was a great tutorial.
How do you run your script once it's uploaded? I tried <myusername>.<scriptname> or just <scriptname> and I get this error:
:::TRUST COMMUNICATION::: PARSE ERROR <myusername>.<scriptname>: script doesn't exist
Never mind, just typing the script name worked. I must have had a typo
when i tried the script here it said
{retval:"PARSE ERROR ****.script1: Must specify security level: #s.scripts.lib",success:false}

although how would one explore it? the output is a bunch of keys with no value pair if i am reading it right.
Originally posted by yowshi:
when i tried the script here it said
{retval:"PARSE ERROR ****.script1: Must specify security level: #s.scripts.lib",success:false}

although how would one explore it? the output is a bunch of keys with no value pair if i am reading it right.

you gotta get the scripts level with scripts.get_level then put the appropriate sec level at the start of the script.

i think scripts.lib is fullsec, so you would have to put #fs.scripts.lib other scripts may take #ms #hs #ls #ns being med high low and nullsec respectively

Im still trying to figure out how to get my Ifs working right, then i can start making neat things
< >
Showing 1-9 of 9 comments
Per page: 1530 50