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

Thread: Sounds and Alerts in ASH Scripts and CLI

  1. #1

    Default Sounds and Alerts in ASH Scripts and CLI

    Is there a way to trigger a beep or other feedback in scripts? Iím thinking along the lines of
    Code:
    tput bel
    in ncurses. It would be very helpful to know when a script finishes or needs my attention.

    I know there is a setting to make KoLmafia beep when you receive a message in chat. This is the same sort of thing.

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

    Default

    Is there a way to trigger a beep or other feedback in scripts? I’m thinking along the lines of
    Code:
    tput bel
    in ncurses. It would be very helpful to know when a script finishes or needs my attention.

    I know there is a setting to make KoLmafia beep when you receive a message in chat. This is the same sort of thing.
    Originally Posted by Saklad5 View Post
    If you can make chat beep, why not just send yourself a private message?
    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.

  3. #3

    Default

    I suppose that is possible, but that would be a really crude way of doing it. Is there really no other option?

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

    Default

    Is there really no other option?
    Originally Posted by Saklad5 View Post
    Write it yourself and submit a patch or convince someone that this is interesting enough to them to get them to implement it.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  5. #5
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,390

    Default

    Write it yourself and submit a patch or convince someone that this is interesting enough to them to get them to implement it.
    Originally Posted by fronobulax View Post
    If there was a patch to allow scripts to make an audible bell, I would quickly disable it on my local compile.

  6. #6

    Default

    Certain scripts take a while to run, and it is inconvenient to have to check it repeatedly to see if everything is done. It’d be even better if it could send HTTP packets or run a user-defined program (the way you can currently set a text editor and a web browser) so I could have proper alerts, but that seems well beyond the scope of KoLmafia.

    I see no reason that this sort of behavior would have to be enabled by default, by the way. I propose implementing it as an ASH function that returns a boolean: true if the beep was successful, false if such behavior is disabled.

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

    Default

    inconvenient
    Originally Posted by Saklad5 View Post
    That word is coming perilously close to "annoying" as a word that signals a sense of entitlement that is going get me to ignore a request.

    You have a means of getting what you want which you have dismissed as "too crude".

    Write it yourself and submit a patch or convince someone that this is interesting enough to them to get them to implement it.
    Originally Posted by fronobulax View Post
    That still seems like the best advice since you have not convinced me it is worth my time and no other dev has seen fit to comment.

    Since I don't speak ncurses, what exactly are you looking for? An ash command that causes a single beep? A KoLmafia preference that detects when a script stops running and emits a beep? Something else?
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  8. #8
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    813

    Default

    Certain scripts take a while to run, and it is inconvenient to have to check it repeatedly to see if everything is done. It’d be even better if it could send HTTP packets or run a user-defined program
    Originally Posted by Saklad5 View Post
    perhaps a clever use of visit_url() will get you what you want?

  9. #9

    Default

    I tried that almost immediately, but it seems like it operates under the assumption that the URL is (URL pointing to KoLmafia relay local server)/(input). I might have misunderstood the documentation, though: I’ll revisit it and see if I can get Pushover notifications working. I think a command to produce a beep would still be welcome, though.

    Edit:

    OK, I managed to get that working, (thanks for the advice that prompted me to check again) which is quite useful for my own purposes. Not everyone is familiar with using APIs like that, however.
    Last edited by Saklad5; 05-22-2018 at 09:05 PM.

  10. #10

    Default

    “tput bel” is a command included with practically every UNIX-like OS, and it simply makes the terminal produce a bell noise. I actually had to look up what it is from, since I am not familiar with ncurses either.

    As for your comment about “inconvenient”, that’s actually the opposite of what I am trying to say when I use the word. I’m trying to make it clear that I do not consider this an essential feature, and I do not expect it to be treated as such. Sorry for the miscommunication.

    There’s nothing wrong with rejecting a request, by the way. I am suggesting it because I would like to see it, I feel it is within the scope of the project, and no one else has suggested it. This is a request, not a demand. If you do reject this, the project is better for it having been proposed: it will prevent others from suggesting this in the future, since it has already been discussed.

    As for being worth a dev’s time, I could still write a patch once it is clear it would be accepted. It would just be time-consuming for me to test this on multiple systems (as opposed to multiple people testing it on their own systems), so I’d rather not commit to that before debating its merits.

    And yes, I feel that generating a substantial queue of unread messages from myself to myself is not an ideal solution. I might try it, but it would be better to have a specific command. Especially for those that do not want chat messages to beep.
    Last edited by Saklad5; 05-22-2018 at 08:08 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
  •