Page 1 of 21 1 2 3 11 ... LastLast
Results 1 to 10 of 204

Thread: Script Registry -- for script authors; track your script usage

  1. #1
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,490

    Default Script Registry -- for script authors; track your script usage

    Script Registry 1.9
    For script authors

    As a script author, I enjoy using the "notify" command at the top of my scripts. Then when someone uses my script, I get a kmail letting me know that someone liked my script enough to use it. The cockles of my heart are warmed. But, what to do with all these notification kmails? Surely they can serve some purpose besides just cockle-warming...

    And so, Script Registry was born.

    What does it do?
    In a nutshell, Script Registry allows you to keep a record of the information provided by the "notify" command. This record is kept on a remote server and is accessible from within the script or on a public web page (see below).

    Every time you use the script, it parses your kmail and registers any appropriate information. After successfully registering the information, it deletes the kmails that it successfully parsed, then generates a report showing your current script use information.

    The Script Registry Site
    The information that is gathered by the use of this script is viewable on a public web site. It is my desire that this information be useful to the scripting community. Authors can track the use of their script, check to see if a certain script already exists, and find scripts that are useful to other players. Script users can find scripts that are useful to other players, or experienced authors from whom to request scripting assistance. It is currently hosted here:

    Script Registry Online

    Details
    The "notify" command has long been available in mafia. If you write "notify <playername>;" at the top of your script (before any other commands), you will receive automated kmails from other mafia users when they use your script for the first time. It will say "I have opted to let you know that I have chosen to run <scriptname.ash>. Thanks for writing this script!"

    Registry will recognize those kmails and (if you have already registered a script by that name) record who used your script, and when. It then deletes the kmail.

    I must emphasize that this script is only useful for script authors who use the "notify" command at the top of their scripts. Even then, your information will not be recorded unless you first register your script using a simple command.

    Registry Commands
    You can instruct Registry.ash to do certain things by sending yourself a kmail containing certain commands. Registry.ash will follow these commands when it parses your kmail.

    • [register scriptname] - This is the most important command. Registry will not record anything for scripts unless they have been registered. Example: [register myscript.ash]
    • [unregister scriptname] - Use this command to delete a script you have registered from the registry. At present, scripts cannot be unregistered if they have more than one registered user. Example: [unregister myscript.ash]
    • [url for scriptname is url] - You can use this command to register a URL for your script. Ideally, that would be the URL where the script can be downloaded (most likely here). Visitors to the Registry website will be able to follow that URL to download your script. Example: [url for myscript.ash is http://kolmafia.us/showthread.php?t=1234]


    You can have as many of these commands as you like in a single kmail, in any order, but each command does need its own set of square braces.

    How to use it:
    • Make sure your published script(s) correctly use the "notify" command.
    • Download Registry.ash.
    • Make sure you also have ZLib.
    • Register your script(s) using the [register scriptname] command (see above).
    • Regularly run this script to record and delete your notification kmails. I recommend adding it to your login script.


    Changelog
    3.31.08 - ver. 1.0 posted.
    4.22.09 - 1.1 changes: fixed URL for version checking due to new forum software. Don't bork on filenames not including "scripts" now that the notify command does not include path info.
    6.26.09 - 1.2 changes: integrated ZLib and made the available optimizations -- now uses improved version-checking and has cleaner string-parsing sections.
    8.07.09 - 1.3 changes: fix a possible index-out-of-bounds error that could occur when notification kmails were forwarded.
    12.30.09 - 1.4 changes: fixes dealing with mafia's changed handling of ints and strings. Use ZLib's new vprint().
    5.01.11 - 1.5 changes: use ZLib's new load_kmail() for great justice. Only parse registry commands from yourself.
    5.02.11 - 1.6 changes: using the api.php method of accessing kmail, links in message text are not clicky. Account for that when registering URLs.
    6.15.11 - 1.7 changes: now uses ZLib's lovely process_kmail() for another drastic reduction in size! Further, using my regex tongs in a controlled environment I reworked the parsing to use matchers (*shudder*), so you can now include any number of commands in your kmail, and they will all be parsed in the correct order (unregisters, then registers, then urls).
    10.24.12 - 1.8 changes: need 'www' in the url after nameserver change.
    10.18.17 - 1.9 changes: 'http' -> 'https'
    Attached Files
    Last edited by zarqon; 10-17-2017 at 05:14 PM.
    Sig by JakAtk
    My scripts: Prefref Plus | One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  2. #2
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

    Default Re: Script Registry 1.0 -- for script authors; track your script usage

    Nice script. Now I just wish I had remembered to put notifiy on my earlier scripts!

    This won&#039;t count multiple notifies from the same user right?

  3. #3
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,490

    Default Re: Script Registry 1.0 -- for script authors; track your script usage

    In the event of multiple notifies from the same user, it simply reports that that user has already been registered. This still counts as a successful parse, so it will delete that notification kmail.
    Sig by JakAtk
    My scripts: Prefref Plus | One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  4. #4
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

    Default Re: Script Registry 1.0 -- for script authors; track your script usage

    I don&#039;t know if this would be a pain in the butt or not, but do you think it would be possible to make it so that we could do either of the following things:
    1) Send a kmail to ourselves with some sort of tag (like the ones already implemented) that would let us add text at the top, under our name. Such as, I collect balls, and I know that a few other script writers around here collect particular items, I would like to be able to add a line or two about how if anyone felt like donating things to us here is a list of items we collect or what-have-you. And 2nd maybe be able to send a bit of text to attach it&#039;s self to the script it&#039;s self... such as current ver. number, updates, documentation etc. It wouldn&#039;t really have to be anything too intricate, just one set of plain text the scripter could use to write whatever information they felt was important.

    And BTW, i really like the site and idea.

  5. #5
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,490

    Default Re: Script Registry 1.0 -- for script authors; track your script usage

    Interesting ideas, Para...

    1) That&#039;s possible to include a short bit of author information, like a tagline or what have you to personalize things a bit. I&#039;ll take a look at adding that soon.

    2) If you want to include version information or documentation, do it a) in your script, or b) here! That&#039;s why you have the option of providing a link, so anyone interested can check here to make sure they have the latest version, or to figure out how to use it. Registry does not attempt (or want) to be a replacement site to this one.

    (For anything other than really simple scripts, I recommend that all scripts include version info in the script. You could also include version checking by using visit_url() in the script to check your script&#039;s thread for version info, then alerting your users if there is an update. See the original idea, or see any of my scripts for a simplified adaptation of that idea.)

    Thanks for the feedback!
    Sig by JakAtk
    My scripts: Prefref Plus | One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  6. #6
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,490

    Default

    1.1 Updates!

    A handfulk of script authors seem to be finding this useful, so I'm posting about this update since the version checking (broken since the forum change) wouldn't tell you.

    Perhaps a week or two back, the notify command was altered so as not to include path info in the sent kmails. This resulted in a lot of notifications not being parsed correctly. This annoyance has gone on long enough. I finally fixed it today, so those of you who enjoy this functionality can have it back once more.

    While I was at it, I fixed the version checking so further update posts such as this one should be unneccessary.
    Sig by JakAtk
    My scripts: Prefref Plus | One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  7. #7
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,270

    Default

    This is kinda cool... I think I might try out the notify command again now that I've noticed it (since notify now works properly).
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  8. #8
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,270

    Default

    I was wrong about it being kinda cool. Actually it's extremely cool. It's fun seeing my list of registered users increase when someone's mafia sends me mail.

    Mafia will only send a message the first time someone runs the script and I used notify on my script once before so those people aren't sending me new messages, but fortunately I'd saved those mails in a text file in case I was ever curious about them. It wasn't too hard to modify your script to read in the old messages using file_to_map so I was able to get those old registrations into your database.

    Fun and informative. Turns the annoyance of notify messages into a pleasure.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  9. #9
    Senior Member bumcheekcity's Avatar
    Join Date
    Mar 2009
    Posts
    1,401

    Default

    Yo zarqon. I'm trying to use this, but the script just keeps printing:

    <html><body>This script is only accessible from <a href="http://kolmafia.sourceforge.net/">KoLmafia</a>.</body></html>
    But I AM using it from KolMafia...?

  10. #10
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,270

    Default

    Maybe you ought to explain how you are trying to use it. Give details 'cause I can't wait to hear!
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


Similar Threads

  1. Replies: 1
    Last Post: 09-28-2015, 11:43 PM
  2. Official script registry - discussion
    By roippi in forum Scripting Discussion
    Replies: 84
    Last Post: 03-03-2014, 11:45 PM
  3. Replies: 0
    Last Post: 02-19-2012, 10:11 PM
  4. Don't ignore me! (attn: script authors)
    By StDoodle in forum Scripting Discussion
    Replies: 3
    Last Post: 11-21-2011, 03:08 PM
  5. usage of hermit script, the item
    By Spiny in forum Community Support
    Replies: 2
    Last Post: 10-06-2009, 08:07 AM

Posting Permissions

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