Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
EntranceJew
Nov 5, 2009

Hello fellow codefriends. I'm dumping all my semi-useful information in this thread now.

I wrote an endpoint ej.is_goon that will return true if the calling user is in the in-game goon chat (eventually this will read from the gooncorp when we get one). If someone joins/leaves the chat someone that the script recognizes as a goon will need to run ej.is_goon{c:#s.chats.users}. Call this fullsec script from within your own script to give your fellow goons some handouts, it returns true or false provided there isn't an error. Source: is_goon.js

Here's a mongo script that I use from the CLI that really speeds up loving around in your database mongo.js.
Warning: Any keys with dollar signs in them will fail to parse in the CLI making filters and such basically useless until the client's CLI parser is fixed. Same goes for the trashed autosuggest.
When it does work it means you can just run mongo{doctype:"w_request"} to make sure you didn't screw up the script you just wrote.

I also wrote an endpoint named ej.w that you can use in your scripts to allocate script execution time you're not using in your public facing scripts to doing some work. Whenever your script does work you can specify a username to attribute the work done to (manager) as demonstrated here: work_implementation.
The way this works is that work to be done is added to my database and then whenever a client connects, it calculates the time left and the amount of work a client could do, then it runs a pre-defined work function for the type of work selected from the database by the scheduler (right now it is not smart at all).
Currently the only implemented unit of work available is to brute-force attack user locs. It is a little bit impractical with 9 unique prefixes and 36^6 combinations of suffixes, but it's exactly the use case for this sort of thing. Especially if locs aren't meant to change.
The endpoint is meant to remain fullsec for maximum work distribution but I may write differently-sec'd versions to include in inherently lower-sec work.

Adbot
ADBOT LOVES YOU

EntranceJew
Nov 5, 2009

Yorkshire Pudding posted:

If I were interested in learning how to script, would the game help me learn? And could I have some amount of fun while doing it?

I believe so. There are many in-game resources for basic scripting, patterns to use, and even some tips for working within the game's resources. If you ever have any trouble you can use our group help channel, we're pretty good about getting people off in the right direction.

EntranceJew
Nov 5, 2009

Yorkshire Pudding posted:

Alright this game is pretty great, though I still have no idea what I'm doing. I just got past the first half of the firewall, now I need to get the second. I constantly have to look online to ask really basic questions like "How do I send messages?" and "How do I look at my scripts?". It's really enthralling though. I imagine if you actually know how to code it all comes a lot more naturally.

One really embarrassing thing: I never learned how to type correctly. Despite being on computers my whole life I always just hunt and peck. I'm finally trying to get over that and learn to type right. It's so loving hard. Typing this out right now I'm going at about 9WPM.

During the tutorial you can always type "help" to get a small list of useful commands. From there it will show you "scripts.trust" which you can always run safely. Running a command without any arguments will typically tell you more on how to use it.

  • Locked thread