Rollover Management

Thank you, but what I meant is that when v1.11 (and v1.12 and v1.13... etc) will come out it will reset the settings because the settings are located within the script file itself. Instead of being kept in a separate file entirely.
Some scripts like OCD inventory management keep their settings in a separate file entirely (it creates one on first run, named after the account being used to login).
I'm very aware of this. I fixed the issue in the script though, so it will only set the preferences once. Even when the script is updated. I've tested this myself.

I just updated the script. It will now properly look at PVP & Rollover gear if you don't have enough PVP gear to fill all slots. I gave it a ratio of 10 pvp, 1 adv, which seemed to work really well for me. If it looks like it's not high enough, it's easy enough to change.

You could annoy people like me who don't like clutter and use KoLmafia properties.

That's what I do now. The script has it's own properties to look at, so they are coded into the script itself.
 
My snark about annoyance is based upon at least a decade without rebuilding a settings file from scratch. Thus it is littered with properties that are no longer used by any script I still run and those properties are also named in such a way that it actually takes effort to find out where they are used and this whether it is safe to delete or not.

I am not running your script. I am trying to be helpful and probably not succeeding.

Would you try the following?

Assume you have two characters A and B.

Assume there is a parameter the script uses called "yeastRolls". It should be a positive integer and defaults to zero.

There are two versions of the script 1.3 and 1.4. They do not differ in anything involving yeastRolls.

Run 1.3 for character A. Do whatever you need to change the value of yeastRolls to 1.
Close mafia and run 1.3 for character B. Is yeastRolls 0? If not then there is a "Problem".
Close mafia and run 1.3 for character A. Is yeastRolls 1? If not then there is a "Problem".

Using SVN update from 1.3 to 1.4
Run 1.4 for character A. Is yeastRolls 1? If not then there is a "Problem".
Close mafia and run 1.4 for character B. Is yeastRolls 0? If not then there is a "Problem".

For extra credit create 1.5 and have it make the default for yeastRolls to be 2.
Using SVN update from 1.4 to 1.5
Run 1.5 for character A. Is yeastRolls 1? If not then there is a "Problem".
Close mafia and run 1.5 for character B. Is yeastRolls 2? If not then there is a "Problem".

In the above "Problem" means that the persistence mechanic (how and where values are stored) is not behaving as most people would want or expect.

I am confident that using zlib or vprops would not have this "Problem". When you say "The script has it's own properties to look at, so they are coded into the script itself. " it is not clear to me whether you address the "problem" or not. I will say that I am too lazy to implement something that allows for each character to have distinct values, allows for a default value if there is not character preference, preserves the user values when the script is updated and only uses the script file itself for preference storage, which is what I read your comment to say you did.
 
I am confident that using zlib or vprops would not have this "Problem". When you say "The script has it's own properties to look at, so they are coded into the script itself. " it is not clear to me whether you address the "problem" or not. I will say that I am too lazy to implement something that allows for each character to have distinct values, allows for a default value if there is not character preference, preserves the user values when the script is updated and only uses the script file itself for preference storage, which is what I read your comment to say you did.

If I'm reading your comment right, you won't use a script like this, because it has it's own preferences, and stores them inside mafia itself, instead of a separate file?

I'm not a "Great" script writer, and I've worked really hard by trial and error (more error than anything) my way into a few scripts. I'm trying my best to keep this one updated the best I can. (Thanks Taltamir for helping with bug updates!) I'm working to make the script better than what it was when I decided to take it over, and re-write it (which I think it is). I'm also trying to make it so everyone who uses it will enjoy it as much as I do. I enjoy writing scripts, and I enjoy the feedback I get on them, good or bad. Please don't take this as I'm upset by anything you've said, far from it, I appreciate the feedback!

PHP:
if (get_property("ps_preferences_set") == "true") {return;}
set_property ("ps_cheatdeckcard1", "ancestral recall"); 	// Three turns is great!
set_property ("ps_cheatdeckcard2", "island"); 			// 6 turns is even better!
set_property ("ps_cheatdeckcard3", "1952 Mickey Mantle"); 	// 10k meat is ALWAYS a nice bonus.  :)
set_property ("ps_spacegateVaccine", "3"); 			// 1 rainbow +3 each element resist, 2 +50% each stat, or 3 +30 monster level
set_property ("ps_manaburn", "true"); 				// set this to false if you don't want to burn your free MP restorers - TRUE SETTING WILL NOT USE MEAT!
set_property ("ps_geniewish1", "more wishes"); 
set_property ("ps_geniewish2", "more wishes"); 
set_property ("ps_geniewish3", "more wishes"); 
set_property ("ps_checkfamiliar", "true");		// set this to false if you don't want to know about familiar free drops, and free runaways
set_property ("ps_checksource", "true"); 		// set this to false if you don't want to know about your Source Terminal 
set_property ("ps_dailydeeds", "true");			// set this to false if you don't want to do all daily deeds
set_property ("ps_rollover", "turns"); 			// set this to turns for rollover turns, or pvp for pvp fights
set_property ("ps_preferences_set", "true");
print("prererences set", "green");
}

Here's the part of the script that sets the preferences. It's set once, and then it will never run this code again. These preferences will never be changed by me when I update the script. If the user wants to change them, then it must be done in mafia, not in the script.

I'm not sure if this answers your question or not. I've tested the script on multiple accounts, each with different settings, and it keeps the settings where they are. I fixed this issue a few versions ago. The script USED to set the preferences each time it was run, which I wasn't aware of at the time.

If it doesn't answer your question, then I'm sorry, I must not understand it completely.
 
If I'm reading your comment right, you won't use a script like this, because it has it's own preferences, and stores them inside mafia itself, instead of a separate file?

As suspected there is a vocabulary problem (or a reading comprehension problem on my part). "inside mafia itself" translates to me as using KoLmafia properties. But those properties ARE stored in a separate file, either the global or character specific settings file. So when you say "instead of a separate file" there is some confusion. Furthermore some of the previous comments suggested the preference values (even when changed) were in the script file (rollover.ash or whatever it is called). From a scripting level that is hard to do right and it could be argued that doing so is a demonstrably sub-optimal implementation.

That out of the way, I do have a preference for storing script variables somewhere besides "inside mafia itself". But that is a preference - sometimes I don't like my green beans touching my mashed potatoes - and it is an implementation detail that by itself would not prevent me from running a script that was otherwise of interest.

Now that we are on the same page I note you did start your preferences with "ps" so I should be able to easily clean out my settings file manually when the spirit moves me. I think, although I am not certain, that the code would pass all the tests I suggested. So, now that the smoke is cleared it appears that you have found a way to do what you, and most users, want.

:-)
 
It means it gives a weight of 100 to adventures and 1 to pvp. So +5 adv and =1 pvp fight would score 501. It is basically what I have in my logout script. Essentially resulting in maximising for adventures first, then pvp fights.
alright, thank you. that definitely sounds better like a better way of doing things.
as for the weights... well they can be inputted by the user. there is already an aspect of configuration where people choose pvp vs turns. so instead of doing that, put in a pair of numbers for weight.
edit: I missed a new page of posts, seems like script was already updated to use weight like that... so this is great.
I'm very aware of this. I fixed the issue in the script though, so it will only set the preferences once. Even when the script is updated. I've tested this myself.
oh, that is great, sorry for misunderstanding what you were saying.
 
Last edited:
script stopped working for some reason in latest mafia builds

Code:
[COLOR=olive]> call scripts\Rollover Management.ash[/COLOR]

Changing     "Miniature Sword & Martini Guy" to "Miniature Sword & Martini Guy"     would get rid of this message. (Rollover Management.ash, line 56)
[COLOR=red]Expected     }, found << (Rollover Management.ash, line 253)
[/COLOR]

incidentally, might want to change line 56 like it suggests.

also, I noticed it uses the maximizer command:
Code:
10 pvp fights, 1 adv
it would be better to use
Code:
10 pvp fights, 1 adv, -tie
this tells it to ignore items that have identical desired maximized stat to existing items. For some reason it doesn't do that by default and will flip around items with identical scores

likewise for adv optimization.
 
Last edited:
script stopped working for some reason in latest mafia builds

Code:
[COLOR=olive]> call scripts\Rollover Management.ash[/COLOR]

Changing     "Miniature Sword & Martini Guy" to "Miniature Sword & Martini Guy"     would get rid of this message. (Rollover Management.ash, line 56)
[COLOR=red]Expected     }, found << (Rollover Management.ash, line 253)
[/COLOR]

incidentally, might want to change line 56 like it suggests.

also, I noticed it uses the maximizer command:
Code:
10 pvp fights, 1 adv
it would be better to use
Code:
10 pvp fights, 1 adv, -tie
this tells it to ignore items that have identical desired maximized stat to existing items. For some reason it doesn't do that by default and will flip around items with identical scores

likewise for adv optimization.

Line 56 is a maffia bug. It's been reported long ago.

The rest of the changes have been made. Not sure why the script did what it did though...
 
The rest of the changes have been made. Not sure why the script did what it did though...
Thank you for the updates.
I got the new version, it is now failing with a different error
Code:
[COLOR=red]Function 'ps_rollover( )' defined multiple times     (Rollover Management.ash, line 449)[/COLOR]
I checked and there are indeed two different functions with that name
 
Last edited:
Thank you for the updates.
I got the new version, it is now failing with a different error
Code:
[COLOR=red]Function 'ps_rollover( )' defined multiple times     (Rollover Management.ash, line 449)[/COLOR]
I checked and there are indeed two different functions with that name

Hmm.. Bunch of odd errors. I updated the code. There was a big chunk that was copied, not sure how.

I ran the script with the updated code, and it works on my machine.
 
Hmm.. Bunch of odd errors. I updated the code. There was a big chunk that was copied, not sure how.

I ran the script with the updated code, and it works on my machine.
did you remember to upload the fixed version? I checked the website directly and it still shows 2 different functions called
void ps_rollover()

and a single spot that calls said function/s.
 
did you remember to upload the fixed version? I checked the website directly and it still shows 2 different functions called
void ps_rollover()

and a single spot that calls said function/s.

I sent the update yesterday, but for some reason it got kicked back. I sent it again today, and it looks like it went through this time. I downloaded a copy, and it came through as the right one.
 
You can still grab a Filthy Lucre
appears even if I have taken and completed all 3 bounties.

Today's Easy Bounty:You already took on an Easy Bounty today. Come back tomorrow for a new assignment!

Today's Hard Bounty:You already took on a Hard Bounty today. Come back tomorrow for a new assignment!

Today's Specialty Bounty:You already took on a Specialty Bounty today. Come back tomorrow for a new assignment!
I checked the wiki and doing bounties is the only source of filthy lucre./
 
appears even if I have taken and completed all 3 bounties.

I checked the wiki and doing bounties is the only source of filthy lucre./

I seem to remember the BHH only allowed 1 bounty per day. It used to take 200 days to get the familiar. Either that or I didn't do my research properly when I wrote the script.

Either way, script is updated
 
I seem to remember the BHH only allowed 1 bounty per day. It used to take 200 days to get the familiar. Either that or I didn't do my research properly when I wrote the script.

Either way, script is updated
Now that you mention it, I am also vaguely remembering such a thing. So either this was the case, or you just altered my memory.
fun fact, every time you recall a memory from the personal memory center of the brain, you modify and rewrite it; unlike other forms of memory such as skill memory (muscle memory), language, factoid (geography and the like), etc which are very stable.
Ignorance really is bliss.
 
Thanks for clarifying Drazil
I seem to remember the BHH only allowed 1 bounty per day. It used to take 200 days to get the familiar. Either that or I didn't do my research properly when I wrote the script.

Either way, script is updated
I tested the updated script. Now after I have taken and finished all 3 bounties it says
Code:
    You can still grab a [COLOR=#FF0000]Filthy Lucre[/COLOR] (speciality)
even though I already did today's speciality bounty
 
I noticed something odd, when maximizing pvp it tells me I will have 10 pvp tomorrow, even though it will actually be closer to 40
Code:
[COLOR=Blue]Maximizing PVP... .. This might take a moment, we have     a lot to check...[/COLOR]
Maximizing (1st time may take a while)...
1008     combinations checked, best score 41.00
Putting on psychic's circlet...
Equipment     changed.
Holding Mer-kin stopwatch...
Equipment changed.
Putting     on General Sage's Lonely Diamonds Club Jacket...
Equipment changed.
Putting     on aerogel ascot...
Equipment changed.
Putting on stainless steel     solitaire...
Equipment changed.
Putting on gold wedding ring...
Equipment     changed.
Maximizing...
2016 combinations checked, best score 326.00
Putting     on insulting hat...
Equipment changed.
Holding sturdy cane...
Equipment     changed.
Putting on Corporal Fennel's Lonely Clubs Club Jacket...
Equipment     changed.
Putting on psychic's pslacks...
Equipment changed.
Putting     on offensive moustache...
Equipment changed.
Putting on Bram's     choker...
Equipment changed.
Putting on hamethyst necklace...
Equipment     changed.
[COLOR=blue]Checking out the capmpground[/COLOR]
You     haven't used all of your [color=#FF0000]free rests[/COLOR]
[COLOR=blue]Checking     how you can LOUNGE around today...[/COLOR]
You can still relax in the [color=#FF0000]Hot     Tub[/COLOR] today
You can still [color=#FF0000]Play Pool[/COLOR]     today
You can still use your [color=#FF0000]Fax Machine[/COLOR]
[COLOR=green]Done     Lounging around, lets check some other stuff...[/COLOR]
[COLOR=blue]Your     wand is cold[/COLOR]
You can still [color=#FF0000]Summon a Demon[/COLOR]     today
You can still grab a [color=#FF0000]Filthy Lucre[/COLOR]     (speciality)
You can still play in the [color=#FF0000]ball pit[/COLOR]
You     can still receive a [color=#FF0000]"blessing"[/COLOR] from     the [color=#FF0000]Nuns[/COLOR]
You can still Check for a [color=#FF0000]Defective     Token[/COLOR]
[COLOR=Blue]Checking Familiars[/COLOR]
[COLOR=green]Done     checking familiars.[/COLOR]
You will receive 55 bonus MP at rollover,     for a total of 1658
[COLOR=green]You have chosen to maximize PVP     Fights.[/COLOR]
You will have 10 pvp fights after rollover. 10 fights     for rollover, 0 fights from gear and passive skills, 0 from left over     fights.
You will have 112 turns, after rollover. 40 turns for rollover,     26 turns from gear and passive skills, 35 from left over adventures.
Whatever     is in [color=#FF0000]Red[/COLOR] can still be addressed
[COLOR=purple]Rollover     Management complete, finished, done, concluded, ended, performed, it's a     wrap, all over, buttoned up[/COLOR]
[COLOR=purple]Th-th-th-that's     all folks![/COLOR]
0 fights from gear and passive skills is wrong. I actually ended up with gear that gives +24, in addition I have +5 from a skill, and I think +1 from a clan thing? not entirely sure. but it comes out to 40.

Also, it says I will get 26 turns from gear and passive skill and that seems like way too much considering I am not wearing any +adv gear. I think my skills give +3 adventures a day. there might be something in the clan that gives a little more, but it shouldn't add up to 26
 
I noticed something odd, when maximizing pvp it tells me I will have 10 pvp tomorrow, even though it will actually be closer to 400 fights from gear and passive skills is wrong. I actually ended up with gear that gives +24, in addition I have +5 from a skill, and I think +1 from a clan thing? not entirely sure. but it comes out to 40.

Also, it says I will get 26 turns from gear and passive skill and that seems like way too much considering I am not wearing any +adv gear. I think my skills give +3 adventures a day. there might be something in the clan that gives a little more, but it shouldn't add up to 26
I'm not sure what gear you have on when the script is done running, but you should check the next day, and see how many turns you have, to see if the script is right. I've looked over my code, and it looks right to me. It looks at everything. It uses mafia's built in maximizer to show turns from passive locations, from your clan, and from your gear. The only thing it doesn't look at is your campground, which the script looks at itself.
I will look into the other issue today, but the code looks right to me, and I've never had an issue with it.

Can you please tell me what gear you have on when this happens?
Also, in the CLI, type this, after you run the script, and let me know what the script says, and what this answer is
ash numeric_modifier("10 pvp fights, 1 adv, -tie");
 
Last edited:
Back
Top