Difference between pages "Quest Tracking Preferences" and "SVN Primer"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Paladinwhite
 
imported>Bale
 
Line 1: Line 1:
 
{{TOCright}}
 
{{TOCright}}
KoLMafia internally tracks progress for a number of quests. These are stored as preferences in settings\[charactername]_prefs.
 
  
==Quests Granted by Familiars==
+
== Introduction ==
===questF01Primordial===
 
=unstarted
 
===questF02Hyboria===
 
=unstarted
 
===questF03Future===
 
=unstarted
 
===questF04Elves===
 
=unstarted
 
===questF05Clancy===
 
=unstarted
 
  
==Guild Quests==
+
Subversion (svn) is a centralized version control system. A repository (repo) exists online — this repo contains a scripting project. KoLmafia can download scripts from an online SVN repo and automatically install them for the user. It can even automatically update scripts to the latest version without any effort from the user.
===questG01Meatcar===
 
Possible values: unstarted, started
 
  
===questG02Whitecastle===
 
=unstarted
 
===questG03Ego===
 
=started
 
===questG04Nemesis===
 
=started
 
===questG05Dark===
 
=unstarted
 
===questG06Delivery===
 
=unstarted
 
  
==Quests Granted by Items==
+
== Non-Technical FAQ ==
===questI01Scapegoat===
+
'''Q. What is this "SVN" thinggy?'''<br />
=unstarted
+
A. It's a better way for users to install scripts.
===questI02Beat===
 
=unstarted
 
  
==Council Quests==
+
'''Q. What do I have to know about SVN to use this feature?'''<br />
===questL02Larva===
+
A. Absolutely nothing! There's a Script Manger under the Scripts menu. You can select scripts you want to install, right-click and select "install script." Then the magic happens. It's really simple.
questL02Larva tracks the player's progress in the {{kolwiki|Spooky_Forest_Quest|Spooky Forest quest}}.
+
:[[File:Script_Manager_Abridged.png]]
  
Possible values: unstarted, started, (maybe step1?), finished
+
'''Q. At the top of the page you said "automatically update scripts." None of my scripts have updated themselves so how does that work?'''<br />
 +
A. There's a preference you have to set to enable it which is off by default. Go to Preferences -> SVN -> Check "Update installed SVN projects on login." That will cause all your SVN installed scripts to be updated once a day.
 +
:[[File:Preferences_SVN.png]]
  
*unstarted: quest not yet received
+
'''Q. Why is SVN good for KoLmafia scripts?'''<br />
*started: quest received from the Council
+
A. There are a whole bunch of reasons. I'll enumerate:
*(step1?): (mosquito larva acquired?)
+
# It makes finding the script you want easy. Just read down the list checking the description for each.
*finished: mosquito larva returned to the Council
+
# It makes script installation easier. The user doesn't have to ensure that the script is downloaded into the correct directory or fret about putting multiple files into multiple directories.
 +
# It makes script updating easier. All scripts can be updated automatically at first run of the day, or the user can type <code> svn update </code> to manually update all scripts.
 +
# It is easier for the scripter to publish his scripts and keep them up to date.
 +
# When you recommend a script in chat, you can tell them its name in the Script Manager without their having to go download something from the KoLmafia forum.
  
===questL03Rat===
+
'''Q. Why was this added to mafia?'''<br />
questL03Rat tracks the player's progress in the {{kolwiki|Typical_Tavern_Quest|Typical Tavern quest}}.
+
A. We understand that a lot of people don't use scripts, even scripts that will help them a lot. This is because they find it troublesome to find and install scripts. The intention is to make it easy to install scripts. Even a script like Character Info Toolbox which contains more than 30 files is easy to install now. Just install it from Mafia's Script Manager and every single file will be placed in the correct directory. If you don't like it, you can use the Script Manager to delete it and all those files are removed.
  
Possible values: unstarted, started, stepX, finished
+
'''Q. Wait! Does this mean I don't have to find the correct thread on the KoLmafia forum and login there to install a script?'''<br />
 +
A. Yup. It's incomprehensible to most of us, but we've noticed that people hate reading our forum. Now you won't have to do that.
  
*unstarted: quest not yet received
+
'''Q. This sounds like black magic!'''<br />
*started: quest received from the Council
+
A. Please state your problem in the form of a question.<br />
*step1: spoke to Bart Ender in the Typical Tavern
+
Q. How does that work?<br />
 +
A. Black magic. Not really, but it is very impressive and you don't really need to know the mechanics. Just trust that it works.
  
===questL04Bat===
+
== Information for Scripters ==
questL04Bat tracks the player's progress in the {{kolwiki|Boss_Bat_Quest|Boss Bat quest}}.
+
The SVN repo contains your project. It not only contains the files for your project, but every previous version of those files that's ever existed. Think of old versions like hitting ctrl-z on a Word document — you can revert changes all the way back to the start, or anywhere in between.
  
Possible values: unstarted, started, step1-step3 (or step4?), finished
+
It is more than just a place to save files though. There is something called a Working Copy, which is a local version of a remote repository, plus any local changes you may have made. The process of creating this Working Copy is referred to as "checking out" the repo, or "checkout." You have probably also heard the term "commit" which is simply taking some/all local changes in a working copy and syncing them with the repo. Then other users sync their working copies with the repo, and voila!
  
*unstarted: quest not yet received
+
=== How to Set Up a Repo ===
*started: quest received from the Council
+
A working copy contains a hidden folder, .svn, that contains all of the metadata needed to know how your local version differs from the repository's version. This is created for you when you checkout the project. You don't really need to know any of these details, really, for the most part using svn does not require knowing how it works under the hood. What you may be interested in is how to create your own repo.
*step1-step3: demolished 1-3 walls in the Bat Hole
 
*(step4?): (Boss Bat defeated?)
 
*finished: quest completed
 
  
===questL05Goblin===
+
I'll go over the easiest method under Windows - using TortoiseSVN. Under *nix you should probably just be using the command line "svn" client, though I imagine there are a million different graphical alternatives. There are alternatives in windows as well, I just prefer TortoiseSVN for its file system integration.
questL05Goblin tracks the player's progress in the {{kolwiki|The_King_of_Cobb's_Knob_Quest|The King of Cobb's Knob quest}}.
 
  
Possible values: unstarted, started, step1, finished
+
First, get a [https://sourceforge.net/ sourceforge] account. Make a new project there. Download [http://tortoisesvn.net/downloads.html TortoiseSVN] and install it. Make a new folder somewhere on your computer. Right-click, and choose SVN Checkout... from the context menu. You will want to give it the address that you see on your new sourceforge project code page - for now just grab the http:// address, it's easier. Ignore the commands in front of the address and after it, those are for command-line svn tools.
  
*unstarted: quest not yet received
+
The rest of the default options are okay. Click OK and you should get a new working copy of your repo! Cool. Open it up and let's add some stuff. Add a new directory called scripts/, and within scripts/ put a new text file. Now navigate back up to the root of your working copy, right click on the folder, and choose SVN commit... Tick all the files/folders (tick the "show unversioned files" box if it's not ticked), give it a quick commit comment up top. You should have to enter your sourceforge user information, save it if you want. If you've done everything correctly, your new project should have been committed.
*started: quest received from the Council
 
*step1: Cobb's Knob map decrypted
 
*finished: Knob Goblin King defeated
 
  
===questL06Friar===
+
Optional: to really play around with this, checkout a second working copy somewhere in another folder on your computer. Try committing changes from one working copy to the repo, then doing right-click SVN Update on the other working copy. Notice how TortoiseSVN helpfully changes the little file/folder icons for you when you make modifications to things. Hopefully you're starting to see how this whole thing works.
=finished
 
===questL07Cyrptic===
 
questL07Cyrptic tracks the player's progress in the {{kolwiki|Undefile_the_Cyrpt_Quest|Undefile the Cyrpt quest}}.
 
  
Possible values: unstarted, started, stepX, finished
+
=== What it Can Do ===
 +
Svn is a very mature tool by now, so there's an absolute ton of stuff that I won't cover. You may for example notice that mafia itself has a "Latest SVN Changes" forum, which has .diffs of all the changes to files within mafia. There's also creating patches, merging repos, yada yada... Won't talk about it.
  
*unstarted: quest not yet received
+
I'm more interested in talking about how mafia svn integration works. Doing <code> svn checkout <repo> </code> creates a working copy of the repo in your svn/ folder. Then, mafia "pushes" the contents of that working copy to the appropriate subfolders. For example, if a repo has a scripts/dostuff.ash file, that file gets copied to your scripts/ folder.
*started: quest received from the Council
 
  
===questL08Trapper===
+
svn update goes through all your working copies and performs an update. There are other operations that can happen here. With a checkout, you can only be adding ("A") new files to a working copy. With an update you can update ("U"), merge ("G"), delete ("D") or also add ("A") files. Here, we warn the user whenever a file is added, due to security concerns. Note that "U"pdating '''only happens if the "pushed" local file still exists in the user's directory'''. I am bolding this because I'm sure it will confuse some people. This feature is a safeguard against svn re-installing scripts over and over that the user just wants to have deleted.
  
questL08Trapper tracks the player's progress in the {{kolwiki|Mt._McLargeHuge_Quest|Mt. McLargeHuge Quest}}.
+
If you installed TortoiseSVN above and browse to the svn/ folder, you may notice something: the working copies checked out with svn checkout are fully-featured working copies, just like you checked out using TortoiseSVN. This means that you can make changes directly to this folder and commit them to the repo using TortoiseSVN - if you have repo commit permissions, of course.
  
Possible values: unstarted, started, step1-step5, finished
+
=== Specifications ===
* unstarted: quest not yet received from the Council
+
At the base level of the SVN link there are only several legal folders which may contain scripts:
* started: quest received from the Council
+
* ccs/
* step1: cheese and ore requested by the Trapper
+
* data/
* step2: cheese and ore returned to the Trapper
+
* images/
* step3: discovered the stairs up to the Mist-Shrouded Peak (via either route)
+
* planting/
* step4: fought at least one yeti
+
* relay/
* step5: defeated the monster at the top of the Peak
+
* scripts/
* finished: returned the fur to the Trapper (quest complete)
+
Additionally there is only one legal file:
 +
* dependencies.txt
 +
If there are any other folders or files at the base level of the SVN repository, it will fail to be checked out by KoLmafia. This is a security feature. Within the stated folders you can nest any additional folders and files you desire.
  
===questL09Lol===
+
When the SVN repo is committed, the scripts in the folders will be pushed to local copies in corresponding folders in the KoLmafia directory. If there is a file of the same name in any of those folder, or a sub-folder of those folders, then the file will be copied to that location. This allows the user to move the files to new locations or sub-folders and still know that KoLmafia will keep it up to date.
=unstarted
 
===questL09Topping===
 
questL08Trapper tracks the player's progress in the {{kolwiki|Orc_Chasm_Quest|Orc Chasm Quest}}.
 
  
Possible values: unstarted, started, step1-step2, finished
+
The file <code>'''dependencies.txt'''</code> contains a list of other SVN repositories that this script will automatically install. This is done so that the script can install other scripts it depends on. If there is a <code>'''dependencies.txt'''</code> file at the root directory of the repo, it will not be pushed along with the files in the various folders. It only exists to serve this purpose. Each line in the file provides a url to another SVN project. Here is an example of what a dependencies.txt file may look like:
* unstarted: quest not yet received from the Council
+
<nowiki> https://svn.code.sf.net/p/zlib/code
* started: quest received from the Council
+
https://svn.code.sf.net/p/smartstasis/code
* step1: bridge built
+
https://svn.code.sf.net/p/therazekolmafia/canadv/code/</nowiki>
* step2: like, totally got the deets from the Highland Lord
 
* finished: quest complete
 
  
====booPeakProgress====
+
== How to Command SVN ==
booPeakProgress tracks the hauntedness level of {{kolwiki|A-boo Peak}}. A value of 18, for instance, indicates that A-boo Peak is 18% haunted.
+
KoLmafia has both ASH and CLI commands to interact with SVN repos.
 +
=== CLI Commands ===
 +
SVN Repositories can be checked out, updated or deleted from the CLI with the following commands:
 +
* <code>svn checkout <svnurl></code>
 +
: This checks out an svn repository and adds the files from the working copy to the appropriate locations. <svnurl> must be a <nowiki>svn://, http://, or https://</nowiki> link to a valid svn repo.
 +
* <code>svn list</code>
 +
: This lists installed projects.
 +
* <code>svn update </code>
 +
* <code>svn update <projectname></code>
 +
* <code>svn update <SVNURL></code>
 +
: This updates your installed projects and pushes any changes to the appropriate locations. If the parameter is blank it will update everything.
 +
* <code>svn delete <projectname></code>
 +
: This deletes an installed project and the corresponding files that it pushed. <projectname> fuzzy matches the script names from svn list.
 +
* <code>svn increment <projectname></code>
 +
* <code>svn decrement <projectname></code>
 +
: These two commands move an installed svn project up/down one revision, respectively.
 +
* <code>svn inc <projectname></code>
 +
* <code>svn dec <projectname></code>
 +
: The same as the previous two commands. Because typing stuff is hard.
 +
* <code>svn sync</code>
 +
: This looks through your working copies for modifications, then checks if that file differs from the local copy. If it differs, the working copy file is copied over the local copy one. Note that this is very different from "svn update" and does not contact the repository server at all.
  
Possible values: 0 - 100
+
=== ASH Commands ===
 +
There are a few additional functions that ASH possesses to check up on an SVN repo.
 +
* {{Flink|boolean|svn_exists|string|desc=Returns true if a valid working copy named projectname exists in the /svn folder.}}
 +
* {{Flink|boolean|svn_at_head|string|desc=Returns true if projectname exists, is a valid working copy, and is currently at the same revision number as the repository.}}
 +
* {{Flink|record|svn_info|string|desc=Returns a record containing additional information about the given projectname: svnurl, last author, last revision, last change date.}}
  
====chasmBridgeProgress====
+
== Revision Merging ==
chasmBridgeProgress tracks the player's progress in building a bridge across the {{kolwiki|Orc Chasm}}. A value of 10, for instance, indicates that the bridge is 10 planks long.
+
There is another even more impressive ability of the KoLmafia's svn update: Revision Merging! This is only helpful to people who know how to modify someone's script so if you cannot understand a single line of any script you might as well skip this part.  
  
Possible values: 0 - 30
+
The ''real'' awesome here is aimed at people who sometimes like to make small modifications to their scripts. People like you with a little bit of scripting ability. I suspect you've sometimes made a tiny tweak to a script to make it more perfect for your specific needs. Then the original author updates his script and you're stuck trying to decide if it is worth your trouble to copy all your modifications to the new version of his script. If not, you might just refuse to update it. With SVN if you know what you are doing, you can update your cake and eat it too! When svn updates your script it will automatically keep your modifications, producing a blend of your modifications and the author's update. Now I'll tell you how to do this.
====oilPeakProgress====
 
oilPeakProgress tracks the remaining pressure at {{kolwiki|Oil Peak}}. It decreases as the player reduces the pressure in the zone.
 
  
Possible values: 0.00 - 310.66
+
# Acquire the most recent version using <code> svn update </code>
* 310.66: Pressure not yet reduced
+
# Open the script's working copy in the project's /svn directory, and make your edits. Always make sure the project in /svn has your changes
* 0.00: Subquest completed
+
# Use the command <code> svn sync </code> to push your modifications in the working copy to the local copy in the /scripts or /relay directory
 +
# If you ever want to modify your changes or add to them, just repeat steps 2 and 3.
  
====twinPeakProgress====
+
That's it! Now you can update from svn as usual. You can use <code> svn update bale-ocd </code> to update just that script, or <code> svn update </code> to update all your scripts or just check the box in SVN preferences to make it happen automatically once a day. Whenever the script is updated SVN will magically merge your changes into the working copy in the /svn folder and then push those changes into the local copy. This is magic! This will happen every single time you use svn to update the script without requiring your intervention. The CLI will display a "G" for merGing the script instead of a "U" for Updating it when this happens.
twinPeakProgress is a nibble bitmask with least significant bit set for the first choice and the most significant for the fourth. You can parse this with bitwise operators. Here's some code that demonstrates how to use it.
 
  
<syntaxhighlight>
+
=== Revision Conflicts ===
void comma(buffer b, string s) {
+
If an update to a script changes it so severely that it cannot be merGed with your modifications, it will show "C" for Conflict and produce several files in the working copy to help you solve the problem:
if(length(b) > 0)
+
* myfile - will have some inline markup at the location of the conflict ( look for <<<<<< and >>>>> markup) showing you both what your text was and what the repo's text was.
b.append(", ");
+
* myfile.mine - Your version before the update.
b.append(s);
+
* myfile.rOld - The pristine repo versions from before the update.
}
+
* myfile.rNew - The pristine repo versions from after the update.
  
boolean mysterious(int progress, int c) {
+
With all of these files, you can pretty easily figure out where the problem line(s) are, and how to fix them. Sometimes you'll just want to use rNew and discard your local changes, sometimes you'll want to do something else. Copy/pasting between the different files is straightforward. You will need to delete the extra files when you're done resolving the conflict, and make sure that the remaining file has the same name as the original file.
return (progress & (1 << c)) == 0;
 
}
 
  
string twinPeak() {
 
int p = get_property("twinPeakProgress").to_int();
 
buffer need;
 
if(mysterious(p, 0)) need.comma("4 Stench Resistance");
 
if(mysterious(p, 1)) need.comma("+50% Item Drop");
 
if(mysterious(p, 2)) need.comma("Jar of Oil");
 
// Only check for final if first three complete
 
if(length(need) == 0) {
 
if(mysterious(p, 3))
 
return "Need +40% Initiative";
 
return "Twin Peak Completed";
 
}
 
return "Need " + need;
 
}
 
</syntaxhighlight>
 
  
===questL10Garbage===
+
[[Category:New User Help]][[Category:Scripting]][[Category:Tech Support]]
 
 
questL10Garbage tracks the player's progress in {{kolwiki|Giant_Trash_Quest|the Giant Trash Quest}}.
 
 
 
Possible values: unstarted, started, step1-step9, finished
 
* unstarted: quest not yet received from the Council
 
* started: quest received from the Council
 
* step2: giant beanstalk grown
 
* step3 - step6: four Immateria acquired
 
* step7: S.O.C.K. acquired ({{kolwiki|The_Castle_in_the_Clouds_in_the_Sky_(Basement)|Castle Basement}} open)
 
* step8: {{kolwiki|The_Castle_in_the_Clouds_in_the_Sky_(Basement)|Castle Ground Floor}} open
 
* step9: {{kolwiki|The_Castle_in_the_Clouds_in_the_Sky_(Basement)|Castle Top Floor}} open
 
* finished: quest complete
 
 
 
===questL11MacGuffin===
 
=finished
 
 
 
====questL11Black====
 
questL11Black tracks the player's progress in the {{kolwiki|Quest_for_the_Holy_MacGuffin|Black Market portion of the Holy MacGuffin quest}}.
 
 
 
Possible values: unstarted, started, step1-step3, finished
 
 
 
*unstarted: quest not yet received
 
*started:  quest received from the Council
 
*step1: spent at least one turn in the Black Forest
 
*step2: Black Market found
 
*step3: forged identification documents purchased
 
*finished: MacGuffin diary acquired
 
 
 
====questL11Manor====
 
questL11Manor tracks the player's progress in the {{kolwiki|Quest_for_the_Holy_MacGuffin#Spookyraven_quest_.28In_a_Manor_of_Spooking|Spookyraven Manor portion of the Holy Macguffin quest}}.
 
 
 
Possible values: unstarted, step1-step3, finished
 
 
 
*unstarted: quest not yet received
 
*started: quest received, by reading your father's MacGuffin diary
 
*step1: Spookyraven Manor Cellar opened
 
*step2: recipe: mortar-dissolving solution read
 
*step3: Suspicious Masonry demolished
 
*finished: Lord Spookyraven defeated
 
 
 
=====wineCellarProgress=====
 
=3
 
 
 
====questL11Desert====
 
Explore the Arid, Extra-Dry Desert to find the pyramid mentioned in your father's journal.
 
 
 
Possible values: unstarted, started, finished
 
 
 
*unstarted:
 
*started: quest started by reading your father's MacGuffin diary
 
*finished: discovered the Small Pyramid
 
 
 
====questL11Pyramid====
 
questL11Pyramid tracks the player's progress in the {{kolwiki|Quest_for_the_Holy_MacGuffin#A_Small_Pyramid|Pyramid portion of the Holy Macguffin quest}}.
 
 
 
Possible values: unstarted, started, step1-step3, finished
 
* unstarted: Pyramid not yet discovered
 
* started: Pyramid discovered
 
* step1: Middle Chamber opened
 
* step2: The Lower Chambers opened
 
* step3: Control Room opened
 
* finished: MacGuffin retrieved (quest complete)
 
 
 
=====gnasirProgress=====
 
gnasirProgress is a nibble bitmask with one bit for each possible way you can advance {{kolwiki|Quest_for_the_Holy_MacGuffin|Gnasir's quest}}. You can parse this with bitwise operators. Here's some code that demonstrates how to use it.
 
<syntaxhighlight>
 
int gnasirProgress = get_property("gnasirProgress").to_int();
 
buffer gnasir;
 
if((gnasirProgress & 1) == 0)
 
print("Gnasir wants a stone rose");
 
if((gnasirProgress & 2) == 0)
 
print("Gnasir wants a can of black paint");
 
if((gnasirProgress & 4) == 0)
 
print("Gnasir wants a killing jar");
 
if((gnasirProgress & 8) == 0)
 
print("Gnasir wants a 15 worm-riding manual page");
 
if((gnasirProgress & 16) == 0)
 
print("You need to use a drum machine to ride the worm");
 
</syntaxhighlight>
 
 
 
====questL11Ron====
 
Ron Copperhead
 
 
 
=====zeppelinProtestors=====
 
Tracks protesters removed
 
 
 
====questL11Shen====
 
Shen Copperhead
 
 
 
====questL11Palindome====
 
questL11Palindome tracks the player's progress in the {{kolwiki|Quest_for_the_Holy_MacGuffin#The_Palindome|Palindome portion of the Never Odd or Even quest}}.
 
 
 
Possible values: unstarted, started, step1-step5, finished
 
* unstarted:
 
* started: spent at least one turn Inside the Palindome
 
* step1: arranged the photos in Dr. Awkward's office
 
* step2: read 2 Love Me, Vol. 2
 
* step3: met Mr. Alarm in his office (received the wet stunt nut stew quest)
 
* step4: cooked wet stunt nut stew
 
* step5: returned the stew to Mr. Alarm
 
* finished: defeated Dr. Awkward
 
 
 
====questL11Worship====
 
hiddenApartmentProgress tracks progress through the {{kolwiki|Quest_for_the_Holy_MacGuffin#Hidden_Temple_quest_.28Gotta_Worship_Them_All.29|Hidden Temple portion of the Quest for the Holy MacGuffin}}.
 
 
 
Possible values: unstarted, started, step1-stepX, finished
 
 
 
*unstarted: quest not yet received
 
*started: quest received, by reading your father's MacGuffin diary
 
*step1: (Hidden Temple opened?)
 
*step2: (Nostril of the Serpent acquired?)
 
*step3: Hidden City uncovered
 
*step4: four stone spheres acquired
 
*finished: ancient amulet acquired from the Protector Spectre
 
 
 
=====questL11Business=====
 
=====questL11Curses=====
 
=====questL11Doctor=====
 
=====questL11Spare=====
 
 
 
 
 
=====hiddenApartmentProgress=====
 
hiddenApartmentProgress tracks progress through the {{kolwiki|Hidden Apartment Building}} during the Quest for the Holy MacGuffin.
 
 
 
Possible values: 0, 1, 6 - 8
 
* 0: Haven't opened the Hidden Apartment Building
 
* 1: Hidden Apartment Building is open for adventuring
 
* 6: Encountered the Protector Spirit
 
* 7: Found the stone sphere
 
* 8: Placed the stone sphere in the relevant overgrown shrine
 
 
 
=====hiddenBowlingAlleyProgress=====
 
hiddenBowlingAlleyProgress tracks progress through the {{kolwiki|Hidden Bowling Alley}} during the Quest for the Holy MacGuffin.
 
 
 
Possible values: 0, 1, 6 - 8
 
* 0: Haven't opened the Hidden Bowling Alley
 
* 1: Hidden Bowling Alley is open for adventuring
 
* 2-5: Number of times bowled is 1 less than hiddenBowlingAlleyProgress
 
* 6: Encountered the Protector Spirit
 
* 7: Found the stone sphere
 
* 8: Placed the stone sphere in the relevant overgrown shrine
 
 
 
=====hiddenHospitalProgress=====
 
hiddenHospitalProgress tracks progress through the {{kolwiki|Hidden Hospital}} during the Quest for the Holy MacGuffin.
 
 
 
Possible values: 0 - 8
 
* 0: Haven't opened the Hidden Hospital
 
* 1: Hidden Hospital is open for adventuring, but haven't bowled.
 
* 6: Encountered the Protector Spirit
 
* 7: Found the stone sphere
 
* 8: Placed the stone sphere in the relevant overgrown shrine
 
 
 
=====hiddenOfficeProgress=====
 
hiddenOfficeProgress tracks progress through the {{kolwiki|Hidden Office Building}} during the Quest for the Holy MacGuffin.
 
 
 
Possible values: 0, 1, 6 - 8
 
* 0: Haven't opened the Hidden Office Building
 
* 1: Hidden Office Building is open for adventuring
 
* 6: Encountered the Protector Spirit
 
* 7: Found the stone sphere
 
* 8: Placed the stone sphere in the relevant overgrown shrine
 
 
 
=====hiddenTavernUnlock=====
 
hiddenTavernUnlock tracks whether or not you have unlocked the {{kolwiki|Hidden Tavern}} during the Quest for the Holy MacGuffin.
 
 
 
Possible values: 0 - N
 
* When the value is equal to your number of ascensions, the Tavern is unlocked
 
* When the value is any other number, the Tavern is locked
 
 
 
===questL12War===
 
questL12War tracks progress during the {{kolwiki|Mysterious Island Quest}}.
 
 
 
Possible values: unstarted, started, step1, finished
 
* unstarted: quest not yet received from the Council
 
* started: quest received
 
* step1: War started
 
* finished: War ended; boss defeated (quest complete)
 
 
 
====warProgress====
 
Possible values for the progress of the {{kolwiki|Mysterious Island Quest|Isle War}}:
 
*unstarted: We can still visit the small version of the Mysterious Island
 
*started: The war is in progress
 
*finished: The final boss or bosses were defeated
 
 
 
====sideDefeated====
 
Which side of the {{kolwiki|Mysterious Island Quest|Isle War}} was defeated during the Level 12 quest.
 
 
 
Possible values:
 
*neither
 
*hippies
 
*fratboys
 
*both
 
 
 
===questL13Final===
 
Progress for the {{kolwiki|Naughty Sorceress Quest}}.
 
 
 
*unstarted - Lair is closed
 
*started - Contest booth is available
 
*step1 - Coronation ceremony
 
*step2 - Hedge maze
 
*step3 - Tower door
 
*step4 - Wall of skin
 
*step5 - Wall of meat
 
*step6 - Wall of bone
 
*step7 - Mirror
 
*step8 - Your Shadow
 
*step9 - Naughty Sorceress
 
*step10 - Prism awaits breaking
 
*finished - Gash is available
 
 
 
===questL13Warehouse===
 
the final quest if you ascend as {{kolwiki|Actually Ed the Undying}} where you adventure in {{kolwiki|The Secret Council Warehouse}}.
 
*unstarted
 
*started
 
*finished
 
Current progress in the warehouse is tracked in warehouseProgress.
 
 
 
==Miscellaneous Quests==
 
===questM01Untinker===
 
=finished
 
===questM02Artist===
 
=unstarted
 
===questM03Bugbear===
 
=unstarted
 
===questM04Galaktic===
 
=started
 
===questM05Toot===
 
=unstarted
 
===questM06Gourd===
 
=unstarted
 
===questM07Hammer===
 
=unstarted
 
===questM08Baker===
 
=unstarted
 
===questM09Rocks===
 
=unstarted
 
===questM10Azazel===
 
=finished
 
===questM11Postal===
 
=unstarted
 
===questM12Pirate===
 
questM12Pirate tracks the player's progress in the {{kolwiki|Cap'm Caronch Quest}}.
 
 
 
Possible values: unstarted, started, step1-step6, finished
 
 
 
*unstarted:
 
*started: Cap'm Caronch's Map found
 
*step1: acquired Cap'm Caronch's nasty booty from the booty crab
 
*step2: received the Orcish Frat House blueprints
 
*step3: retrieved Cap'm Caronch's dentures from the Frat House
 
*step4: returned the dentures to the Cap'm and accepted the beer pong challenge
 
*step5: won a game of beer pong
 
*step6: acquired pirate fledges
 
*finished: unlocked Belowdecks
 
 
 
===questM13Escape===
 
=unstarted
 
===questM14Bounty===
 
=unstarted
 
===questM15Lol===
 
=started
 
===questM16Temple===
 
Dakota Fanning's quest to find the Hidden Temple
 
 
 
===questM17Babies===
 
Lady Spookyraven's Babies
 
 
 
===questM18Swamp===
 
Marty and His Swamp Problems
 
 
 
===questM19Hippy===
 
Hippy Give a Hippy a Boat...
 
 
 
===questM20Necklace===
 
questM20Necklace tracks the player's progress in {{kolwiki|Spookyraven_Manor_Quest#Lady_Spookyraven.27s_Necklace_.28First_Floor.29|retrieving Lady Spookyraven's necklace}}.
 
 
 
Possible values: unstarted, started, step1-stepX, finished
 
* unstarted: quest not yet received
 
* started: quest received from the telegram
 
* step1: billiards room key found
 
* step2: pool skill increased at least once*
 
* step3: library key found
 
* step4: necklace found
 
* finished: necklace returned to Lady Spookyraven (quest complete)
 
 
 
<nowiki>*Needs spading.</nowiki>
 
 
 
===questM21Dance===
 
Lady Spookyraven's Dance
 
 
 
===questM22Shirt===
 
The Shirt Off His Lack of Back
 
 
 
===questM23Meatsmith===
 
Helping Make Ends Meat
 
* unstarted
 
* started
 
* step1 - Got a {{kolwiki|check to the Meatsmith}}.
 
* finished - Returned {{kolwiki|check to the Meatsmith}} to the Meatsmith.
 
 
 
===questM24Doc===
 
What's Up, Doc?
 
* unstarted
 
* started
 
* step1 - Collected the Herbs and need to return them to Doc Galaktik
 
* finished
 
 
 
==Sea Quests==
 
===questS01OldGuy===
 
=finished
 
===questS02Monkee===
 
=unstarted
 
 
 
When Mom is rescued the Quest is completed
 
 
 
=finished
 
 
 
====merkinQuestPath====
 
merkinQuestPath indicates which path the player has chosen in the {{kolwiki|Mer-Kin Deepcity}}, during the {{kolwiki|Sea Monkees Quest}}.
 
 
 
Possible values:
 
* none: Player has not yet chosen a path
 
* gladiator: Player will fight Yog-Urt, Elder Goddess of Hatred
 
* scholar: Player will fight Shub-Jigguwatt, Elder God of Violence
 
* done: Player has completed the Sea Monkees Quest
 
 
 
====skateParkStatus====
 
 
 
==Bug Bear Invasion Properties==
 
 
 
===mothershipProgress===
 
mothershipProgress tracks progress of level completion in the {{kolwiki|Bugbear Mothership}}. It goes from 0 to 3 as that level is cleared.
 
 
 
Possible values: 0-3
 
 
 
===statusEngineering===
 
===statusGalley===
 
===statusMedbay===
 
===statusMorgue===
 
===statusNavigation===
 
===statusScienceLab===
 
===statusSonar===
 
===statusSpecialOps===
 
===statusWasteProcessing===
 
All of these work the same way.
 
*0-x (integers): insufficient bodata collected)
 
*open: all biodata collected and zone accessible
 
* unlocked: biodata collected but zone not yet accessible
 
* cleared: zone has been cleared
 
 
 
==Quests from the Elemental Planes==
 
===Spring Break Beach===
 
The Elemental Plane of Sleaze
 
=====questESlMushStash=====
 
Jimmy's Quest to collect receipts from the Fun-Guy Mansion.
 
=====questESlAudit=====
 
Taco Dan's Quest to collect receipts from the Fun-Guy Mansion.
 
=====questESlBacteria=====
 
Broden's Quest to collect bacteria from the Fun-Guy Mansion.
 
=====questESlCheeseburger=====
 
Jimmy's Quest to collect ingredients from the Sloppy Seconds Diner.
 
=====questESlSprinkles=====
 
Taco Dan's Quest to collect ingredients from the Sloppy Seconds Diner.
 
=====questESlCocktail=====
 
Broden's Quest to collect sprinkles from the Sloppy Seconds Diner.
 
=====questESlSalt=====
 
Jimmy's Quest to collect salt from the Sunken Yacht.
 
=====questESlFish=====
 
Taco Dan's Quest to collect fish meat from the Sunken Yacht.
 
=====questESlDebt=====
 
Broden's Quest to collect broupons from the Sunken Yacht.
 
 
 
===Conspiracy Island===
 
The Elemental Plane of Spooky
 
=====questESpOutOfOrder=====
 
Deep Dark Jungle - Out of Order
 
=====questESpJunglePun=====
 
Deep Dark Jungle - Pungle in the Jungle
 
=====questESpSmokes=====
 
Deep Dark Jungle - Everyone's Running Out of Smokes
 
=====questESpClipper=====
 
Mansion of Dr. Weirdeaux - The Big Clipper
 
=====questESpSerum=====
 
Mansion of Dr. Weirdeaux - Serum Sortie
 
=====questESpEVE=====
 
Secret Government Laboratory - Choking on the Rind
 
=====questESpFakeMedium=====
 
Secret Government Laboratory - Fake Medium at Large
 
=====questESpGore=====
 
Secret Government Laboratory - Gore Tipper
 

Revision as of 21:35, 19 December 2016

Introduction

Subversion (svn) is a centralized version control system. A repository (repo) exists online — this repo contains a scripting project. KoLmafia can download scripts from an online SVN repo and automatically install them for the user. It can even automatically update scripts to the latest version without any effort from the user.


Non-Technical FAQ

Q. What is this "SVN" thinggy?
A. It's a better way for users to install scripts.

Q. What do I have to know about SVN to use this feature?
A. Absolutely nothing! There's a Script Manger under the Scripts menu. You can select scripts you want to install, right-click and select "install script." Then the magic happens. It's really simple.

Script Manager Abridged.png

Q. At the top of the page you said "automatically update scripts." None of my scripts have updated themselves so how does that work?
A. There's a preference you have to set to enable it which is off by default. Go to Preferences -> SVN -> Check "Update installed SVN projects on login." That will cause all your SVN installed scripts to be updated once a day.

Preferences SVN.png

Q. Why is SVN good for KoLmafia scripts?
A. There are a whole bunch of reasons. I'll enumerate:

  1. It makes finding the script you want easy. Just read down the list checking the description for each.
  2. It makes script installation easier. The user doesn't have to ensure that the script is downloaded into the correct directory or fret about putting multiple files into multiple directories.
  3. It makes script updating easier. All scripts can be updated automatically at first run of the day, or the user can type svn update to manually update all scripts.
  4. It is easier for the scripter to publish his scripts and keep them up to date.
  5. When you recommend a script in chat, you can tell them its name in the Script Manager without their having to go download something from the KoLmafia forum.

Q. Why was this added to mafia?
A. We understand that a lot of people don't use scripts, even scripts that will help them a lot. This is because they find it troublesome to find and install scripts. The intention is to make it easy to install scripts. Even a script like Character Info Toolbox which contains more than 30 files is easy to install now. Just install it from Mafia's Script Manager and every single file will be placed in the correct directory. If you don't like it, you can use the Script Manager to delete it and all those files are removed.

Q. Wait! Does this mean I don't have to find the correct thread on the KoLmafia forum and login there to install a script?
A. Yup. It's incomprehensible to most of us, but we've noticed that people hate reading our forum. Now you won't have to do that.

Q. This sounds like black magic!
A. Please state your problem in the form of a question.
Q. How does that work?
A. Black magic. Not really, but it is very impressive and you don't really need to know the mechanics. Just trust that it works.

Information for Scripters

The SVN repo contains your project. It not only contains the files for your project, but every previous version of those files that's ever existed. Think of old versions like hitting ctrl-z on a Word document — you can revert changes all the way back to the start, or anywhere in between.

It is more than just a place to save files though. There is something called a Working Copy, which is a local version of a remote repository, plus any local changes you may have made. The process of creating this Working Copy is referred to as "checking out" the repo, or "checkout." You have probably also heard the term "commit" which is simply taking some/all local changes in a working copy and syncing them with the repo. Then other users sync their working copies with the repo, and voila!

How to Set Up a Repo

A working copy contains a hidden folder, .svn, that contains all of the metadata needed to know how your local version differs from the repository's version. This is created for you when you checkout the project. You don't really need to know any of these details, really, for the most part using svn does not require knowing how it works under the hood. What you may be interested in is how to create your own repo.

I'll go over the easiest method under Windows - using TortoiseSVN. Under *nix you should probably just be using the command line "svn" client, though I imagine there are a million different graphical alternatives. There are alternatives in windows as well, I just prefer TortoiseSVN for its file system integration.

First, get a sourceforge account. Make a new project there. Download TortoiseSVN and install it. Make a new folder somewhere on your computer. Right-click, and choose SVN Checkout... from the context menu. You will want to give it the address that you see on your new sourceforge project code page - for now just grab the http:// address, it's easier. Ignore the commands in front of the address and after it, those are for command-line svn tools.

The rest of the default options are okay. Click OK and you should get a new working copy of your repo! Cool. Open it up and let's add some stuff. Add a new directory called scripts/, and within scripts/ put a new text file. Now navigate back up to the root of your working copy, right click on the folder, and choose SVN commit... Tick all the files/folders (tick the "show unversioned files" box if it's not ticked), give it a quick commit comment up top. You should have to enter your sourceforge user information, save it if you want. If you've done everything correctly, your new project should have been committed.

Optional: to really play around with this, checkout a second working copy somewhere in another folder on your computer. Try committing changes from one working copy to the repo, then doing right-click SVN Update on the other working copy. Notice how TortoiseSVN helpfully changes the little file/folder icons for you when you make modifications to things. Hopefully you're starting to see how this whole thing works.

What it Can Do

Svn is a very mature tool by now, so there's an absolute ton of stuff that I won't cover. You may for example notice that mafia itself has a "Latest SVN Changes" forum, which has .diffs of all the changes to files within mafia. There's also creating patches, merging repos, yada yada... Won't talk about it.

I'm more interested in talking about how mafia svn integration works. Doing svn checkout <repo> creates a working copy of the repo in your svn/ folder. Then, mafia "pushes" the contents of that working copy to the appropriate subfolders. For example, if a repo has a scripts/dostuff.ash file, that file gets copied to your scripts/ folder.

svn update goes through all your working copies and performs an update. There are other operations that can happen here. With a checkout, you can only be adding ("A") new files to a working copy. With an update you can update ("U"), merge ("G"), delete ("D") or also add ("A") files. Here, we warn the user whenever a file is added, due to security concerns. Note that "U"pdating only happens if the "pushed" local file still exists in the user's directory. I am bolding this because I'm sure it will confuse some people. This feature is a safeguard against svn re-installing scripts over and over that the user just wants to have deleted.

If you installed TortoiseSVN above and browse to the svn/ folder, you may notice something: the working copies checked out with svn checkout are fully-featured working copies, just like you checked out using TortoiseSVN. This means that you can make changes directly to this folder and commit them to the repo using TortoiseSVN - if you have repo commit permissions, of course.

Specifications

At the base level of the SVN link there are only several legal folders which may contain scripts:

  • ccs/
  • data/
  • images/
  • planting/
  • relay/
  • scripts/

Additionally there is only one legal file:

  • dependencies.txt

If there are any other folders or files at the base level of the SVN repository, it will fail to be checked out by KoLmafia. This is a security feature. Within the stated folders you can nest any additional folders and files you desire.

When the SVN repo is committed, the scripts in the folders will be pushed to local copies in corresponding folders in the KoLmafia directory. If there is a file of the same name in any of those folder, or a sub-folder of those folders, then the file will be copied to that location. This allows the user to move the files to new locations or sub-folders and still know that KoLmafia will keep it up to date.

The file dependencies.txt contains a list of other SVN repositories that this script will automatically install. This is done so that the script can install other scripts it depends on. If there is a dependencies.txt file at the root directory of the repo, it will not be pushed along with the files in the various folders. It only exists to serve this purpose. Each line in the file provides a url to another SVN project. Here is an example of what a dependencies.txt file may look like:

 https://svn.code.sf.net/p/zlib/code
 https://svn.code.sf.net/p/smartstasis/code
 https://svn.code.sf.net/p/therazekolmafia/canadv/code/

How to Command SVN

KoLmafia has both ASH and CLI commands to interact with SVN repos.

CLI Commands

SVN Repositories can be checked out, updated or deleted from the CLI with the following commands:

  • svn checkout <svnurl>
This checks out an svn repository and adds the files from the working copy to the appropriate locations. <svnurl> must be a svn://, http://, or https:// link to a valid svn repo.
  • svn list
This lists installed projects.
  • svn update
  • svn update <projectname>
  • svn update <SVNURL>
This updates your installed projects and pushes any changes to the appropriate locations. If the parameter is blank it will update everything.
  • svn delete <projectname>
This deletes an installed project and the corresponding files that it pushed. <projectname> fuzzy matches the script names from svn list.
  • svn increment <projectname>
  • svn decrement <projectname>
These two commands move an installed svn project up/down one revision, respectively.
  • svn inc <projectname>
  • svn dec <projectname>
The same as the previous two commands. Because typing stuff is hard.
  • svn sync
This looks through your working copies for modifications, then checks if that file differs from the local copy. If it differs, the working copy file is copied over the local copy one. Note that this is very different from "svn update" and does not contact the repository server at all.

ASH Commands

There are a few additional functions that ASH possesses to check up on an SVN repo.

  • boolean svn_exists( string )

    Returns true if a valid working copy named projectname exists in the /svn folder.
  • boolean svn_at_head( string )

    Returns true if projectname exists, is a valid working copy, and is currently at the same revision number as the repository.
  • record svn_info( string )

    Returns a record containing additional information about the given projectname: svnurl, last author, last revision, last change date.


Revision Merging

There is another even more impressive ability of the KoLmafia's svn update: Revision Merging! This is only helpful to people who know how to modify someone's script so if you cannot understand a single line of any script you might as well skip this part.

The real awesome here is aimed at people who sometimes like to make small modifications to their scripts. People like you with a little bit of scripting ability. I suspect you've sometimes made a tiny tweak to a script to make it more perfect for your specific needs. Then the original author updates his script and you're stuck trying to decide if it is worth your trouble to copy all your modifications to the new version of his script. If not, you might just refuse to update it. With SVN if you know what you are doing, you can update your cake and eat it too! When svn updates your script it will automatically keep your modifications, producing a blend of your modifications and the author's update. Now I'll tell you how to do this.

  1. Acquire the most recent version using svn update
  2. Open the script's working copy in the project's /svn directory, and make your edits. Always make sure the project in /svn has your changes
  3. Use the command svn sync to push your modifications in the working copy to the local copy in the /scripts or /relay directory
  4. If you ever want to modify your changes or add to them, just repeat steps 2 and 3.

That's it! Now you can update from svn as usual. You can use svn update bale-ocd to update just that script, or svn update to update all your scripts or just check the box in SVN preferences to make it happen automatically once a day. Whenever the script is updated SVN will magically merge your changes into the working copy in the /svn folder and then push those changes into the local copy. This is magic! This will happen every single time you use svn to update the script without requiring your intervention. The CLI will display a "G" for merGing the script instead of a "U" for Updating it when this happens.

Revision Conflicts

If an update to a script changes it so severely that it cannot be merGed with your modifications, it will show "C" for Conflict and produce several files in the working copy to help you solve the problem:

  • myfile - will have some inline markup at the location of the conflict ( look for <<<<<< and >>>>> markup) showing you both what your text was and what the repo's text was.
  • myfile.mine - Your version before the update.
  • myfile.rOld - The pristine repo versions from before the update.
  • myfile.rNew - The pristine repo versions from after the update.

With all of these files, you can pretty easily figure out where the problem line(s) are, and how to fix them. Sometimes you'll just want to use rNew and discard your local changes, sometimes you'll want to do something else. Copy/pasting between the different files is straightforward. You will need to delete the extra files when you're done resolving the conflict, and make sure that the remaining file has the same name as the original file.