One-Click Wossname -- automatic level 12 quest completion

zarqon

Well-known member
[size=+1]One-Click Wossname 1.9[/size]

What does it do?
One-Click Wossname (OCW) is designed to complete the entire island war for you automatically. It gets outfits, starts the war, battles for you on both sides, and completes sidequests if so directed. Using Mafia's built-in properties, it tracks your progress on the battlefield and sidequests, so you can run it anytime with no risk of ruining your kill count. OCW uses an external text file ("war plan") to determine the order in which to do everything, so you can rewrite the plan if you prefer a different order.

Whenever you run the script it continues where you left off, even if you've already started the war. When you finish on the battlefield, OCW turns in your battlefield items to the appropriate camps for dimes and quarters, optionally turns all the coins in for meat (default), and then does the Last Stand for you, getting your Wossname. OCW also manages the final battle for non-Wossname plans.

Details
  • OCW comes with eighteen war plans to choose from -- four different Wossname plans, and a plan for each of the other IsleWar rewards. Specify the plan for your character by adjusting the ocw_warplan setting.
  • OCW will use the specified familiars, outfits, and moods for each sidequest. Like the warplan setting, these are script settings which you can view/edit by typing "zlib vars" in the CLI after you've briefly run the script once to initialize the values. Variables beginning with "ocw_o_" are for outfits, "ocw_f_" for familiars, and "ocw_m_" for moods. In the case of familiars, these can be set to actual familiar names, or to a familiar type recognized by ZLib's best_fam() function (e.g. "items"). If you lack the specified familiar or it is left blank, ocw_f_default will be used. In Boriscore, OCW will use Clancy's lute for the Orchard and any other sidequests you have set to "items"; otherwise, it will prefer Clancy's crumhorn. OCW also uses your "defaultoutfit" setting for adventuring on the battlefield.
  • OCW intelligently uses various and sundry items to expedite the sidequests.
  • Farm sidequest: uses the "chaos butterfly" shortcut to reduce total number of ducks.
  • Arena sidequest: flyers Cyrus the Virus, flyers the Guy Made of Bees, or flyers in the Hole in the Sky, depending on which is estimated to add fewer adventures to your run. Some additions to your custom combat script required.*
  • Gremlins sidequest: Attempts to maintain restorative effects by using items. Gremlin-stasising CCS required.*
  • Nuns sidequest: uses items to increase meat drop rate (if your 'ocw_nunspeed' setting is true... default is false).
  • Lighthouse sidequest: does a few things to maximize combat adventures before getting the barrels. If your CCS throws putty at the lobsterfrogmen, OCW has special handling to use your monster copies rather than continue adventuring.
  • OCW will turn in your battlefield items to the appropriate camp for dimes/quarters after fighting everyone.
  • If your 'ocw_change_to_meat' setting is true (default), OCW will then trade in your dimes/quarters for the item with a 1000 meat autosell value, and sell them.
  • OCW adds no properties to your mafia preferences file.
  • Encountering holiday monsters on the battlefield will not affect your kill count.
  • Canceling the script mid-combat will not affect your kill count.
  • What's more, it's OK to kill some soldiers or complete a sidequest outside of this script (but in mafia). Just be careful to stick with your plan if you decide to do some of it on your own, or you might screw yourself out of the Wossname if you kill too many soldiers or complete a sidequest too early.

WARNINGS!
  • All turns on the battlefield must be completed in Mafia, or Mafia's kill count will be off, causing OCW to behave wrongly.
  • Running this script without adding GMOB-flyering, HitS monster-flyering, or gremlin stasising to your CCS could result in your burning quite a lot of adventures!
  • Because OCW relies on properties KoLmafia saves to your settings file, changing your setting file or running the script on multiple computers can really mess you up. If you play on multiple machines, use Dropbox or a flash drive.

*Custom Combat Script changes
If you use SmartStasis or any of the combat scripts that rely on it, no further additions to your CCS are required. Otherwise, you will need something to handle flyering the GMOB/Cyrus/other monsters and using the magnet against gremlins (and optionally, something to throw meat vortices at brigands).

How to use it:
  • Make sure you have ZLib.
  • Unzip wossname.zip in your scripts directory.
  • Overwrite the old Wossname 1.9 with the new 1.9 attached below.
  • You will notice a preponderance of text files. All of these are the supplied warplans (not scripts), and should be moved to your data directory.
  • Change your custom combat script as indicated above.
  • If you have just downloaded this script for the first time, run it once, then abort it during version checking. This will initialize your script settings.
  • Adjust your script settings to your liking. Make sure all of the "ocw_..." settings, and the "defaultoutfit" setting, in your vars_myname.txt file are set the way you want them.
  • Optionally, load the script in a text editor and configure your battlefield item turnin stuff.
  • Run the script!

Special thanks to hippymon, Crowther, iniquitous, Miser, degrassi, Mighty Xerxes, EdFox, and Theraze for contributing various code and ideas to this script.

Changelog
[size=-2]12.22.07 - ver. 1.0.0 posted.
12.23.07 - 1.1.0 changes: integrated Miser's battlefield item turn-in. Also integrated hippymon's cli_execute() removals, and use can_interact() instead of in_hardcore().
12.27.07 - 1.1.1 changes: small change to the method of checking for a flaregun. Thus, also updated the conditions() method to the conditions(1 [, 2 [, 3]]) method discussed below, since that was already changed.
12.29.07 - 1.1.2 changes: small bugfixes: hopefully fixed the flaregun issue once and for all (thanks hippymon), and fixed a bug in the junkyard sidequest (thanks Relim).
1.04.08 - 1.1.3 changes: don't check got_item() for choiceadvs
1.07.08 - 1.1.4 changes: significant change to the method of checking/buying/adventuring for items. New function obtain() replaces the conditions() method.
1.17.08 - 1.2.0 changes: fixed a bug in obtain() where it called retrieve_item() for quest items. Added option to convert your coins to meat after turning in your battlefield items. Better postwar error checking. Added some code to improve flexibility for non-Wossname battle plans. Significant code optimization/rearrangement.
1.18.08 - 1.2.1 changes: check for flyers before adventuring at the bathroom. More print commands. More specific version number (retroactively edited changelog).
1.20.08 - 1.2.2 changes: removed getting daily rewards since mafia 12.0 now does that. Orchard sidequest now loops back if you got screwed by RNG swing. Reset IsleWar properties before starting the war in case of manual ascension.
1.21.08 - 1.2.3 changes: safety checking for picture 31 in case mafia's kill count gets off. Preliminary support for handling final combat and getting Wossname (tested OK). Fixed a typo causing an error after completing the plan.
1.26.08 - 1.2.4 changes: removed redundant safety checking added in 1.2.3. Added version check, so you always know if you're using the current version. Added the ability to specify different warplans for specific characters. Included fewyn's fratboy-only warplan.
1.30.08 - 1.2.5 changes: added initial support for per-step familiar selection.
2.03.08 - 1.3 changes: multifarious! Described here.
2.10.08 - Happy lunar new year from Korea! 1.3.1 changes: moved some things dealing with plan loading to allow for multiple-plans-per-war hacking. Fixed a situation where you would impossibly adventure for the basic frat outfit. Even better prewar checking. A couple more item optimizations. Better feedback if you run out of adventures after a battlefield noncombat. Fixed an out-of-adventures loop when hunting the GMOB.
2.12.08 - 1.3.2 changes: tweaked plan loading. Fixed incorrect filthworm code causing the glands to go unused.
2.20.08 - 1.3.3 changes: many. Gear up after using items to prevent adventuring in unwanted outfit. Check for effects before using items. Rewrite junkyard to use mafia properties and allow ccs. Re-simplify filthworms. obtain() will attempt to pull from storage. Add summon greed demon and winklered to nuns. Add deodorant to GMOB hunting. Return original outfit on script exit.
3.13.08 - 1.3.4 changes: Lockenstock™. Easier-to-understand graceful script exit. Customizable stasis item. Small change to pre-GMOB flyers check.
4.03.08 - 1.3.5 changes: OCW now handles the final combat for non-Wossname plans! Also: to_item("Lockenstock"). Fixed an abort issue with starting the war. Better pre-checking implementation.
4.21.08 - 1.3.6 changes: meat-vortexing the brigands is now automatic! Better postwar feedback in the event of the count being off.
5.12.08 - 1.4.0 changes: Introduced automatic familiar-selection framework. A third of the sidequests are now automatic. Nun sidequest: repaired estimated_adv() calculation (thanks plurialibus), better combat looping, print some useful statistics between combats. Changed "arena 2" to "concert 2".
9.29.08 - 1.4.1 changes: several contributions by other users: junkyard location fix by Rinn, effect check to prevent needless use of snowcones by dj_d, and warplans for all the other IsleWar rewards (!!!) by the_tom77 (in-game: The_Tom777).
12.13.08 - 1.4.2 changes: automatically update bestfamiliars.txt. Fix frat-5-beta warplan. Rearranged fastest.txt so the Arena happens before the Nuns (so OCW can get "Winklered" for the Nuns). A few little code tweaks here and there.
2.07.09 - 1.4.3 changes: remove auto-meat-vortexing. Call restore and between-battle scripts between scripted combats. Update thread URL for version checking.
4.26.09 - 1.5.0 changes: multifarious!
4.27.09 - 1.5.1 changes: fixed a longstanding typo causing OCW to affect combat frequency the wrong way when starting the war!
6.09.09 - 1.5.2 changes: added HitS option for arena quest, in addition to logic to select whether to use the GMoB method or the HitS method to complete the quest. Avoid borking on cli_execute() calls. A few tweaks to obtain(). Fixed broken hippy-0-balloon warplan.
6.14.09 - 1.5.3 changes: Moved out some functions -- now requires ZLib. Don't use deodorant/salt in an untimely fashion during McMillicancuddy sidequest.
7.25.09 - 1.5.4 changes: a few tweaks to HitS selection during arena quest. Major edits to be compatible with new ZLib -- uses script settings instead of variables. Completely refactor gearup_apropos() using the new system. Should be fewer error messages when gearing up now. Fixed longstanding bug with starting the war when doing hippy-only plans.
10.13.09 - 1.5.5 changes: small fix to gearup function; the is_100_run setting is now a familiar, not a boolean.
10.31.09 - 1.5.6 changes: Added preliminary, untested support for Cyrus option to flyers quest. Also get prerequisite hippy/frat outfits if auto-buying is disabled.
11.01.09 - 1.5.7 changes: try unlocking the Soup (still untested). Fix while loop for GMoB (thanks FN Ninja). Slightly more robust checking for flyers quest completion.
2.07.10 - 1.5.8 changes: convert all instances of error() to vprint(). Print which outfit you are equipping. Fixes for frat 5/6 warplans by EdFox.
4.14.12 - 1.6 changes: two years and 1,842 downloads later, an update! Support for various challenge paths, including Avatar of Boris. Added a Wossname warplan for Beecore from EdFox. Majorly reworked familiar determination and outfit farming. Change almost all print() and abort() commands to vprint(). Numerous other small tweaks, including many from Theraze.
7.15.13 - 1.7 changes: rework item turnin to take advantage of mafia's Coinmaster handling. Eliminate friendly warnings by using exact names. This will likely be the last update before 2.0.
7.26.13 - 1.8 changes: Fix buy/sell confusion in previous reworking. Use property to detect war starting. THIS will likely be the last fix before 2.0.
5.28.19 - 1.9 changes: Use ZLib's getvar() rather than directly read vars[]. Fix problem preventing script from validating. THIS will definitely be the last update before my much-improved script that starts with 'O' drops.[/size]
 

Attachments

  • wossname1.8.zip
    12.1 KB · Views: 1,468
  • Wossname.ash
    29.8 KB · Views: 288
Last edited:

fewyn

Administrator
Staff member
Re: One-Click Wossname 1.0 -- automatic level 12 quest completion

Now this is an awesome script, I'll try it out on my next run after Crimbo is over... or maybe I'll ascend one of my multis.
 

dangerpin

Member
Re: One-Click Wossname 1.0 -- automatic level 12 quest completion

I'm very excited by this script in a way that I haven't been by a script in a long time. Thank you for all your effort on it, I'll let you know how it goes.
 

hippymon

Member
Re: One-Click Wossname 1.0 -- automatic level 12 quest completion

Out of sheer boredom I change the scripting a bit.... Not real 'changes' to the functioning... Just got rid of most of the "cli_execute"... Also, I added "void conditions(int, string)" and "boolean advCheck()" function's that simplify a few things... And just for the hell of it posted the other files un-zipped.

EDIT: [size=18pt]The attached files are NOT up-to-date with the latest version.[/size]
 

Attachments

  • Wossname.ash
    18.9 KB · Views: 424
  • fastest.txt
    469 bytes · Views: 376
  • optimal.txt
    477 bytes · Views: 391
  • slowest.txt
    58 bytes · Views: 333

zarqon

Well-known member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

[size=+1]Additional Documentation[/size]

As OCW grows, I've decided to move some extra documentation and features here to the first page. Included here: 1) Item Optimizations, 2) Included warplans, and 3) Using OCW on Multiple Computers.

[size=+1]1. Item Optimizations[/size]

The following chart details the current item use, which I expect will be expanded by future suggestions. Be aware that if you don't have the item(s), OCW may attempt to buy them (if Will Buy is yes below).

The item use on the Nuns sidequest is mainly focused on increasing meat drop to shorten the quest. I know that some people (such as myself) prefer to use the brigands for meat farming using meat vortices and a coco-type familiar. So there's another variable nunspeed. OCW will only try to increase meat drops if nunspeed is true.

item / quantity / will buy

Farm
deodorant / 1 / yes

Lighthouse
reodorant / 2 / yes

Arena
deodorant / 2 / yes

Junkyard
purple snowcone OR purple-frosted astral cupcake / 1 / yes
orange candy heart / * / yes

Orchard
lavender candy heart / 2 / yes
blue-frosted astral cupcake / 1 / no
blue snowcone / 1 / no
Knob Goblin eyedrops / 2 / yes
pink candy heart / 1 / no

Nuns
meat vortex / 1/brigand / yes
red snowcone** / 1 / no
Mick's IcyVapoHotness inhaler** / *** / no
bag of Cheat-Os** / *** / no
Knob Goblin nasal spray** / *** / yes
pink candy hearts** / *** / yes
pink-frosted astral cupcakes** / *** / no

[size=-1]* OCW will attempt to maintain the "Heart of Orange" effect (if the snowcone/cupcake effect is not on).
** These +meat items will only be used if nunspeed is set to true. In addition, OCW will summon the greed demon if you know it, and get the "Winklered" buff if you previously completed the Arena as a fratboy.
*** OCW attempts to use enough of these items to last for the entire quest. It estimates that number based on your buffed meat-drop rate, which it re-evaluates after every item use attempt.[/size]

[size=+1]2. Included Warplans[/size]

optimal.txt
This warplan (the default) completes the Lighthouse, Nuns, and Farm sidequests as a frat boy, and the other three quests as a hippy, getting you the best rewards. You will spend a total of 464 adventures on the battlefield, in addition to completing 6/6 sidequests.

0: Hippy - kill 1 fratboy
1: Hippy - Orchard sidequest
2: Fratboy - kill 1 hippy
3: Fratboy - Lighthouse sidequest
4: Fratboy - kill 194 more hippies (97 adventures' worth)
5: Fratboy - Nuns sidequest
6: Fratboy - kill 268 more hippies (67 adv.)
7: Fratboy - Mcmillicancuddy's Farm sidequest
8: Hippy - kill 194 more fratboys (97 adv.)
9: Hippy - Junkyard sidequest
10: Hippy - kill 268 more fratboys (67 adv.)
11: Hippy - Arena sidequest
12: Hippy - kill remaining fratboys up to 999
13: Fratboy - kill remaining hippies up to 999

fastest.txt
This warplan completes the three sidequests on each side right away, to provide the fastest route to the Wossname. You will spend a total of 254 adventures on the battlefield, in addition to completing 6/6 sidequests.

0: Hippy - kill 1 fratboy
1: Hippy - Orchard sidequest
2: Hippy - kill 2 more fratboys (1 adv.)
3: Hippy - McMillicancuddy's Farm sidequest
4: Fratboy - kill 1 hippy
5: Fratboy - Lighthouse sidequest
6: Fratboy - kill 2 more hippies (1 adv.)
7: Fratboy - Arena sidequest
8: Hippy - kill 4 more fratboys (1 adv.)
9: Hippy - Nuns sidequest
10: Fratboy - kill 4 more hippies (1 adv.)
11: Fratboy - Junkyard sidequest
12: Hippy - kill remaining fratboys up to 999
13: Fratboy - kill remaining hippies up to 999

slowest.txt
Mostly included as an example, but you might want to use it if you want to farm the battlefield. You will spend a total of 1998 adventures on the battlefield, and complete 0/6 sidequests.

0: Hippy - kill 999 fratboys
1: Fratboy - kill 999 hippies

frat-4-gamma.txt
This warplan (originally courtesy of fewyn and included in the all-possible-rewards plans submitted by the_tom77) is the fastest warplan available for simply completing the IsleWar quest. It does not get the Wossname. You will spend a total of 67 adventures on the battlefield, in addition to completing 4/6 sidequests.

0: Fratboy - Arena sidequest
1: Fratboy - Lighthouse sidequest
2: Fratboy - Junkyard sidequest
3: Fratboy - kill 64 hippies (8 adv.)
4: Fratboy - Orchard sidequest
5: Fratboy - kill 936 more hippies (59 adv.)

frat-0-omega.txt
frat-1-zeta.txt
frat-2-epsilon.txt
frat-3-delta.txt
frat-5-beta.txt
frat-6-alpha.txt
hippy-0-balloon.txt
hippy-1-horseshoe.txt
hippy-2-diamond.txt
hippy-3-clover.txt
hippy-4-moon.txt
hippy-5-star.txt
hippy-6-heart.txt

The remaining warplans (courtesy of the_tom77) are named according to which side wins, how many sidequests are completed on that side, and the reward earned. Open them in a text editor if you want details.

[size=+1]3. Using OCW on multiple computers[/size]

Mafia on one computer can't read the properties file on the other computer, which means it will have no clue about your progress and you will almost certainly flub your Wossname attempt.

Short answer: Don't.

Long answer: Go portable (i.e. play from a flash drive) or use a cloud syncing service like Dropbox or Ubuntu One to sync your mafia installation across computers. As long as you're always playing mafia with the most recent properties file, you should be fine. I've been using Dropbox for a long time to play mafia using multiple computers with great success, even cross-platform.

If the long answer was too long for you, stick to the short answer.
 
Last edited:

macman104

Member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

Zargon, he does call it...
Code:
boolean orchard_sq() {
	visit_url("bigisland.php?place=orchard&action=stand&pwd=");
	if(!advCheck())
		return false;
, but that is the only spot. Also, for the conditions (which I do like), do you always want to clear the conditions before adding the next one? If not I might consider making functions like one of the two
Code:
void conditionAdd(int n, string conditionsString){
	cli_execute("conditions add " + n + " " + conditionsString);
}
void conditionAddWithClear(int n, string conditionsString){
	cli_execute("conditions clear");
	conditionAdd(n, conditionsString);
}
or
Code:
void conditionAdd(int n, string conditionsString, boolean clearConditions){
	if(clearConditions)
		cli_execute("conditions clear");
	cli_execute("conditions add " + n + " " + conditionsString);
}
I personally prefer the first way, as it separates the logic, but those were two thoughts I had. I'm going to look forward to exploring the use of this. I might have to figure out the surviving the battle aspects of it, or my ccs in order to use it. Otherwise, I may extract quest parts and use those. But that is my issue, not yours to worry about. Thanks!
 

zarqon

Well-known member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

[quote author=macman104 link=topic=1395.msg6417#msg6417 date=1198466304]
Zargon, he does call it...
Code:
boolean orchard_sq() {
	visit_url("bigisland.php?place=orchard&action=stand&pwd=");
	if(!advCheck())
		return false;
[/quote]

Oh... I guess that's the problem with working with two scripts with the same name in separate tabs. :) Ok, sorry hippymon -- I never called it. But, is there any reason for an additional drunkenness check before the orchard sidequest? Does visiting the fruit stand give you +drunkenness in some cases? Just want to make sure I didn't miss something.

Also, that's another good idea about the clear conditions being optional. At first I wasn't sure about hippymon's function always clearing conditions, but then I saw how it was used and it worked nicely. I think your function suggestions improve it still further.

EDIT: I was messing with it just now and came up with this... what do you think? It works because the script never uses more than three conditions, and with the have_outfit checks at least one of the items is guaranteed missing from the inventory, so no endless adventuring with no conditions.

Code:
void conditions(int n, string cond){
      cli_execute("conditions clear")
      if (!got_item(to_item(cond))) cli_execute("conditions add " + n + " " + cond);
}
void conditions(int n, string cond, int n2, string cond2){
      conditions(n, cond);
      if (!got_item(to_item(cond2))) cli_execute("conditions add " + n2 + " " + cond2);
}
void conditions(int n, string cond, int n2, string cond2, int n3, string cond3){
      conditions(n, cond, n2, cond2);
      if (!got_item(to_item(cond3))) cli_execute("conditions add " + n3 + " " + cond3);
}
 

hippymon

Member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

I put that in there then looked at the bottom and saw there was a check in the main()... Just never got rid of it. So there really is no reason for needing it...
 

macman104

Member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

[quote author=zarqon link=topic=1395.msg6418#msg6418 date=1198472914]I tend to prefer the second one because I tend to dislike repeated code, although in this case the first is more efficient. Anyway, I'll add this in to my next update when I also add something functionally different.[/quote]It isn't repeated code, because the function that clears the conditions simply clears and then calls the first function. It reuses code actually.
 

zarqon

Well-known member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

[quote author=macman104 link=topic=1395.msg6420#msg6420 date=1198473685]
It isn't repeated code...[/quote]
Yeah, my mistake again. I'm just happy that people are interested in the script so I'm reading edits and responding too quickly. What do you think of the conditions(1 [,2 [,3]]) idea?
 

macman104

Member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

I have to think about that, it seems like there has got to be a better, cleaner way of doing that...
 

Raven434

Member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

I started a run with it this afternoon.

So far I am VERY impressed.

/cheers

:)
 

Relim

New member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

huh... it won't load the battleplan for me at all. It says "Error loading battle plan." I've tried deleting it and downloading it again, but same problem. (Using daily build 5449, btw).
 

zarqon

Well-known member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

[quote author=Relim link=topic=1395.msg6443#msg6443 date=1198721914]huh... it won't load the battleplan for me at all.[/quote]

Did you extract the zip or download separate files? The zip creates a subdirectory called "warplans", which contains the battleplans. The script looks there to load the battleplan, so if you just have the plan in the same directory as the script, it will give you that error. You can either change the code (line 123 in ver. 1.1) or create the warplans directory yourself and put the plan there.

(That's why I posted the script in a zip file.)
 

Raven434

Member
Flare Gun Detection?

This one seems strange.

> call scripts\Wossname.ash

Checking for outfits...
Go get a flaregun (from the pirates) before continuing.

> inv flare

flaregun (38)

So yeah, I have a flare gun.

This is on a 'toon that hasn't started the war yet.
 

zarqon

Well-known member
Re: Flare Gun Detection?

[quote author=Raven434 link=topic=1395.msg6445#msg6445 date=1198734335]Checking for outfits...
Go get a flaregun (from the pirates) before continuing.

> inv flare

flaregun (38)

So yeah, I have a flare gun.[/quote]

Are you using the version posted by hippymon? The got_item() function was broken in that post. It's fixed in the latest release in the first post.
 

Relim

New member
Re: One-Click Wossname 1.1 -- automatic level 12 quest completion

Did you extract the zip or download separate files? The zip creates a subdirectory called "warplans", which contains the battleplans. The script looks there to load the battleplan, so if you just have the plan in the same directory as the script, it will give you that error. You can either change the code (line 123 in ver. 1.1) or create the warplans directory yourself and put the plan there.

(That's why I posted the script in a zip file.)

I did have it in the subfolder, I downloaded the ver. 1.1 zip file and extracted it into my scripts folder, so everything's in the right place and extracted... The warplans directory is there, it has optimal.txt in it, and optimal.txt has the warplan in it. I looked at the code myself, too, and I can't figure out why it's having problems. I think I might try putting optimal.txt directly in the same directory and changing line 123 to see if that helps.
 

Raven434

Member
Re: Flare Gun Detection?

[quote author=zarqon link=topic=1395.msg6446#msg6446 date=1198735001]


Are you using the version posted by hippymon? The got_item() function was broken in that post. It's fixed in the latest release in the first post.
[/quote]

/blush - I had to go start the war. LOL

I used the updated 1.1 version you posted.

Once I started the war, the script could be launched without any issues.
 

zarqon

Well-known member
Re: Flare Gun Detection?

[quote author=Relim link=topic=1395.msg6448#msg6448 date=1198736883]I did have it in the subfolder, I downloaded the ver. 1.1 zip file and extracted it into my scripts folder [...] I think I might try putting optimal.txt directly in the same directory and changing line 123 to see if that helps.[/quote]

Wow... that's weird. I wonder if they've made changes to map_to_file() since the 11.9 release? I've never done anything with daily builds so I don't know. Or perhaps it was a slash or eol issue...? Out of curiosity, is your system Linux or Mac? Let me know if putting it in the same directory fixes your problem.

[quote author=Raven434 link=topic=1395.msg6449#msg6449 date=1198736993]/blush - I had to go start the war.

Once I started the war, the script could be launched without any issues.[/quote]

But... the script should start the war for you, so there is a problem. You were getting hung up on the pre-war flaregun check? (The reason it checks before the war starts is because the pirates go away after you start the war.)

Does your got_item() function (line 134) look like this?
Code:
boolean got_item(item tolookup) {
   return (item_amount(tolookup) > 0 || have_equipped(tolookup));
}

And... has anyone else experienced this problem? Or does anyone see a problem with the above function?

For good measure, here's the code that checks for the flaregun:

Code:
   if (!got_item($item[flaregun])) 
      if (can_interact()) retrieve_item(1, $item[flaregun]);
         else abort("Go get a flaregun (from the pirates) before continuing.");
 

Raven434

Member
Re: Flare Gun Detection?

// assure possession of a flaregun
if (!got_item($item[flaregun])) if(can_interact()) retrieve_item(1, $item[flaregun]);
else die("Go get a flaregun (from the pirates) before continuing.");


I didn't change the formatting in the cut and paste.

I am going to clean out the ash and warplans and re-download them just to make sure.

I downloaded the 1.1 zip file again and it has hippy's code in it for the flaregun...
[quote author=zarqon link=topic=1395.msg6450#msg6450 date=1198738498]

Does your got_item() function (line 134) look like this?
Code:
boolean got_item(item tolookup) {
   return (item_amount(tolookup) > 0 || have_equipped(tolookup));
}

// returns true if you have the item
boolean got_item(item tolookup) {
return ((item_amount(tolookup) > 0) || (have_equipped(tolookup)));
}
 
Top