Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Clan Fortune Script

  1. #1
    Junior Member
    Join Date
    Feb 2018
    Posts
    19

    Default Clan Fortune Script

    I'm going to give it an update later, but I made a script for the Clan Fortune. Lets you set default answers, send requests and responses. It's all CLI atm.
    Here's a link to the info on it:
    https://github.com/stewbeef/clanfortune/tree/readme

    Probably going to give it an update in a couple days and split it back into multiple files (right now it is a compilation of 3 files since I have a couple files I made for different helper functions).

    Edit: It still needs a bit of work behind the scenes, but it should do everything in the readme just fine. This is my first script I've made public.
    Last edited by Stewbeef; 02-22-2018 at 08:47 AM.

  2. #2
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,377

    Default

    2538 lines! And so many one line functions.

    There is some weird handling of "defaults". For one, they aren't set automatically, which to me isn't a default. Yet, doing "defaults,info" will set them. Also, to me the words "answer" and "response" mean the same thing, so I found it very confusing, but you documented it clearly, so I finally got things right. Anyway...

    Here's what I really came here to say:
    Code:
    import clanfortune.ash
    
    void main()
    {
        chat_private("Easyfax", "fortune");
        waitq(9);
        clanfortune_parse("clan,Easyfax,pizza,batman,thick");
    }
    I'm not announcing this widely, because I'm not sure how well it will work. If this is too much stress for Easyfax, I might have to turn it off. Oh, and it is very ugly. Neither side actually listens for a message, they both just wait and hope things are ready in time. Easyfax waits 10 seconds, but because chat messages are slow, you don't get that long.

  3. #3
    Junior Member
    Join Date
    Feb 2018
    Posts
    19

    Default

    Yeah, I couldn't think of a better way to describe "answer" and "response". Maybe I should have used "submit" and "response"? Does that sound clearer?

    I guess I didn't want to hardcode the defaults a particular person uses, since a given clan might decide on a different set of defaults. Maybe that was a mistake though. Hmm, I'll do an update at some point that will do that, and only use the manually set items if they have been specified.

    Thanks for the feedback.

    Edit. It's long because I have some helper code for various projects and I just put them all together in one file. So a fair amount of it isn't used. I am going to switch it to using dependencies at some point so that there isn't a whole bunch of other stuff and it is easier to maintain.
    One line functions are mostly in case those functions are passed variables in a different form (e.g. string for an item instead of an item variable), then it converts them. I guess I like doing that since it makes using those functions easier if I import it or some other part of the code calls it.
    Last edited by Stewbeef; 02-24-2018 at 03:23 AM.

  4. #4
    Junior Member
    Join Date
    Oct 2017
    Posts
    22

    Default

    I installed it today, took me a while to figure out how to set up as I assumed I typed in what it want.
    Either way, now it works like a charm and I wrote an own .ash file with 3 lines to send and respond automatically on logon.

    Thank you sir/madame, it is appreciated!

  5. #5
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    347

    Default

    I tried this script, and I'm extremely confused as to how to get the NPC buffs.

  6. #6
    Junior Member
    Join Date
    Feb 2018
    Posts
    19

    Default

    I tried this script, and I'm extremely confused as to how to get the NPC buffs.
    Originally Posted by Pazleysox View Post
    Sorry for the delay in the response, I've been very busy lately IRL.

    You need to make sure there are no spaces when you do the commands.
    > clanfortune npc,meat
    -- that gets you the meat buff.
    but
    > clanfortune npc, meat
    -- that does nothing


    I will try to release a new version this weekend that's a bit easier. I'll make it so you don't need to have the "npc" part and so that it trims off leading and trailing spaces.
    There are some other checks and improvements I want to make, such as allowing a list of guild contacts. If the first one can't be reached (not in guild or you are still awaiting a response), then it will try the next one on the list, and so on.

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

    Default

    Very cool. This whole thing in my opinion can be made easier to understand if you highlight the commands to type, and make them shorter. Changing npc,meat to just meat would simplify things. There are other things I would change to make understanding easier, but I do love the script! I incorporated it to be used by my clan bot, and it runs great.

  8. #8

    Default

    Thanks for the script!

    Currently I'm sending the fortune requests to the same person 3 times. Is it possible to run the script with delay in between?

    As a temporary workaround, I'm currently using this - I'm a newbie at coding for kolmafia so pardon if my script is bad.
    Basically I used quicksend 3 times with delay in between.

    Note: I've yet to fully test it out yet, because I used up my 3 fortune requests on trying out the original script and realising it does not have delay.

    cli_execute {
    /whitelist bonus
    clanfortune quicksend
    wait 3
    clanfortune quicksend
    wait 3
    clanfortune quicksend
    /whitelist ferengi
    }

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

    Default

    Code:
    cli_execute {
     /whitelist bonus
     clanfortune quicksend
     wait 3
     clanfortune quicksend
     wait 3
     clanfortune quicksend
     /whitelist ferengi
     }
    Originally Posted by littlereddot11 View Post
    Here's how I would do that same script.

    Code:
    void main()
    {
    cli_execute ("/whitelist bonus");
    cli_execute ("fortune quicksend");
    wait (5;)
    cli_execute ("fortune quicksend");
    wait (5);
    cli_execute ("fortune quicksend");
    cli_execute ("/whitelist ferengi");
     }

    First, the command is "fortune (XXX)" not clanfortune (XXX). Second wait (X); needs to be it's own command, it's not a cli command. I would put a delay of at least 5, unless the bot is super fast
    Last edited by Pazleysox; 04-07-2018 at 01:32 PM.

  10. #10
    Senior Member
    Join Date
    Jun 2016
    Posts
    180

    Default

    Wait is totally a valid cli command, so either version should work.

Posting Permissions

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