Feature Event()

icon315

Member
I think that there should be a command, sort of like print(), but one that announces (like when you receive a message). That way when the Main interface is minimized, one can know when something is done.
 
You mean something like using event("Yo! You found a foon! Script complete!"); would give in chat:
Code:
[clan]JoeSchmoe: Blah blah blah
[COLOR="green"]Yo! You found a foon! Script complete![/COLOR]
[clan]MeMyselfI: Hey! I found a foon! My life's dream is acheived!
Or did you mean something else?
 
I think it's supposed to be one of them event notification popups that appears, but I do like Fluxxdog's example as well. Making Mafia print to chat might be slightly difficult, though.
 
Either way is good, i was thinking more of the pop-up thought.
This could also be used for update messages, such as:
PHP:
if (index_of(visit_url("http://kolmafia.us/showthread.php?t=X"), "Y</b>") == -1)
{
	Event("There is a new version available - go download the next version of snapshot.ash at http://kolmafia.us/showthread.php?t=X!");
}
 
Last edited:
Ugh, I hate popups. But sometimes, there really isn't a better way, I suppose. I confess I've even desired this once or twice. You know, I'd probably be more comfortable with this request being fulfilled if there was a user or global preference that controlled whether event() went to a popup or the CLI. And any script author who changes that preference in-script gets dunked in acid. ;)
 
The reason is that, as a user, I don't want popups. There will doubtless be scripts that I'd find useful, but for the inevitable and annoying popups. As a user, I'd vastly prefer the ability to suppress them.
 
I normally don't like popups but my particular use case makes them acceptable because I want to be alerted and a popup is more persistent and less prone to be unintentionally ignored compared to a print to the CLI or an audio beep. Big point is that I want the alert.

If event() is an Ash command then I see no reason to add the extra baggage of making mafia support a suppression preference. If you hate popups and a script writer uses them then you certainly have the option to edit the script and/or express your preference to the maintainer of the script just in case they listen to users. For me, that is preferable because appears to have lower impact on the KoLmafia code base.
 
Yeah it could be like
PHP:
string announce = true/*false*/;
void main() {
//Stuff which
//the script does
//and other stuff
if (announce == true)
Event("Script is done, check on the results")
else
print("Script is done, but you won't know that til you open the Cli, that is what you get for turning announce off")
}
 
The reason is that, as a user, I don't want popups. There will doubtless be scripts that I'd find useful, but for the inevitable and annoying popups. As a user, I'd vastly prefer the ability to suppress them.

I agree that the ability to suppress popups is good. I also agree that the ability to create popups is good. It's amusing that I approve of both views. I think if this feature is added to mafia, a preference to suppress popups (mafia's existing popup as well as popups created by this command) should be added as well. That would be a double-win.
 
I agree that the ability to suppress popups is good. I also agree that the ability to create popups is good. It's amusing that I approve of both views. I think if this feature is added to mafia, a preference to suppress popups (mafia's existing popup as well as popups created by this command) should be added as well. That would be a double-win.

What would happen if the popups are turned off and the script being used uses Event()? would it just print? or do nothing?
 
Print, in my opinion. If you're automating and logging the gCLI output, you don't want a popup window to stop your automation (especially if it's running on a schedule), but it's still important to let the person know something happened.
 
Interesting. What I (or my clannie wants) is a pop up when not automating or something that would stop automation. Curiously the latter could be met by a goal of "can equip Stainless steel shillelagh" which, with a little spading is already available as a goal of "muscle 30".
 
Well, that's doable with current functions.
Code:
if(can_equip($item[stainless steel shillelagh])){
     if(user_confirm("You can now equip a stainless steel shillelagh! Wield it?")){
          equip($item[stainless steel shillelagh]);}}
And it'll pause until you click yes or no and then go right back to adventuring. This is very simplistic, but it is more foundation than anything. Have fun tweaking ;)
 
So overall you guys are giving this Thumbs Up, Right?

Not sure. I think there are actually two separate requests. One is for a listener type function that will trigger when an event occurs regardless of whether the user is adventuring with automation or in the relay browser. The other is a display function that will either pop up a window and display a string or display a string in the CLI, with the choice being determined by a per user preference.
 
Back
Top