View Full Version : bumcheekcity and hippoking's Rollover Management Script
bumcheekcity
07-29-2009, 07:50 PM
bumcheekcity and hippoking's Rollover Management Script 0.63
What does this do?
This script will optimize your equipment for maximum rollover adventures, taking into account the time outfit, DFSS, a disembodied hand and grimacite strength. It will check whether the rollover MP you gain from your dwelling will be wasted, and it will check whether you've used:
Still Upgrades
Softcore Pulls
Skills (ACC, ASC, Pasta, Stickers/Snowcones, Rainbow's Gravity and Librams)
Drunk/Full/Spleen
Pool Table in VIP Room
Zap Wand
Special thanks to hippoking, who wrote most of it.
How do I use it?
Make sure you have Zlib (http://kolmafia.us/showthread.php?t=2072).
That's it. Just run it. It'll change your equipment, and print out some stuff.
What does it look like?
http://img269.imageshack.us/img269/8130/rollover.jpg
Changelog
v0.5 - Released it.
v0.55 - Fixed bug in maximiser code and wand code. Various extra checks.
v0.56 - Fixed bug in hot tub check
v0.6 - Uses inbuilt maximiser. Oscus soda.
v0.61 - Maximizer now uses -tie
v0.62 - Checks brickos, sugar, carboloading
v0.63 - Ooh, I dunno. Other stuff.
Bravo. I particularly like the part that optimizes rollover equipment. I've been wanting to write something like that for a while.
Just thought I'd share something with you. Feel free to make any use of this that you might desire. Or ignore it if you've got no use for it.
// This will burn mp down to min_mp by using up libram casts.
void libram(int min_mp) {
// choose a libram to use. It can be "heart", "song", "favor" or "random".
// Unfortunately It does not check to see if you have the libram.
string choice = "song";
// start summoning!!
skill libram = $skill[Summon Party Favor];
if(choice == "heart")
libram = $skill[Summon Candy Heart];
else if(choice == "song")
libram = $skill[Summon Love Song];
if(have_skill(libram)) {
int mptotal = mp_cost(libram);
if(my_mp() - mptotal > min_mp) {
int x = (square_root(8 * mptotal -7)+1) /2;
int y = x;
while (my_mp() - mptotal > min_mp) {
y = y +1;
mptotal = mptotal + y * (y - 1) /2 +1;
}
y = y - x;
if(choice == "random") {
int rand = random(2);
if (rand ==0) {
use_skill(ceil(y/3.0), $skill[Summon Candy Heart]);
use_skill(floor((y+1)/3.0), $skill[Summon Party Favor]);
use_skill(floor(y/3.0), $skill[Summon Love Song]);
} else if (rand == 1) {
use_skill(ceil(y/3.0), $skill[Summon Party Favor]);
use_skill(floor((y+1)/3.0), $skill[Summon Love Song]);
use_skill(floor(y/3.0), $skill[Summon Candy Heart]);
} else {
use_skill(ceil(y/3.0), $skill[Summon Love Song]);
use_skill(floor((y+1)/3.0), $skill[Summon Candy Heart]);
use_skill(floor(y/3.0), $skill[Summon Party Favor]);
}
} else use_skill(y, libram);
}
}
print("You have used your librams to summon "+ int_to_string( to_int(square_root(8 * mp_cost(libram) -7)/2 + 0.5))+ " items today.", "blue");
}
void burnoff_mp() {
boolean fratnuns = get_property("sidequestNunsCompleted") == "fratboy";
int mpAutoRecoveryTarget = ceil(my_maxmp() * to_float(get_property("mpAutoRecovery")) +1 );
if(fratnuns && to_int(get_property("nunsVisits")) < 3) {
if(have_effect($effect[Leash of Linguini]) < 1000)
use_skill( (my_mp() - mpAutoRecoveryTarget)/ mp_cost($skill[Leash of Linguini]), $skill[Leash of Linguini]);
else libram(mpAutoRecoveryTarget);
}
int disco = to_int(have_skill($skill[Disco Nap])) + 2* to_int(have_skill($skill[Disco Power Nap]));
while(to_int(get_property("timesRested")) < disco)
cli_execute("rest");
while( fratnuns && to_int(get_property("nunsVisits")) < 3 ) {
if(have_effect($effect[Leash of Linguini]) < 1000)
use_skill( my_mp()/ mp_cost($skill[Leash of Linguini]), $skill[Leash of Linguini]);
else libram(mpAutoRecoveryTarget);
cli_execute("nuns");
}
}
Dang. I ought to fix that up for more general use some day. Though it works well enough for my purpose that I have little incentive.
mredge73
07-30-2009, 03:49 PM
Hey, you should add a check to see if the summoning chamber has been used yet
Here is my function to summon drinks from my Hardcore Daily Inventory Control script, it could easily be modified to be used as information only:
//Summon Ak'gyxoth
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
string SummonDrinks()
{
if( possessItem($item[scroll of ancient forbidden unspeakable evil]) &&
item_amount($item[thin black candle])>=3 &&
my_level()>10 &&
possessItem($item[your father's macguffin diary]) &&
visit_url("manor.php").contains_text("sm8b.gif") &&
visit_url("manor3.php").contains_text("chamber.gif") )
{
if (get_property("demonSummoned")=="true")
{
print("You've already summoned a demon today!","blue");
return "";
}
else
if(user_confirm("Summon Ak'gyxoth?"))
{
cli_execute("summon Ak'gyxoth");
print("Summoned Ak'gyxoth!","blue");
//visit_url("manor3.php?place=chamber&demonname=Ak'gyxoth&action=summon");
return "You Summoned Ak'gyxoth! <br />";
}
}
return "";
}
I summon drinks on logout, too, but only in aftercore ... so as to not inadvertently burn scrolls or candles that I might need later.
Also, doesn't "equipt.ash Adventures" essentially duplicate the functionality for rollover adventures? I don't have any time stuff anymore, so I don't know how it works, or how well it works with time gear, but it doesn't have any problem figuring out when the depleted grimacite stuff is better or worse than my various watches.
equipt Adventures certainly does duplicate that functionality. The only problem is that it takes a while to run. Sometimes I'd rather have something fast, yet more limited.
mredge73
07-31-2009, 02:10 PM
For some reason it is not detecting that I used my wand for the day, it is printing "wand is cold" but I have used it.
you can borrow a couple of my wand functions from my inventory script if you like:
//Find Wand
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
int FindWand()
{
int wand=0;
for i from 1268 to 1272
{
if (haveItem(to_item(i)))
wand = i;
}
return wand;
}
//checks if the wand was used today
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
boolean WandUseable(int wand)
{
if (wand==0)
return false;
if (contains_text(visit_url("wand.php?whichwand="+wand),"feels warm"))
return false;
else
return true;
}
To use:
if(WandUseable(FindWand()))
print("Your Wand is cold");
else
print("You have Zapped once Today");
bumcheekcity
07-31-2009, 03:18 PM
Thanks for the advice, I'll fix the wand thing (and do the summoning chamber), but surely the above code wouldn't check if you'd used the wand TWICE in a given day (because then it doesn't tell you it's warm, and does tell you to be careful).
mredge73
07-31-2009, 07:04 PM
yea
I have been meaning to fix that...
//checks if the wand was used today
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
boolean WandUseable(int wand)
{
if (wand==0)
return false;
string cachepage=visit_url("wand.php?whichwand="+wand);
if (contains_text(cachepage, "feels warm") || contains_text(cachepage, "be careful"))
return false;
else
return true;
}
Very cool script; nice work!
Marcyroni
08-02-2009, 09:42 AM
It looks like if you only have access to sword behind + depleted grimacite gear, the script aborts after equipping the sword because "you can't equip an offhand item while wielding a 2-handed weapon." It would be great if the script continued and picked the one with highest adventures, or just skipped the offhand equip.
I have issues equipping a gravy boat when I have time gear as well (offhand is left blank). Disembodied hands aren't switched to either, if one is available (+ time sword). In the situation with time gear + depleted grimacite stuff, my offhand ends up empty as well. Otherwise, great script! I like the reminders of things to do (most of which I never remember).
zarqon
08-04-2009, 05:37 PM
Nice script! A few suggestions for thoroughness:
1. I don't know if it's possible to figure out if the clan jukebox buff is still available, but if so, that could be included as well.
2. You could also check Summon Burrowgrub casts (accessible in mafia settings). Otherwise, that's free HP/MP gone to waste. The HP doesn't do much good if you're already topped off, but there are plenty of uses for MP.
Speaking of, I've been intending for a while to write something into my logout script that checks Nuns and Burrowgrub, and if there are MP restores available, switch to a +maxMP outfit (possibly also with -MPcost) and use those restores to full advantage, casting daily skills and available buffs (at the very least, the trivial skill, but I would write the script to hierarchically prefer bookshelf skills, summoning skills, and other available buffs), repeating the cast/restore process as necessary until finally leaving me with just enough MP that rollover will top me back off.
I'll probably borrow significantly from this script whenever I get around to that, so thanks in advance for saving me a good bit of work! I'll try to remember to post that bit of my logout script here whenever I get it written.
EDIT: Yeah... you already check the friars/arena/nuns. Nice.
ANOTHER EDIT: In the section where you check restore from your housing, you may want to auto-use the frobozz house if for some reason it's still sitting in inventory. It's a quest item, there's no reason someone shouldn't use it.
HippoKing
08-05-2009, 11:49 PM
I'll put some time into this tomorrow. I'm pretty sure I can't check jukebox buffs (in the same way that Snack Machine drops and Telescope buffs can't be checked).
I'll have a look at adding the Burrowgrub stuff and fixing the wand code. There is also at least one bug in the adventure maximizer (situation where Sword behind is best in hands, but Gravy Boat is owned), which I'll look at fixing.
As for the Frobozz house, I won't auto-use it (I prefer this script as not doing anything non-reversible except visiting the BHH), but I'll certainly add the information (it already tells you if you forgot to buy a tent day 1, no reason it shouldn't tell you you forgot to use your house).
Most importantly, if anyone finds any bugs with the adventure maximizer, tell us. Neither me nor BCC own the Time Outfit, which means that testing it is somewhat tricky.
edit: Actually I can probably check most of that stuff using properties. I've written fixes for the known bugs and added the suggested demon, house and burrowgrub reminders. v0.55 will probably come out tomorrow with that stuff and hopefully a few more checks (clan hall stuff and telescope).
Sputnik1
08-06-2009, 02:42 AM
Wielding sword behind inappropriate prepositions...
Equipment changed.
You can't equip an off-hand item while wielding a 2-handed weapon.
For some odd reason, the script wont ignore either the sword or the offhand grimacite item I have based off of which would be better, it wants to somehow use both.
HippoKing
08-06-2009, 10:03 AM
Wielding sword behind inappropriate prepositions...
Equipment changed.
You can't equip an off-hand item while wielding a 2-handed weapon.
For some odd reason, the script wont ignore either the sword or the offhand grimacite item I have based off of which would be better, it wants to somehow use both.
I fixed that last night, I'll post the update later today.
edit: OK, 0.55 released. The bug mentioned has been fixed, as has the problem with the wand code. It now additionally checks:
Burrowgrubs
Demons
Telescope buff
If you have an instant house in inventory and a worse one at campground.
If you can still use your hot tub today
I couldn't work out how to check the Jukebox and Snack Machine. I can't see properties for them in Mafia (I may just not have found them) or see how to check them without.
As always, if you find any issues, please tell us.
edit again: And 0.56 because it would tell you to soak when you had no VIP key.
Sputnik1
08-10-2009, 05:05 PM
Checking for updates (running bumcheekcity and hippoking's Rollover Management Script ver. 0.56)...
_version_bumcheekcityroll => 0.56
Wielding sword behind inappropriate prepositions...
Equipment changed.
Verifying ingredients for time sword (1)...
You need 1 more petrified time to continue.
Desired purchase quantity not reached (wanted 1, got 0)
Purchasing sword hilt (1 @ 100)...
You acquire an item: sword hilt
Purchases complete.
You need 1 more time sword to continue.
Why would the script try to buy the ingredients for the time sword?
bumcheekcity
08-10-2009, 05:33 PM
Can you turn on debugging and tell us what of the items you DO have?
Sputnik1
08-11-2009, 04:33 AM
i should be wearing...
sword or gravy boat
dead guy's memento
weightlifting belt
grappling hook
dont know if the debug log gonna help
zarqon
08-11-2009, 07:53 AM
Actually, with the advent of the Modifier Maximizer, I think you can probably reduce the entire outfit-switching section of this script to a simple
cli_execute("maximize adv");
It looks like it takes the time outfit bonus into consideration. I don't know about the variable stuff like grimacite.
Maximize does take the time outfit bonus and depleted grimacite into consideration. It's one failing is that it won't take the possibility of a disembodied hand into account, so a little bit of fine-tuning is still needed.
zarqon
08-11-2009, 08:04 AM
Then, other than weapons, the rest of the outfit could still be handled by maximize. There may be some additional switching needed if the time outfit bonus is lost when giving the time sword to your Hand (assuming you have a sword between and only one time sword), but it would still save quite a lot of steps (in particular, all the data fiddling this script does with accessories) to start from a maximized outfit.
I'd actually overlooked using my Hand for additional adventures. Doh! Putting that in my logout script right now. And dang it -- I need another friggin time sword!
EDIT: I just scraped up a function for my purposes (I don't have any grimacite items), meant to be called after maximizing. If you have both a time sword and a sword behind, it will swap your time sword to your Hand, and equip the sword behind on you. It will not swap if you are dual-wielding time swords. The good news is that I think Maximize won't unequip your time sword from your Hand so if you only use your Hand for rollover adventures you will only suboptimally switch things around the first time.
EDIT 2: Took care of the first issue I mentioned below. Still doesn't consider gravy boats.
boolean time_on_hand() {
if (!have_familiar($familiar[disembodied hand])) return true;
if (familiar_equipped_equipment($familiar[disembodied hand]) == $item[time sword]) {
use_familiar($familiar[disembodied hand]);
if (familiar_equipped_equipment($familiar[disembodied hand]) == $item[time sword])
return true;
}
if (item_amount($item[time sword]) == 0 && item_amount($item[sword behind inappropriate prepositions]) > 0 && equipped_amount($item[time sword]) == 1)
equip($item[sword behind inappropriate prepositions]);
if (item_amount($item[time sword]) > 0) {
use_familiar($familiar[disembodied hand]);
return equip($slot[familiar],$item[time sword]);
} else return true;
}
bumcheekcity
08-11-2009, 11:23 AM
I'll rewrite it for version 0.6, using the maximise command :D
zarqon
08-11-2009, 06:00 PM
Okay, I've examined it in greater detail. There are two situations the function I posted above doesn't handle:
1) Your Hand already has a time sword as its equipment, but you have a different familiar equipped, with familiar gear locked. This will equip your Hand, but not its time sword.
EDIT: Fixed in edited function above.
2) Gravy boat. Seems like a check for number of adventures gained by both hands is better here than using specific item names.
Oh never mind. Ignore this since I didn't really say anything important.
Durgle
03-02-2010, 06:27 PM
I was just using the script and came along some errors or oversights. I was requested to post them here.
1. Version .56 does not check the DC for better rollover gear
2. For some reason Version .56 doesn't equip the disembodied hand when it has a time sword attached to it.
3. There is no checks for Oscus's Soda or Chester's Bag of Candy being used.
HippoKing
03-02-2010, 09:55 PM
1) As far as I'm concerned, the DC should be ignored by everything in mafia that isn't doing a specifically do a DC-related task. That will not change.
2) Yeah, all that code is getting scrapped in favour of the modifier maximizer when either me or BCC get around to it. That didn't exist when this was written, and it's 10x better than the questionable and buggy logic currently in place. Also, it doesn't do Cheese.
3) Oscus' Soda is an oversight, Chester is not. Just stick the candy bag in your breakfast.
Depending on REAL LIFE, I might write an update this weekend. I might not.
HippoKing
03-03-2010, 08:47 PM
Turns out I got around to it tonight. Note that now any bugs with the adventure maximizing code are mafia's fault and not ours (probably). Added support for the soda and fixed the longstanding bug with it telling you to soak in BM.
If you change the maximize command to
cli_execute("maximize adv -tie");
It will only change those slots that have an effect on rollover adv, and leave the rest of your slots alone (otherwise it switches out the equipment in other slots for things that the maximizer thinks has other beneficial effects).
-TH3Y merely suggest
lostcalpolydude
03-07-2010, 10:02 PM
I thought "maximize adv" implied -tie. Or maybe it's "maximize adventures" that implies it, but I think it's the first one.
HippoKing
03-07-2010, 10:31 PM
It definitely isn't doing it right now, so I'll fix it. It just put on a nurse's hat when trying to max adventures, removing my brimstone beret and thus shrugging ode. Curses.
Guess it's time for 0.61
adeyke
03-08-2010, 08:37 PM
The "You can still made Prismatic Wads today" should read "make".
It also doesn't check for sugar summoning.
bleary
03-08-2010, 09:51 PM
If there were some way to detect whether the Canticle of Carboloading were available and hadn't been cast yet, that would make a good addition to this script.
HippoKing
03-10-2010, 10:59 AM
Oh yeah, I should add Sugars and Brickos, forgot about their introduction. I'll do this, and Canticle sometime probably next week. I don't want to post updates too regularly, and I don't want to write Canticle checking code before I can test it (I'll ascend PM at the weekend I guess).
bumcheekcity
03-29-2010, 06:41 PM
It's always a surprise when I update this script :P
HippoKing
03-29-2010, 09:37 PM
Oh yeah I probably should have mentioned that. I made the changes like 10 days ago and completely forgot to upload it.
Here's a patch to check for the hatter buff and crimbo present. Feel free to add to the main script if you like. Caveat: I have tested only minimally...
// Check if the hatter buff can still be used today
if (item_amount($item[Clan VIP Lounge key])>0&&!in_bad_moon()&&get_property("_lookingGlass")==true&&get_property("_madTeaParty")==false) {
print("You can still visit the Hatter today, use the 'hatter' command to see which buffs are available");
}
// Check if there is a Crimbo Tree present available
if (item_amount($item[Clan VIP Lounge key])>0&&!in_bad_moon()&&get_property("_crimboTree")==true&&to_int(get_property("crimboTreeDays"))==0) {
print("You have a present available under the Crimbo Tree");
}
Another patch, for "Summon Crimbo Candy". Add to the skills check list (underneath Pastamastery, around line 90, would be a good place.)
contains_text(skillName, "Crimbo Candy") ||
Is this being superseded by StDoodle's relay script? I haven't checked that out yet.
Some other things that would be nice to add here:
- autosell your bugged beanie / bugged balaclava and get another one
- if a mine is open and you have Unaccompanied Miner, check whether you've spent 5 turns mining
- unused Yellow Ray?
- clovers available & not purchased?
- PvPed for flowers?
StDoodle
09-20-2010, 10:25 PM
Is this being superseded by StDoodle's relay script? I haven't checked that out yet.
My script is aimed more towards the anal-about-how-things-happen bleeding-edge crowd, who want no automation, just information. Also, it's more of a "check often" script than this one, which is a "check before logout" script. There's lots of overlap, but two niches.
Some other things that would be nice to add here:
- autosell your bugged beanie / bugged balaclava and get another one
- if a mine is open and you have Unaccompanied Miner, check whether you've spent 5 turns mining
- unused Yellow Ray?
- clovers available & not purchased?
- PvPed for flowers?
Some thoughts on these. #2 (miner) seems a good idea to add to my script as well, I'll have to make a note. #3 (YR) doesn't fit with my script's use too well, but I could see it having a place for this one. Should be easy to check with get_counters(). I've wanted to add something for PvP for a while in my script, but I have a great dislike for PvP, and all of the processing would need to be done with visit_url(), as mafia doesn't track fights used per day. If anyone codes PvP fight checking, I'd love to see (& steal) the code. ;)
adeyke
11-27-2010, 05:08 PM
The script has problems interpreting the ginormous pumpkin. To determine the quality of housing, it uses the number in the image name. In the case of the pumpkin, however, that number is "a", so the to_int doesn't work.
Veracity
11-27-2010, 05:31 PM
Ha. I asked in another thread for a debug log so that I could figure out why we were "unable to parse housing" for the pumpkin house. That little thing you said answers that question.
Did you know that
http://images.kingdomofloathing.com/otherimages/campground/rest10.gif
http://images.kingdomofloathing.com/otherimages/campground/resta.gif
are BOTH the pumpkin house? In other words, they COULD have used house "10", but used house "a" instead.
Winterbay
11-28-2010, 08:29 PM
Ha. I asked in another thread for a debug log so that I could figure out why we were "unable to parse housing" for the pumpkin house. That little thing you said answers that question.
Did you know that
http://images.kingdomofloathing.com/otherimages/campground/rest10.gif
http://images.kingdomofloathing.com/otherimages/campground/resta.gif
are BOTH the pumpkin house? In other words, they COULD have used house "10", but used house "a" instead.
So they went with a hexadecimal system rather than a decimal one it seems...
Fluxxdog
11-29-2010, 12:05 AM
Now that you mention it... Something seems a bit off. Why have 2 image files for the same thing? Is it a simple slip up?
Jick probably just changed his mind on how to number it, then forgot to remove the original file.
terry
12-21-2010, 06:16 PM
If it's possible, could you add support for Uncle Hobo's epic beard?
Mafia's Maximizer recognizes that the beard gives +6/9 adventures at rollover since r8818, and this script uses the Maximizer. So the Beard is take into account if you are using .jar daily build (http://builds.kolmafia.us/) r8818 or higher.
terry
12-24-2010, 12:52 AM
I have the most recent daily build (I just click it and open with Java, right?), but it still equips my depleted grimacite over the beard. I checked the equipment.txt file in the \data folder, and the beard is listed, so I'm a little confused as to what I'm doing wrong.
StDoodle
12-24-2010, 04:20 PM
I thought I remembered reading something about the maximizer not always handling grimacite "properly," but I could be wrong...
lostcalpolydude
12-24-2010, 04:39 PM
I thought I remembered reading something about the maximizer not always handling grimacite "properly," but I could be wrong...
For a long time, mafia didn't properly parse the moons, which meant that anything dependent on them was calculated wrong. They would have never been considered better than even +6 from the beard, though.
StDoodle
12-24-2010, 04:41 PM
My only thought is; are you absolutely sure you have the beard, and didn't zap it / put it in your DC?
Alhifar
12-24-2010, 05:08 PM
Did you try "update clear"?
HippoKing
12-25-2010, 10:11 PM
I've been neglecting this pretty heavily since the addition of the Daily Deeds and Modifier Maximizer removed most of its reasons to exist. Still, I'm willing to release another version if anyone wants to put together a fairly comprehensive list of things people would like to see (so I can implement some of them and reject others on tenuous grounds).
Ferdawoon
12-29-2010, 04:54 AM
What I would like to see is the ability to make the script use all the things it mention.
Meaning, I could set it up to burn MP as low as possible using the basic Mafia Burn MP function, visit the nuns, burn again, and so on. Maybe a Maximize MP function at the start to not waste MP from the nuns.
Also to do get the once a day buffs that this script mention.
Basicly, I can set it up (hopefully in an easy way) and set it as my logout script and it will use all the stuff I forgot to do.
Hopefully this isn't stepping on any toes, but I do use this script daily and have added a couple of things since the last "official" release. I've taken the liberty of assigning version numbers to the changes:
0.625 - check for mad hatter buff and Crimbo present (Y0U)
0.626 - check for Lunch Break, selling bugged beanie / balaclava (Y0U)
The modified file is attached in case anyone finds it useful. My other "wishlist" items are here (http://kolmafia.us/showthread.php?2299-bumcheekcity-and-hippoking-s-Rollover-Management-Script&p=35130&viewfull=1#post35130) (page 4 of this thread).
-Th3y thank you
4091
JohnDoe244
01-29-2011, 10:15 AM
Could just be me (build 8953) but adventure maximizer isn't getting out my disembodied hand (when it's holding a time sword). Uh... be nice if this script did that, if anyone is still updating.
Change
cli_execute("maximize adv -tie");
to
cli_execute("maximize adv -tie, switch Disembodied Hand");
Winterbay
01-29-2011, 01:16 PM
Or with the wonders of ash
maximize("adv -tie, switch Disembodied Hand", false);
(if you for some reason doesn't want to use CLIexecute :))
HippoKing
01-31-2011, 08:36 PM
Could just be me (build 8953) but adventure maximizer isn't getting out my disembodied hand (when it's holding a time sword). Uh... be nice if this script did that, if anyone is still updating.
Sorry, my version has been doing that for months. I'm actually pretty surprised that I never uploaded this. Worst script admin ever.
Anyway, here's 0.63, including a variation on TH3Y's changes (untested).
I'll get BCC to update the OP.
bumcheekcity
01-31-2011, 08:53 PM
Done.
HippoKing
01-31-2011, 08:54 PM
Thanks. I'll look at 'proper' upgrades at some point - I'm kinda busy at the moment. Fuck degrees.
bumcheekcity
01-31-2011, 09:09 PM
Get a job.
Winterbay
01-31-2011, 09:32 PM
Get a job.
I thought that was the point of getting a degree so you could get a job :)
bumcheekcity
01-31-2011, 09:41 PM
Clearly you do not live in Britain.
Banana Lord
03-02-2011, 08:06 AM
The script seems to be ignoring my loathing legion necktie. Any plans to add support for this? (Auto-folding would be nice...) :-)
Banana Lord
03-16-2011, 01:06 AM
You know, by necktie, I meant moondial >_< Only took me two weeks to work out the difference, though given that a SBIP will be the better option for most people, a better feature request would be for auto-folding. With Slyz's help, I have a function which may be useful.
boolean get_foldable( item goal )
{
boolean look_get( item it, boolean DC )
{
if( DC )
return( display_amount( it ) > 0 && take_display( 1, it ) );
return( available_amount( it ) > 0 && retrieve_item( 1, it ) );
}
foreach DC in $booleans[ false, true ]
{
if( look_get( goal, DC ) )
return true;
foreach form in get_related( goal, "fold" )
{
if( look_get( form, DC ) )
{
cli_execute("fold " + goal );
if( item_amount( goal ) > 0 )
return true;
}
}
}
return item_amount( goal ) > 0 ;
}
icon315
03-16-2011, 02:11 AM
I tried this
boolean get_foldable( item goal )
{
boolean look_get( item it, boolean DC )
{
if( DC )
return( display_amount( it ) > 0 && take_display( 1, it ) );
return( available_amount( it ) > 0 && retrieve_item( 1, it ) );
}
foreach DC in $booleans[ false, true ]
{
if( look_get( goal, DC ) )
return true;
foreach form in get_related( goal, "fold" )
{
if( look_get( form, DC ) )
{
cli_execute("fold " + goal );
if( item_amount( goal ) > 0 )
return true;
}
}
}
return item_amount( goal ) > 0 ;
}
void main (item goal){
get_foldable(goal);
}
And it printed this in the CLI
Returned: origami riding crop
fullness => 0
inebriety => 0
spleen => 0
notes =>
descid => 232940208
levelreq => 0
Updating display case...
Requests complete.
Banana Lord
03-16-2011, 02:28 AM
Try this and tell me if you have the same problem.
boolean get_foldable( item goal )
{
boolean look_get( item it, boolean DC )
{
if ( DC ) return ( display_amount( it ) > 0 && take_display( 1, it ) );
return ( available_amount( it ) > 0 && retrieve_item( 1, it ) );
}
foreach DC in $booleans[ false, true ]
{
if ( look_get( goal, DC ) ) return true;
foreach form in get_related( goal, "fold" )
{
if( look_get( form, DC ) )
{
cli_execute("fold " + goal );
if ( item_amount( goal ) > 0 ) return true;
}
}
}
return item_amount( goal ) > 0 ;
}
icon315
03-16-2011, 02:37 AM
Yup same thing
Banana Lord
03-16-2011, 03:05 AM
Oh. Sorry, I didn't actually read what you'd posted properly. It's a function not a command, so when you call it you need to provide it with valid parameters. Try this (exactly as it is).
boolean get_foldable( item goal )
{
boolean look_get( item it, boolean DC )
{
if( DC )
return( display_amount( it ) > 0 && take_display( 1, it ) );
return( available_amount( it ) > 0 && retrieve_item( 1, it ) );
}
foreach DC in $booleans[ false, true ]
{
if( look_get( goal, DC ) )
return true;
foreach form in get_related( goal, "fold" )
{
if( look_get( form, DC ) )
{
cli_execute("fold " + goal );
if( item_amount( goal ) > 0 )
return true;
}
}
}
return item_amount( goal ) > 0 ;
}
get_foldable($item[origami pasties]);
@Icon315: I don't know how you are calling the code you posted. I get:
> call test.ash legion jackhammer
Removing items from display case...
You acquire an item: Loathing Legion jackhammer
Requests complete.
@Banana Lord: For this script, I think the user should be able to prevent the script from taking items from their DC if he wishes. You might also want to take the items from your closet even if autoSatisfyWithCloset is false.
Banana Lord
03-16-2011, 07:25 AM
Yep, that's fair enough. You know better than me how to remove/improve that part ;) I just thought I'd post it here in case it saved BCC/hippo some time.
Banana Lord
06-09-2011, 11:22 AM
I'd like set up NCF.ash (a farming script I'm working on) to play nicely with rollover.ash and encourage users to download, but as it doesn't have any zlib settings I can only check that the user has elected to download it by using if(cli_execute("rollover.ash")). I'm concerned that a number of users may have their own "rollover.ash" scripts (which would result in unexpected behaviour). Can anyone see a way around this? Maybe the name of the script could be changed to something more unique, or would that be too inconvenient?
Theraze
06-09-2011, 01:19 PM
Is there a way to tell if the "_version_bumcheekcityroll" preference exists? Since it's a daily preference, it will be empty if they haven't used it yet, but that would let Banana Lord know if they've ever run it on that character...
Winterbay
06-09-2011, 01:50 PM
Well...
string test;
test = get_property("_testing");
if(test == "")
print("Empty");
The code above prints "Empty" and since I am very certain I have no preference called _testing I'd say that it's impossible to distinguish between an empty setting and a nonexistsing one. But I may be wrong :)
bumcheekcity
06-09-2011, 03:37 PM
This script is not in the process of being actively supported, I'm afraid. There is no way of telling if a user has it installed.
Possibly a feature request to detect if a script exists in the scripts folder?
Theraze
06-09-2011, 07:55 PM
Is it possible to use try/finally to import and find if a script exists? Should it be possible? I tried it and when it didn't exist, the finally never executed. When it did exist, I got an error saying:
main method must appear at top level (zlib.ash, line 667) Does finally not actually executing when try fails qualify as a mafia bug, or is this something that's functioning as is desired? For the record, here's the code I was trying:
ash boolean failed = true; try { import <zlib> failed = false;} finally {print (failed);}
Winterbay
06-09-2011, 08:42 PM
I think all imports must be at the top of things in order to work, that was the problem zarqon had that instigated the quote in my sig...
Banana Lord
06-09-2011, 09:06 PM
Hmm. I'm hesitant to ask this, but if you're not planning to resume development of this script, would you mind if I cannibalised it for some of its features? Then I can just bundle the functionality with NCF.ash and avoid the problem alltogether.
bumcheekcity
06-09-2011, 09:35 PM
Hmm. I'm hesitant to ask this, but if you're not planning to resume development of this script, would you mind if I cannibalised it for some of its features? Then I can just bundle the functionality with NCF.ash and avoid the problem alltogether.
Sure. Take what you want :D
Banana Lord
06-09-2011, 10:08 PM
Done and done :D I've credited you and Hippoking in the script.
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.