Pork to the Future - Cyrus, Hyboria, Future, and Wumpus!

Theraze

Active member
If people can be surprised by what it does (some are surprised it's not an error, some are surprised it waits for different amount of time than requested), it's better when they are force to write non-surprising code instead.

That sounds like an argument to remove the two parameter buy. And yet, it remains, and people with sloppy code can be surprised by what it does.

Just because the results of a function might not be the one that you expect if you don't consider it thoroughly doesn't mean that it should error.
 

guyy

Member
Just because the results of a function might not be the one that you expect if you don't consider it thoroughly doesn't mean that it should error.

And that's why all programming languages are riddled with illogical behaviors that never get fixed.

More to the point, I'm pretty sure waitq(0) originally did wait for 0 seconds, because I test my scripts obsessively and I would have noticed something that obvious, if it'd been that way originally. So someone changed it to 1 second, for some reason.

I mean, you want to talk about wasted processing... how about the fact that the function takes an extra step for if (input == 0) {input == 1}, on top of requiring you to check that you aren't giving it a 0 as input? Instead of just doing nothing, which is probably what the wait function in Java itself does with a 0 anyway?

It's fine as it is, though! It's only a minor quirk. I'm just baffled at the way most of you seem to think it makes sense.
 

lostcalpolydude

Developer
Staff member
Mafia has handled wait() this way since 8745, which was released November 6, 2010. Before then, I don't think negative numbers were sanely handled, and 0 did what you expect.

Did you really write this script and test it that thoroughly more than 2 years before you initially posted it?
 

Zen00

Member
There's a very small, but very big bug in this script. If something bugs out somewhere (most common when Mafia stops the script because it couldn't restore your HP/MP after battle) you can actually have the Krakrox quest be marked as completed and the script will start banging away at the Seaside Megalopolis without picking up the armor piece. To prevent this from happening, I simply moved the line for visiting the vacant lot to occur just before marking the quest as complete. I do this mainly because I've wasted about 50 turns and bottles from this bug.

Code:
								if (combat_victory())
									visit_url("town_wrong.php?action=krakrox");
									krakrox_complete = true;
								else
									print("You need to work on your priest-pummeling!","red");
 
Last edited:

guyy

Member
"town_wrong.php?action=krakrox" isn't the right URL for getting the armor piece anymore, though. Unless they changed it back. So that's probably why it wasn't working.

I already changed that URL to "place.php?whichplace=town_wrong&action=townwrong_1krakrox" which I think is correct. I've all but quit the game at this point though, so I can't be sure.
 

Zen00

Member
I'll check out the url on my next ascension to be sure. Anyways it makes more sense for the check to be done before declaring the quest complete as it's not complete until the check is done, don't you agree?
 

guyy

Member
It shouldn't matter; there's no way for it to avoid reaching the line where it grabs the pig-iron once krakrox_complete is set to true. Even if it manages to crash between having killed the priest and grabbing the item (all it does is a "mood clear"), when you run it again it should check the quest log, notice you didn't get the item, and grab it before continuing.

Using the wrong URL, however, will definitely cause this problem, and since you posted the old URL I'm guessing you're using an old version of the script. Do an "svn update" and it should be fixed.
 

Bale

Minion
It was recent brought to my attention that this script no longer works flawlessly. In particular, it runs into problems if your ghost dog appears in a zone. Also, it aborts when you enter the Wumpus cave. Finally (and this was the biggest problem) it liked to equip the Space Trip safety headphones when hunting for essences in the future. That last one was the biggest problem because -100 ML meant that the monsters frequently died while they were being stasised before they could use their special attack.

I offered to fix it since he's got a neat collection of Secrets from the Future. While I was at it, I discovered that it doesn't properly maintain your prefered mood while boosting non-combats, so I fixed that also.

I'm attaching my fixed version here. Feel free to download it. (It's been a year since guyy last logged in, so he may not update the version on svn.)
 

Attachments

  • PorkFuture.ash
    52.1 KB · Views: 111
Last edited:

guyy

Member
Thanks for the fixes and improvements; as you noticed, I haven't been playing for quite a while, so I didn't know it was broken. I've added your repairs to the SVN version.

The Space Trip headphones use was semi-intentional, since without them you can take a lot of damage while waiting for the special attack (I almost got beaten up while test-running it just now), but apparently that has an unintended side effect. I stuck in a half-baked moxie-boost mood, hopefully that will prevent "accidental monster death" from being replaced by "accidental getting clobbered."
 

mister19stick

New member
I've been using this script for quite a while now.
It seems, though, that sometime recently the first part of the script (of three) has just broken.
It uses three deliciousnesses and then gets hung up looping infinitely because it can't use another.
Is this enough or do you need more?
Thanks for the splendid work.
 

Tissen

New member
Row 1170 and 1171 can be removed now that Olfaction is an intrinsic and can't be unaffected. Too lazy to locate the repo to do it myself.
 
Top