Page 5 of 7 FirstFirst ... 3 4 5 6 7 LastLast
Results 41 to 50 of 69

Thread: Rollover Management

  1. #41
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    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).
    Originally Posted by taltamir View Post
    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.
    Originally Posted by fronobulax View Post
    That's what I do now. The script has it's own properties to look at, so they are coded into the script itself.
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  2. #42
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,093

    Default

    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.

  3. #43
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    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.
    Originally Posted by fronobulax View Post
    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 Code:

    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.

  4. #44
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,093

    Default

    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?
    Originally Posted by Pazleysox View Post
    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.

    :-)
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  5. #45
    Senior Member
    Join Date
    Oct 2017
    Posts
    220

    Default

    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.
    Originally Posted by Darzil View Post
    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.
    Originally Posted by Pazleysox View Post
    oh, that is great, sorry for misunderstanding what you were saying.
    Last edited by taltamir; 04-25-2018 at 04:34 PM.

  6. #46
    Senior Member
    Join Date
    Oct 2017
    Posts
    220

    Default

    script stopped working for some reason in latest mafia builds

    Code:
    > call scripts\Rollover Management.ash
    
    Changing     "Miniature Sword & Martini Guy" to "Miniature Sword & Martini Guy"     would get rid of this message. (Rollover Management.ash, line 56)
    Expected     }, found << (Rollover Management.ash, line 253)
    
    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 by taltamir; 05-30-2018 at 06:58 AM.

  7. #47
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    script stopped working for some reason in latest mafia builds

    Code:
    > call scripts\Rollover Management.ash
    
    Changing     "Miniature Sword & Martini Guy" to "Miniature Sword & Martini Guy"     would get rid of this message. (Rollover Management.ash, line 56)
    Expected     }, found << (Rollover Management.ash, line 253)
    
    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.
    Originally Posted by taltamir View Post
    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...
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  8. #48
    Senior Member
    Join Date
    Oct 2017
    Posts
    220

    Default

    The rest of the changes have been made. Not sure why the script did what it did though...
    Originally Posted by Pazleysox View Post
    Thank you for the updates.
    I got the new version, it is now failing with a different error
    Code:
    Function 'ps_rollover( )' defined multiple times     (Rollover Management.ash, line 449)
    I checked and there are indeed two different functions with that name
    Last edited by taltamir; 05-31-2018 at 04:25 AM.

  9. #49
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    Thank you for the updates.
    I got the new version, it is now failing with a different error
    Code:
    Function 'ps_rollover( )' defined multiple times     (Rollover Management.ash, line 449)
    I checked and there are indeed two different functions with that name
    Originally Posted by taltamir View Post
    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.
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  10. #50
    Senior Member
    Join Date
    Oct 2017
    Posts
    220

    Default

    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.
    Originally Posted by Pazleysox View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •