Difference between revisions of "User:Zamujasa/DWAINE for Smartasses"

From Space Station 13 Wiki
Jump to navigation Jump to search
(Created page with "This is a work-in-progress guide on using DWAINE powerfully. == DWAINE usage == == Useful DWAINE info == == Programs and scripts == === Advanced tips and tricks === DWA...")
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This is a work-in-progress guide on using DWAINE powerfully.
This is a work-in-progress guide on using DWAINE more better. Or something. I guess.
 
I wanted to put fun programs and programming techniques here but it turns out DWAINE is actually ''really'' awful and all the basic stuff breaks the moment you try to do anything fun with it.
 


== DWAINE usage ==
== DWAINE usage ==


=== Script breakdown ===
''Contributed by: Lrwhittaker48''
Here I will break down how the scripts listed below actually function, this way you can debug them and learn your own!
For this example, we will be using the Telescience send script
<code>echo #!|nteleman -p 2 coords $arg0 $arg1 $arg2|nteleman -p 2 send ^ send</code>
To start, the way we write scripts with DWAINE is the echo [script] ^ [filename] function, this is explained in [[DWAINE for Dummies]] so I will skip it here.
<code>#!|n</code> This lets DWAINE know that its a script, needed to start all scripts.
<code>Teleman -p 2 coords</code> This is how DWAINE communicates with the telepad and sets the coords, if your terminal is registering your commands but nothing happens, try removing the -p 2 part. Or if your telepad starts acting up, change telescience's computer to pad 2 with a screwdriver on the terminal and change the setting inside.
<code>$arg0 $arg1 $arg2</code> Now here is where DWAINE gets weird. <code>$arg</code> has 2 functions, and the second one is more annoying than useful.
<code>$arg</code> lets you make a script so if you enter the file, say in the case you run "send 21 50 3" the <code>$arg0 $arg1 $arg2</code> would be replace with 21 50 and 3 respectively!
'''IMPORTANT:''' if you have put numbers into the terminal, for example you added scan script, then ran "scan 50 50 1", now when you try to add the send script, instead of recording <code>$arg0 $arg1 $arg2</code> it will record <code>50 50 $arg2</code>. I believe the final arg doesn't get called because it has <code>|n</code> directly afterward.
<code>|n</code> this is what tells the script to make a new line, separating the first and second as two commands to be run one after another, this can be done as many times as you want!


== Useful DWAINE info ==
 
After that is the <code>teleman -p 2 send</code> command which tells the telepad to send, duh haha. And finally, the <code>^ send</code> portion, which again is explained in [[DWAINE for Dummies]] but just in case you hate links, <code>echo ^ [name]</code> is the write function for DWAINE. echo is always needed to start, then after you put your stuff to save in, <code>^ [name]</code> is how you save it with the name being whatever you want to type in the terminal in order to run the script or open the file or whatever you made. If you're confused, please reference [[DWAINE for Dummies]], it's basic but it does help and this stuff is advanced and janky as all hell. Debugging will be required, good luck my fellow mechanics, and godspeed!!!


== Programs and scripts ==
== Programs and scripts ==
Line 13: Line 43:
I'd like to make a better tutorial/guide for using it here.
I'd like to make a better tutorial/guide for using it here.


=== Telescience for people who love typing ===
=== Super user access ===
Run this somewhere. Requires <code>/mnt/term</code> to exist.


You'll need <code>su</code> access (though ''that's'' easy). The first thing you should (probably) do is copy <code>teleman</code> out of the <code>/sys/srv</code> folder into one you make yourself. Then run these wherever you copied it:
<pre>echo registered=A|nassignment=A|naccess=34 ^ /mnt/term/loginpacket
su
file_send</pre>
 
 
=== Telescience ===
 
You'll need <code>su</code> access, but the first thing you should do is copy <code>teleman</code> out of the <code>/sys/srv</code> folder into one you make yourself. Then run these wherever you copied it:


<pre>echo #!|nteleman coords $arg0 $arg1 $arg2|nteleman scan ^ scan
<pre>echo #!|nteleman coords $arg0 $arg1 $arg2|nteleman scan ^ scan
Line 23: Line 61:
echo #!|nteleman relay $arg0 $arg1 $arg2 $arg3 $arg4 $arg5 ^ relay</pre>
echo #!|nteleman relay $arg0 $arg1 $arg2 $arg3 $arg4 $arg5 ^ relay</pre>


These will combine the "set coordinates" and "do a thing" commands into one, simplifying things a great deal. The copy of <code>teleman</code> also means you won't need su to access it again.
These will combine the "set coordinates" and "do a thing" commands into one, simplifying things a great deal. The copy you make of <code>teleman</code> also means you won't need su to access it again.


As an AI or Cyborg, terminal windows will stay with you and update, making it much more effective to use than trying to use the telescience computer itself, since the interface for that doesn't update if you aren't near it (and people can modify the numbers you input). As a human, if you can make a copy of this, you can use it anywhere a wireless computer can reach the mainframe! (Or if you're REALLY into it, PDA messages...)
As an AI or Cyborg, terminal windows will stay with you and update, making it much more effective to use than trying to use the telescience computer itself, since the interface for that doesn't update if you aren't near it (and people can modify the numbers you input). As a human, if you can make a copy of this, you can use it anywhere a wireless computer can reach the mainframe! (Or if you're REALLY into it, PDA messages...)


Right now there's some bug that causes this to result in a stack overflow after enough uses (and some other weird bugs) so you have to occasionally reset the terminal and reconnect.


=== Artifact research for people who hate typing ===


This will make a copy of the artlab utilities in the event some dummy breaks the tape drive or it goes offline or whatever, and provide a list of very handy shortcuts to make everything much easier.
=== Artifact Research ===


<pre>mkdir /artlab
This will make a copy of the artlab utilities in the event some dummy breaks the tape drive or it goes offline or whatever, and provide a list of very handy shortcuts to make everything much easier. You'll still have to <code>gptio poke</code> a few things but you usually only have to do that once.
cp /mnt/artlab/gptio /artlab
 
cd /artlab
<pre>mkdir /mir
cd /mir
cp /mnt/artlab/gptio .
echo #!|ngptio activate $arg0 ^ a
echo #!|ngptio activate $arg0 ^ a
echo #!|ngptio deactivate $arg0 ^ d
echo #!|ngptio deactivate $arg0 ^ d
Line 44: Line 84:
echo #!|ngptio poke impactpad stand 0 ^ lower
echo #!|ngptio poke impactpad stand 0 ^ lower
echo #!|ngptio poke xray radstrength $arg0 ^ radstrength
echo #!|ngptio poke xray radstrength $arg0 ^ radstrength
echo #!|ngptio poke elecbox wattage $arg0|ngptio poke elecbox voltage $arg1 ^ elec
echo #!|ngptio poke pitcher power $arg0 ^ power
</pre>
</pre>


Now just use <code>a heater</code> to start something up, <code>d heater</code> to turn it off, <code>r xray</code> to automatically sense shit and print it out.
This creates a bunch of shortcuts in the current directory that let you use the Artlab equipment ''much'' faster:
* '''a (device)''': Activates a device.
* '''d (device)''': Deactivates a device.
* '''r (device)''': Reads and displays results.
* '''i (device)''': Gets information.
* '''hot''': Sets the heater's temperature target to the highest setting.
* '''cold''': Sets the heater's temperature target to the lowest setting.
* '''raise''': Raises the impact pad's stand.
* '''lower''': Lowers the impact pad's stand.
* '''radstrength (number)''': Sets the X-Ray's radiation strength.
* '''elec (wattage) (voltage)''': Sets the elecbox's wattage/voltage.
* '''power (power) ''': Sets the pitcher power


<s>Hell, get creative and do <code>a x_ray ^ /mnt/lp-whatever/butt</code> to automatically print out info! ''wow''</s> this didn't seem to work, have to try again later


'''Bonus''': You don't need to type the underscores in device names. <code>impactpad</code> works for <code>impact_pad</code>, <code>xray</code> works for <code>x_ray</code>, etc.
You also don't need to type the underscores in device names. <code>impactpad</code> works for <code>impact_pad</code>, <code>xray</code> works for <code>x_ray</code>, etc.


=== Fixing the mainframe ===


=== Oops the mainframe died, now what ===
When the mainframe is restored (e.g. from a temporary power outage/APC issue), <code>gptio</code> will helpfully forget all of the device names -- they'll all show up as <code>UNKNOWN</code>, so you can't refer to them by name.
 
When the mainframe is restored (e.g. from a temporary power outage/APC tomfoolery), <code>gptio</code> will helpfully forget all of the device names -- they'll all show up as <code>UNKNOWN</code>, so you can't refer to them by name.


To get their names back, use <code>gptio info <i>address</i></code>, which will update its name and allow you to use it as a shortcut again.
To get their names back, use <code>gptio info <i>address</i></code>, which will update its name and allow you to use it as a shortcut again.
Line 62: Line 113:




=== The goddamn [[Research Director|RD]] deleted prman ===
=== Files not found ===
 
If you're missing some files you expected to be there, there's a backup ThinkTape in the RD's office you can insert into the databank. It contains a copy of everything in <code>/mnt/control</code>, and when inserted into the RD's databank will show up at <code>/mnt/rd</code>.
There's a backup ThinkTape in the RD's office you can insert into the databank. It contains a copy of everything in <code>/mnt/control</code>, and when inserted into the RD's databank will show up at <code>/mnt/rd</code>. Be sure to let your local RD know that he is very mean.


You can then copy them back to where they're supposed to be (or other places, if you want).


=== Scanning paper and other junk ===


Put piece of paper or other doodad onto a scanner. Go to your local DWAINE terminal and look for <code>/mnt/sc-<i>location</i></code>. Run <code>cat /mnt/sc-<i>location</i>/document</code> to take a look at it (or copy it or whatever). Note that half-broken HTML and other garbage comes along for the ride. Welp!
=== Scanning documents ===
You can scan paper and some other stuff by placing it on one of the scanners. Once it beeps, go to your local DWAINE terminal and look for <code>/mnt/sc-<i>location</i></code>. The scanned document will be at <code>/mnt/sc-<i>location</i>/document</code>. Note that the formatting on scanned documents may be garbled or completely messed up.

Latest revision as of 22:06, 24 February 2022

This is a work-in-progress guide on using DWAINE more better. Or something. I guess.

I wanted to put fun programs and programming techniques here but it turns out DWAINE is actually really awful and all the basic stuff breaks the moment you try to do anything fun with it.


DWAINE usage

Script breakdown

Contributed by: Lrwhittaker48

Here I will break down how the scripts listed below actually function, this way you can debug them and learn your own! For this example, we will be using the Telescience send script


echo #!|nteleman -p 2 coords $arg0 $arg1 $arg2|nteleman -p 2 send ^ send

To start, the way we write scripts with DWAINE is the echo [script] ^ [filename] function, this is explained in DWAINE for Dummies so I will skip it here.


#!|n This lets DWAINE know that its a script, needed to start all scripts.


Teleman -p 2 coords This is how DWAINE communicates with the telepad and sets the coords, if your terminal is registering your commands but nothing happens, try removing the -p 2 part. Or if your telepad starts acting up, change telescience's computer to pad 2 with a screwdriver on the terminal and change the setting inside.


$arg0 $arg1 $arg2 Now here is where DWAINE gets weird. $arg has 2 functions, and the second one is more annoying than useful.

$arg lets you make a script so if you enter the file, say in the case you run "send 21 50 3" the $arg0 $arg1 $arg2 would be replace with 21 50 and 3 respectively!

IMPORTANT: if you have put numbers into the terminal, for example you added scan script, then ran "scan 50 50 1", now when you try to add the send script, instead of recording $arg0 $arg1 $arg2 it will record 50 50 $arg2. I believe the final arg doesn't get called because it has |n directly afterward.


|n this is what tells the script to make a new line, separating the first and second as two commands to be run one after another, this can be done as many times as you want!


After that is the teleman -p 2 send command which tells the telepad to send, duh haha. And finally, the ^ send portion, which again is explained in DWAINE for Dummies but just in case you hate links, echo ^ [name] is the write function for DWAINE. echo is always needed to start, then after you put your stuff to save in, ^ [name] is how you save it with the name being whatever you want to type in the terminal in order to run the script or open the file or whatever you made. If you're confused, please reference DWAINE for Dummies, it's basic but it does help and this stuff is advanced and janky as all hell. Debugging will be required, good luck my fellow mechanics, and godspeed!!!

Programs and scripts

Advanced tips and tricks

DWAINE for Dummies is pretty basic and there's a lot of weird shit you can do with the terminals and mainframe beyond what it explains (it also seems to be pretty out of date).

I'd like to make a better tutorial/guide for using it here.

Super user access

Run this somewhere. Requires /mnt/term to exist.

echo registered=A|nassignment=A|naccess=34 ^ /mnt/term/loginpacket
su
file_send


Telescience

You'll need su access, but the first thing you should do is copy teleman out of the /sys/srv folder into one you make yourself. Then run these wherever you copied it:

echo #!|nteleman coords $arg0 $arg1 $arg2|nteleman scan ^ scan
echo #!|nteleman coords $arg0 $arg1 $arg2|nteleman receive ^ recv
echo #!|nteleman coords $arg0 $arg1 $arg2|nteleman send ^ send
echo #!|nteleman coords $arg0 $arg1 $arg2|nteleman portal ^ portal
echo #!|nteleman relay $arg0 $arg1 $arg2 $arg3 $arg4 $arg5 ^ relay

These will combine the "set coordinates" and "do a thing" commands into one, simplifying things a great deal. The copy you make of teleman also means you won't need su to access it again.

As an AI or Cyborg, terminal windows will stay with you and update, making it much more effective to use than trying to use the telescience computer itself, since the interface for that doesn't update if you aren't near it (and people can modify the numbers you input). As a human, if you can make a copy of this, you can use it anywhere a wireless computer can reach the mainframe! (Or if you're REALLY into it, PDA messages...)

Right now there's some bug that causes this to result in a stack overflow after enough uses (and some other weird bugs) so you have to occasionally reset the terminal and reconnect.


Artifact Research

This will make a copy of the artlab utilities in the event some dummy breaks the tape drive or it goes offline or whatever, and provide a list of very handy shortcuts to make everything much easier. You'll still have to gptio poke a few things but you usually only have to do that once.

mkdir /mir
cd /mir
cp /mnt/artlab/gptio .
echo #!|ngptio activate $arg0 ^ a
echo #!|ngptio deactivate $arg0 ^ d
echo #!|ngptio sense $arg0|ngptio read $arg0 ^ r
echo #!|ngptio info $arg0 ^ i
echo #!|ngptio poke heater temptarget 200 ^ cold
echo #!|ngptio poke heater temptarget 400 ^ hot
echo #!|ngptio poke impactpad stand 1 ^ raise
echo #!|ngptio poke impactpad stand 0 ^ lower
echo #!|ngptio poke xray radstrength $arg0 ^ radstrength
echo #!|ngptio poke elecbox wattage $arg0|ngptio poke elecbox voltage $arg1 ^ elec
echo #!|ngptio poke pitcher power $arg0 ^ power

This creates a bunch of shortcuts in the current directory that let you use the Artlab equipment much faster:

  • a (device): Activates a device.
  • d (device): Deactivates a device.
  • r (device): Reads and displays results.
  • i (device): Gets information.
  • hot: Sets the heater's temperature target to the highest setting.
  • cold: Sets the heater's temperature target to the lowest setting.
  • raise: Raises the impact pad's stand.
  • lower: Lowers the impact pad's stand.
  • radstrength (number): Sets the X-Ray's radiation strength.
  • elec (wattage) (voltage): Sets the elecbox's wattage/voltage.
  • power (power) : Sets the pitcher power


You also don't need to type the underscores in device names. impactpad works for impact_pad, xray works for x_ray, etc.

Fixing the mainframe

When the mainframe is restored (e.g. from a temporary power outage/APC issue), gptio will helpfully forget all of the device names -- they'll all show up as UNKNOWN, so you can't refer to them by name.

To get their names back, use gptio info address, which will update its name and allow you to use it as a shortcut again.

If someone REALLY fucked it up and removed the memory core (only doable when it's unpowered), you'll have to get a replacement from Hemera or maybe the Lava Moon. Good luck!


Files not found

If you're missing some files you expected to be there, there's a backup ThinkTape in the RD's office you can insert into the databank. It contains a copy of everything in /mnt/control, and when inserted into the RD's databank will show up at /mnt/rd.

You can then copy them back to where they're supposed to be (or other places, if you want).


Scanning documents

You can scan paper and some other stuff by placing it on one of the scanners. Once it beeps, go to your local DWAINE terminal and look for /mnt/sc-location. The scanned document will be at /mnt/sc-location/document. Note that the formatting on scanned documents may be garbled or completely messed up.