macguffin.ash (a script in progress)

Leperconartist

New member
Good point, now that I think about it, it was kind of stupid to post it because I use the updated version. The original didn't work for me at all.
 

plurialibus

New member
Hrumm, hadn't checked on this thread in a while... just reached the macguffin quest again, and had some of the same problems you did, heh. It's funny, I think Mafia is aborting sometimes when I try adventuring with a goal for a set number of turns (I mean, in the desert, ultrahydrated)... I fixed some bugs, worked around Mafia's unexpected behaviour where I could, and messed a bit with the holy temple script (you can still use the old one if you want, I guess... not sure all of the changes are generic to all users (don't really remember what I changed, really)).

The "I love me, vol. I" abortion (["I Love Me] has no matches) probably has something to do with the quotes in the item name; I guess it's some internal bug in Mafia, because it makes absolutely no sense to me. If somebody wants to dig into the client's code to see if there's a way to go around it, I'd appreciate that, but I really don't think it's worth the trouble ;). The script resumes fine if you just restart it.

I'll do some more testing next time I'm able to run the script... 'till then, these files are all I can offer.

Might try to automate some of that pirate content too next time...


Cheers!


Oh, and I'm uploading all the files just to keep it neat for those who never downloaded them before. The only updated files were macguffin.ash and hidden city.ash.
 

Attachments

  • macguffin.ash
    29 KB · Views: 71
  • macguffin_status.ash
    4.5 KB · Views: 106
  • outfit_change.ash
    10.1 KB · Views: 66
  • custom_outfits.txt
    8.6 KB · Views: 122

plurialibus

New member
=( sorry guys, I let some old bugs slip through that last version... the script was still aborting when it ran out of hydration while adventuring with a goal (which basically means it aborted questing in the desert). It might still do so while looking for the carburetor; I'm not very sure of that part.

I also changed outfit_change.ash so that it accepts character-specific outfit specs. All you have to do is create a 'custom_outfits_<my character name>.txt' with the specific outfits for that character, and it'll use that. The script will still work with the original outfit file, as it defaults to it when it doesn't find a specific one.

Well, here are the updated files =P
 

Attachments

  • macguffin.ash
    29 KB · Views: 85
  • outfit_change.ash
    10.5 KB · Views: 62

plurialibus

New member
Grrr, I should test more thoroughly before I post new versions... outfit_change wasn't equiping offhand items if you couldn't dual wield =/. Sorry.
 

Attachments

  • outfit_change.ash
    10.4 KB · Views: 88

Leperconartist

New member
How do you type it out like that with all the black squares? Do you do it by hand? I know that you hold ctrl + backspace to make a blacksquare. But what I'm asking is whether you replace all the spaces with them by yourself or if you get a program to do it for you.
 

Leperconartist

New member
In all of the scripts themselves, I saved them as NotePad documents, and when I open them up instead of there being normal spaces (made by the enter key), there are black squares. However if I open up the file using WinWord it comes up normally.
 

dangerpin

Member
Wordpad is a happier medium between the outdated notepad and Word that adds its own formatting characters, and there are a lot of programmer-centric bits of editing software that do a better job.
 

plurialibus

New member
Huahuhauahuhau, those black squares are what windows' notepad makes out of linux linebreaks. Linebreaks are represented in windows by 2 ascii characters -- usually represented in programming languages as \r\n. In linux, they are represented by a single \n, and in macos, by a single \r.

Try using a better text editor, such as the crimson editor or scite ;)
 

Leperconartist

New member
;D Thank you very much, I got crimson text editor and it's some cool bones. IOU. Now I'm just trying to figure out if I can color code brackets. But yeah it's a little better than Notepad ><

Instead of being forced to save everything as a .txt I can now save things as .ash!

Oh and now when there's a problem in one of my scripts, I don't have to count each line untill I find line 307 ><
 

beardedrobot

New member
[quote author=plurialibus link=topic=1307.msg7946#msg7946 date=1209063722]
Oh, and I'm uploading all the files just to keep it neat for those who never downloaded them before. The only updated files were macguffin.ash and hidden city.ash.
[/quote]
Plurialibus, I tried using your updated scripts, but was unsuccessful.
I presume you expect that the user performs the entire quest using your scripts. I tried loading the scripts in the middle (or more to the left of middle) of my quest - I'm done with beach, palindrome, pyramid, cellar (almost - need to pour the wines) and need to finish the hidden city (unlocked) - and the script aborted prematurely. Yes, I did get the updated files you've posted later as well.
I see that you're checking for forged documents (phase 2), but since I've already finished that section I have no documents in hand, so the script assumes I still haven't retrieved them and exits.
Should the check be for quest log changes and inventory items and found locations (I imagine it would take a little longer to look for these compounded requirements)? I'm not versed with the Mafia API and and all, so the couple of changes I tried seemed to screw things up even more.

On Windows, I prefer Notepad2 - lightweight, looks like Notepad, syntax highlighting, line numbers - by the way you can goto a line in Notepad via CTRL+G (I think that's the shortcut) - and no tabbed windows (large monitors...why bother). Also you can set the encoding and line endings.
 

plurialibus

New member
=/ I don't know why it's failing for you. If you used your forged documents, you should have the diary, and the script checks for that. You can see it in the get_diary() function. If you had the diary and still hadn't read it, it should also be alright [if(stepGetDiary(questLog) || stepReadDiary(questLog))]. I don't have a clue =/.

The only reasons for get_diary() to fail would be if the black market was still not available (it should have been dealt with in previous sections of the script), if you didn't have the diary nor the forged documents and couldn't buy the documents, or if after the whole function you still didn't have the diary. A problem there might have something to do with how the shore trips were taken... I'm changing that a bit, not sure if it wasn't being too confident.

But that's not your case. Thing is, Phase 2 can only be triggered if you have either this
"get yourself on a slow boat to China"
or this
"whole lot more complicated"
in your quest log. That's only to happen if you either haven't yet acquired the diary, or haven't read it =/. I really don't know how it could fail in phase 2... are you sure it wasn't in some other phase?

The current quest status verifications are all grouped in macguffin_status.ash, if you want to check them... you probably finished the quest already, but if you see something strange, please contribute; this script of izchak's seems to be becoming somewhat popular ;).
 

Attachments

  • macguffin.ash
    29.1 KB · Views: 96

plurialibus

New member
[quote author=Leperconartist link=topic=1307.msg8033#msg8033 date=1210041652]
"Uh, haven't got the Staff of Fats... aborting"

I can't get it passed this line. I guess I'll do the quest manually :(
[/quote]

=/ the script probably had trouble killing Dr. Awkward... he's pretty strong. If you fight him yourself and get the Staff of Fats, you can go on with the script. I guess I should have put a better error message... I'll save that for the next version.
 

plurialibus

New member
A few improvements.

Rehydration should no longer fail... there's more to it, but I can't remember right now. The important part is that it works (at least for me).

Also, outfit_change.ash now handles familiar equipment too. All you have to do is set the familiar with an extra parameter, as such:
default familiar 0 Baby Gravy Fairy|Mayflower bouquet
default familiar 1 Hovering Sombrero|Mayflower bouquet

Not as ugly a hack as it could be... if you don't set any equipment, the script will simply pick the familiar-specific one. If the piece of equipment you want is already being used by a familiar in the terrarium, it won't steal from it. I think. Can never be sure with Mafia's API, it's a box of chocolates ;).

Not really following this thread lately, but I'll try to keep up fixing the bugs if you post them here.
 

Attachments

  • macguffin.ash
    31 KB · Views: 111
  • macguffin_status.ash
    4.5 KB · Views: 97
  • outfit_change.ash
    10.8 KB · Views: 103

Gert

New member
I tried to run this but i got the following error:

> call C:\xxx...\scripts\macguffin.ash

haunted wine cellar (lower left)
haunted wine cellar (lower right)
haunted wine cellar (upper left)
haunted wine cellar (upper right)
Multiple matches against haunted wine cellar.
Bad location value: "haunted wine cellar" (macguffin.ash, line 162)

When i tried to manually adventure at that location i got the following message:

> adventure 1 haunted wine cellar

haunted wine cellar (lower left)
haunted wine cellar (lower right)
haunted wine cellar (upper left)
haunted wine cellar (upper right)
Multiple matches against haunted wine.
1 haunted wine does not exist in the adventure database.

Looks like the location is not specific enough. Is there an easy fix?
 

FishMan

New member
I believe that there was a change to the haunted wine cellar location and that it was split into 4 separate locations. You can now only adventure at:

haunted wine cellar (lower left),
haunted wine cellar (lower right),
haunted wine cellar (upper left) or
haunted wine cellar (upper right)

You will have to go into any old scripts which use only "haunted wine cellar" and change it.

This happened to me with the Bounty Hunter script and it worked when I changed as above.
 

Gert

New member
Yeah i figured. I saw that Veracity added a wine cellar (random). I will just slap that in the script and that should fix it! :D
 

Orinks

New member
Hey all,

Just wondering why this script currently isn't working for me at the pyrimid? Not exactly sure what error it's giving at the moment, however I did note that it did the thing backwards. It did Never Odd or Even and the polindome, but it never did the Hidden City.

Do I need to open the Hidden City.ash to make it finish the pyrimid for me?

Thanks.
 
Top