Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 33

Thread: extraction.ash - Automated Gene Extraction

  1. #1
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default extraction.ash - Automated Gene Extraction

    WARNING: Only some initial testing has been done.

    So, because I'm a giant nerd, I thought it'd be fun to write some code to automagically handle the Gene splicing kit. Attached are the post-adventure potion creation & hybridization code, and a Custom Combat Script. If you take a look at extraction.ash, you can set up the recommended aliases.

    I've created a new file called extractCCS.ash. This will handle the use of the DNA syringe. Just add consult extractCCS.ash to your custom combat script for all your auto-extraction needs.

    Install with svn checkout svn checkout https://svn.code.sf.net/p/digitrev/code/extraction

    Also hopefully getting included in the Script Manager.

    Questions? Comments? Concerns?


    r2 - Moved everything to sourceforge
    0.7 - Moved everything over to svn.
    0.6 - Fixed extraction.ash to verify if there actually is DNA in the syringe before doing anything. Also re-included import <zlib.ash> so that list_contains can be accessed.
    0.5.1 - Put back in zlib.ash to fix a stupid error.
    0.5 - Removed dependencies on SS, WHAM, and BB.
    0.4 - Added extractCCS.ash.
    0.3 - Changed some old code that was allowing the DNA syringe to be used even when it already had the phlyum DNA of the monster you're facing.
    0.2 - I seem to have it working. Took away the .patch files, since those seemed extraneous.
    0.121 - Removed an extraneous line of code from SmartStasis.ash.
    0.12 - Removed '_' from '_dnaSyringe' to account for r13916.
    0.11 - Fixing some really egregious errors in extraction.ash. It should now be able to handle spaces after the comma.
    0.1 - Initial version
    Last edited by digitrev; 11-28-2015 at 12:31 AM.

  2. #2
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default

    Setup

    First off, install the code. Both files go in the scripts/ folder. Then, you'll want to setup these aliases:
    Code:
    alias extract_gene => ashq if ($string[%%].length() != 0) {if ($string[%%] == "none") {set_property("autoExtractGene", "");} else {set_property("autoExtractGene",$string[%%]);}} else {print(get_property("autoExtractGene"));}
    alias extract_hybrid => ashq if ($string[%%].length() != 0) {if ($string[%%] == "none"){set_property("autoExtractHybrid", "");} else {set_property("autoExtractHybrid",$string[%%]);}} else {print(get_property("autoExtractHybrid"));}
    Then do set afterAdventureScript=extraction.ash.

    You'll want to make sure that extractCCS.ash is consulted during your combat script, preferably before you kill the monster.

    Usage

    Here's how it works. Once the autoExtractGene or autoExtractHybrid properties have been set, SmartStasis will compare them with the phylum of the monster you're fighting, and if you have a DNA extraction syringe, it will use it during the combat. Then, after combat ends, extraction.ash will create the appropriate potions and then hybridize yourself if you've asked for it. It will then remove any copies of that phylum from both lists.

    If you want to automatically hybridize yourself with the first weird phylum you come across, you type extract_hybrid weird. Or if you want to automatically create a Gene Tonic: Goblin from the first goblin you see, type extract_gene goblin.

    But that's not all. Let's say you want to extract 2 orc tonics and 1 hobo tonic. Just type extract_gene orc, orc, hobo, and if you find a hobo, it will create on potion, followed by 2 potions if you run across an orc. The same applies for extract_hybrid. You can pass along a comma separated list and it will hybridize the first thing it sees.


    Some caveats

    If you pass along more than one phylum to extract_hybrid, it will only remove one phylum upon hybridization, and so it will try to hybridize the next day with the remaining phylum. I might try to set up some sort of priority system in the future (where you can tell it you're happy with any of phyla x, y, and z, but if you get x then remove y & z, or if you get y then remove z), but for now, be wary.

    Similarly, if you tell it to create more than 3 gene tonics, it will save the rest for the next day.
    Last edited by digitrev; 09-03-2014 at 11:22 AM.

  3. #3
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default

    Right, so I'm having some trouble getting SmartStasis.ash to properly use the syringe. I hope to have a fix by the end of the day, but I'll be damned if I can figure out why it won't work.

  4. #4
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default

    Right, so I'm having some Is SmartStasis.ash to properly use the syringe. I hope to have a fix by the end of the day, but I'll be damned if I can figure out why it won't work.
    Originally Posted by digitrev View Post
    Is the syringe in batfactors? If it isn't batbrain won't do anything.

  5. #5
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default

    It is now. I ran out of adventures after giving up on this for a while, so I'll try and test it properly tomorrow.

  6. #6
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,225

    Default

    It is now. I ran out of adventures after giving up on this for a while, so I'll try and test it properly tomorrow.
    Originally Posted by digitrev View Post
    [sarcasm] Thank you so much for fucking me up! [/sarcasm]

    What you did was to tell BatBrain that the DNA extraction syringe is the world's best stasis item. You needed to add the keyword "custom" to let BatBrain know not to use it without specific instructions. (The keyword "once" would also have been appropriate.) The syringe even staggers the enemy so they cannot attack while you stasis them. An item like that would be amazingly awesome if it really existed. I fixed it so that it won't cause trouble for anyone else.

    Fortunately I wasn't hurt too bad by losing my previous DNA sample so I don't hate you for it, but you need to pay attention when you add an item to batfactors without any cost.
    Last edited by Bale; 04-06-2014 at 06:53 AM.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  7. #7
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default

    [sarcasm] Thank you so much for fucking me up! [/sarcasm]

    What you did was to tell BatBrain that the DNA extraction syringe is the world's best stasis item. You needed to add the keyword "custom" to let BatBrain know not to use it without specific instructions. (The keyword "once" would also have been appropriate.) The syringe even staggers the enemy so they cannot attack while you stasis them. An item like that would be amazingly awesome if it really existed. I fixed it so that it won't cause trouble for anyone else.

    Fortunately I wasn't hurt too bad by losing my previous DNA sample so I don't hate you for it, but you need to pay attention when you add an item to batfactors without any cost.
    Originally Posted by Bale View Post
    Oh, jeez, I'm sorry. I will make sure to test things before I do that in the future. My mistake.

  8. #8

    Default

    Hey, this sounds cool but i can't get it to work. The post adventure script works- if I manually use a syringe on a monster... How do I make batbrain allow use of the syringe?

  9. #9
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default

    Yeah, I haven't got around to doing anything with this. I might have time this weekend to play around with BatBrain to see if I can automate the extraction.

  10. #10
    Senior Member
    Join Date
    Dec 2013
    Posts
    362

    Default

    Right, so I've made the last change that I needed to make (I think), and now it should work properly. For what it's worth, you also have to add a line to batfactors.txt, but until someone gives me the go ahead, I won't be pushing this to the map manager yet.
    Code:
    item	7383	DNA extraction syringe	0	0	stun 1, once, custom

Similar Threads

  1. Replies: 0
    Last Post: 09-07-2015, 07:13 PM
  2. Replies: 0
    Last Post: 02-26-2015, 04:38 AM
  3. Replies: 0
    Last Post: 02-23-2015, 08:40 AM
  4. Automated Gene Extraction
    By digitrev in forum Scripting Discussion
    Replies: 1
    Last Post: 04-04-2014, 12:57 PM
  5. Message Extraction
    By holatuwol in forum Scripting Discussion
    Replies: 1
    Last Post: 10-08-2006, 04:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •