Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 32

Thread: whichplace Relay Overrides

  1. #1
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default whichplace Relay Overrides

    Jick's place.php thing, while no doubt wonderfully effective for refactoring the game on the back end, is troublesome to the usefulness of KoLmafia's relay override scripts. Things like manor.php use to be just fine. Now we need to have a relay for place.php since its address is place.php?whichplace=spookyraven1 and could make it difficult for the user to also have an override for place.php?whichplace=KOLHS, just to name two scripts I use. I've got them sorted out by using a place.php override that does this:

    PHP Code:
    import "manor.ash";
    import "kolhs.ash";

    void main() {
        switch(
    form_field("whichplace")) {
        case 
    "spookyraven1"main@manor();
            break;
        case 
    "KOLHS"main@kolhs();
            break;
        }

    Let's face it, this solution is kinda kludgy. I would like to propose a better solution KoLmafia could implement. I believe someone mentioned this idea in some thread somewhere, but pardon me for not giving proper credit to the original proposal.

    In the relay directory should be a subdirectory /relay/whichplace and in that subdirectory, an override called spookyraven1.ash would be applied as a relay override to place.php?whichplace=spookyraven1. If we did this, all place.php locations could play nicely with each other, without troubling the user to untangle the knot of overrides as I did in the previous example.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  2. #2
    Developer
    Join Date
    Aug 2009
    Posts
    2,722

    Default

    Ooh, a similar feature would be sweet for choice.php (whichchoice).

    Also this feature would be awesome.

  3. #3
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    Ooh, a similar feature would be sweet for choice.php (whichchoice).
    Originally Posted by heeheehee View Post
    Yes! That too!
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  4. #4
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    766

    Default

    Also:
    shop.php (whichshop)
    store.php (whichstore)
    peevpee.php (place)

    Also, I third the awesomeness of this feature.
    Also, There are probably more I am forgetting... I'll keep poking my brain and the game to see if I can find more.

  5. #5

    Default

    If there are going to be 10 different cases where this applies, then the idea of using subfolders seems less appealing.

  6. #6
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    How about just automagically loading spookyraven1.ash for whichplace=spookyraven1?

  7. #7
    Developer
    Join Date
    Aug 2009
    Posts
    2,722

    Default

    If there are going to be 10 different cases where this applies, then the idea of using subfolders seems less appealing.
    Originally Posted by lostcalpolydude View Post
    Better organization of scripts is a bad thing?

    How about just automagically loading spookyraven1.ash for whichplace=spookyraven1?
    Originally Posted by roippi View Post
    Too much magic makes my head hurt

  8. #8
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,765

    Default

    How about just automagically loading spookyraven1.ash for whichplace=spookyraven1?
    Originally Posted by roippi View Post
    Devil's avocado:
    Code:
    spookyraven.ash/whichplace/1.ash
    >:-D
    Last edited by xKiv; 02-12-2014 at 05:13 PM. Reason: no :D

  9. #9

    Default

    Better organization of scripts is a bad thing?
    Originally Posted by heeheehee View Post
    I haven't looked at any approach to coding this, but my first thought is that the folder names would be hardcoded somehow in mafia.

  10. #10
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    3,873

    Default

    Better organization of scripts is a bad thing?
    Originally Posted by heeheehee View Post
    If the definition of "better" requires a directory structure that makes sense to some and is counter intuitive to others, may, or may not, have to deal with operating system file system quirks to work reliably everywhere, and adds another layer that has to be checked and verified when things appear to break, then "bad" might be an appropriate description.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

Similar Threads

  1. Bale's Relay Overrides
    By Bale in forum Relay Override Scripts
    Replies: 290
    Last Post: 01-06-2018, 04:09 AM
  2. Feature choice Relay Overrides
    By ckb in forum Bug Reports
    Replies: 26
    Last Post: 03-06-2016, 06:56 PM
  3. Feature - Implemented Execute relay overrides in error state
    By Bale in forum Bug Reports
    Replies: 8
    Last Post: 08-12-2013, 05:58 AM
  4. Replies: 1
    Last Post: 08-28-2011, 07:47 PM
  5. Info Request: Relay Overrides & fight.php
    By StDoodle in forum Scripting Discussion
    Replies: 2
    Last Post: 11-17-2010, 03:03 PM

Posting Permissions

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