[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Alias/timer/trigger script callbacks
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Alias/timer/trigger script callbacks
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (19,384 posts)  [Biography] bio   Forum Administrator
Date Sat 13 Feb 2010 10:10 PM (UTC)  quote  ]
Message
I think a while ago all those functions were changed to accept the internal names (so you could use GetAliasList for example).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 13 Feb 2010 09:19 PM (UTC)  quote  ]
Message
Also GetAliasOption and the like as well, I hope? Both *Option and *Info work this way in the current version, I want to make sure it wasn't changed inadvertently.

(Actually, I imagine that any Alias, Trigger, or Timer function that accepts a name should work as expected, not just the Option/Info ones)


Also: Thanks, Nick!

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,384 posts)  [Biography] bio   Forum Administrator
Date Sat 13 Feb 2010 09:05 PM (UTC)  quote  ]
Message
It wasn't easy to do, but I have incorporated this suggestion in version 4.50. [commit 2919843]

The main problem was that trigger/alias/timer *pointers* were being passed around, which means that at that stage they are divorced from whatever name they were stored in the map with.

Now every trigger/timer/alias script function should be given a non-empty name, with the first character being "*" if the name was not assigned by a human. This name can be used in GetTriggerInfo, GetTimerInfo, GetAliasInfo.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 13 Feb 2010 08:31 PM (UTC)  quote  ]
Message
Right, yeah. Anyone who did that would be crazier than I am.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sat 13 Feb 2010 08:19 PM (UTC)  quote  ]

Amended on Sat 13 Feb 2010 08:22 PM (UTC) by Worstje

Message
I was indeed talking about if-checks like 'if name ~= "" then DoDifferentStuffWithValidName(name) else DoWeirdStuffForUnnamedThingy(name) end' :)
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 13 Feb 2010 07:07 PM (UTC)  quote  ]

Amended on Sat 13 Feb 2010 07:08 PM (UTC) by Twisol

Message
Worstje said:
However, in cases that people do use the name to radically change the logic of a trigger

It's not so much about treating unnamed triggers differently than treating them all the same, whether they're named or not.

EDIT: In the case that you're talking about other people who check "" - it's not quite clear which you meant - and treat them differently based on that, then I agree.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Errorman   (1 post)  [Biography] bio
Date Sat 13 Feb 2010 09:57 AM (UTC)  quote  ]
Message
hello ;)
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sat 13 Feb 2010 09:14 AM (UTC)  quote  ]
Message
Good idea. Never needed it, but I don't see any harm for plugin compatibility in practice. The chance someone will check for an empty name when handling the trigger script will not be likely to contain specialized handling, only handling for not calling a dozen functions which would obviously not work with an empty name.

However, in cases that people do use the name to radically change the logic of a trigger, I have to both question the sanity of using the same trigger for named and unnamed triggers, as they clearly aren't much alike. As a temporary solution, such scripts should be adjusted to check the first few lines of the script for *alias/*trigger, or maybe a plain * as I don't think it is an allowed character for names anyhow.
[Go to top] top

Posted by Fadedparadox   USA  (91 posts)  [Biography] bio
Date Sat 13 Feb 2010 04:21 AM (UTC)  quote  ]
Message
Agreed.
[Go to top] top

Posted by Rakon   USA  (123 posts)  [Biography] bio
Date Sat 13 Feb 2010 04:16 AM (UTC)  quote  ]
Message
I'd like this as well. A lot of my triggers/aliases are not named.

Alternatively, I'd be happy if say, the error returned the 'match' and 'sequence' number of a trigger, or alias. This would also help immensely.

Yes, I am a criminal.
My crime is that of curiosity.
My crime is that of judging people by what they say and think, not what they look like.
My crime is that of outsmarting you, something that you will never forgive me for.
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 13 Feb 2010 04:06 AM (UTC)  quote  ]
Message
When calling the function named in the 'script' field of aliases/timers/triggers, would it be possible to send the internal name, regardless of whether it's not named? To be clear, I meant that if you have an unnamed alias, I want to be sent "*alias1234" as the name, not "" (empty string). This is important so I can get at the details/options of the alias that was used, regardless of the status of its name.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,480 views.

[New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]