Update script notification

General discussion of Denizen-Bukkit, or even just Bukkit.
Post Reply
User avatar
Mwthorn
User
User
Posts: 39
Joined: August 6th, 2016, 8:35 am
Location: Roskilde, Sjælland, Denmark
Contact:

Update script notification

Post by Mwthorn » August 19th, 2016, 6:17 am

Since we have started to collect data on servers using <script-tracker>, could it then respond back to notify the server that there is a new version of the script to download?

And, if possible, it would be neat to type a command to automatically download the newest script available. To save time and easy updated to the latest version. (Maybe a script could do this?)

User avatar
Morphan1
Regular
Regular
Posts: 7
Joined: August 6th, 2016, 10:00 pm
Location: Florida
Contact:

Re: Update script notification

Post by Morphan1 » August 19th, 2016, 1:39 pm

I think there is something to check if you're using the latest scripts already, but we won't add automatic downloads. It's unsafe, as someone could easily add in a script that you don't want and you'd never know.
monkeybot wrote:(717) 2016/05/24 14:37:50 UTC-07:00 <Morphan1> I don't understand how any child could comprehend the flavor of a lighting effect

Anthony
Regular
Regular
Posts: 35
Joined: August 5th, 2016, 9:01 pm

Re: Update script notification

Post by Anthony » August 19th, 2016, 1:43 pm

My scripts already do this... in part. They will notify you if there's a new version of it available and give you a clickable link to the repo so you can download and install if you wish.

Image
We are the music makers, and we are the dreamers of dreams...

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 204
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Update script notification

Post by mcmonkey » August 19th, 2016, 5:08 pm

You can also at any time do:
/denizen scriptversions

To check the status of all properly configured repo scripts.
Denizen lead developer.
http://mcmonkey.org

User avatar
Mwthorn
User
User
Posts: 39
Joined: August 6th, 2016, 8:35 am
Location: Roskilde, Sjælland, Denmark
Contact:

Re: Update script notification

Post by Mwthorn » August 20th, 2016, 5:12 am

Morphan1 wrote:I think there is something to check if you're using the latest scripts already, but we won't add automatic downloads. It's unsafe, as someone could easily add in a script that you don't want and you'd never know.
Fair enough.
Anthony wrote:My scripts already do this... in part. They will notify you if there's a new version of it available and give you a clickable link to the repo so you can download and install if you wish.
Do you mind if I use this for my scripts? the procedure check for version
mcmonkey wrote:You can also at any time do:
/denizen scriptversions
To check the status of all properly configured repo scripts.
Neat :) Amazing that this exists in Denizen Builds for 1.8 as well

BlackCoyote
Regular
Regular
Posts: 78
Joined: August 6th, 2016, 1:44 am

Re: Update script notification

Post by BlackCoyote » August 20th, 2016, 5:23 am

Mwthorn wrote:
Anthony wrote:My scripts already do this... in part. They will notify you if there's a new version of it available and give you a clickable link to the repo so you can download and install if you wish.
Do you mind if I use this for my scripts? the procedure check for versionl
it requires the webget command from 1.10

Anthony
Regular
Regular
Posts: 35
Joined: August 5th, 2016, 9:01 pm

Re: Update script notification

Post by Anthony » August 20th, 2016, 6:41 am

Code: Select all

  updateCheck:
    - ^if !<server.has_flag[dRegions.Version.Repo]> {
      - ~webget "http://www.mcmonkey.org/denizen/repo/version/<s@dRegions_Version.yaml_key[id]>" save:page
      - ^flag server "dRegions.Version.Repo:<entry[page].result||unknown>" d:1h
      }
    - ^define repoVersion '<server.flag[dRegions.Version.Repo]||unknown>'
    - ^define currentVersion '<s@dRegions_Version.yaml_key[version]>'
    - ^if '%repoVersion%' == 'unknown' {
      - run s@msgPrefixed instantly 'def:dRegions|<&7>Unable to check for update! <&7><&o>%currentVersion%<&7> is installed!'
      }
      else if '%repoVersion%' > '%currentVersion%' {
      - run s@msgPrefixed instantly 'def:dRegions|<&7>Update from version <&o>%currentVersion%<&7> to <&o>%repoVersion%<&7>!'
      }
      else if '%repoVersion%' != '%currentVersion%' {
      - run s@msgPrefixed instantly 'def:dRegions|<&7>What happened? You are on version <&o>%currentVersion%<&7> and the repo says <&o>%repoVersion%<&7>!'
      }
We are the music makers, and we are the dreamers of dreams...

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 204
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Update script notification

Post by mcmonkey » August 20th, 2016, 5:33 pm

Anthony wrote:

Code: Select all

  updateCheck:
    - ^if !<server.has_flag[dRegions.Version.Repo]> {
      - ~webget "http://www.mcmonkey.org/denizen/repo/version/<s@dRegions_Version.yaml_key[id]>" save:page
      - ^flag server "dRegions.Version.Repo:<entry[page].result||unknown>" d:1h
      }
    - ^define repoVersion '<server.flag[dRegions.Version.Repo]||unknown>'
    - ^define currentVersion '<s@dRegions_Version.yaml_key[version]>'
    - ^if '%repoVersion%' == 'unknown' {
      - run s@msgPrefixed instantly 'def:dRegions|<&7>Unable to check for update! <&7><&o>%currentVersion%<&7> is installed!'
      }
      else if '%repoVersion%' > '%currentVersion%' {
      - run s@msgPrefixed instantly 'def:dRegions|<&7>Update from version <&o>%currentVersion%<&7> to <&o>%repoVersion%<&7>!'
      }
      else if '%repoVersion%' != '%currentVersion%' {
      - run s@msgPrefixed instantly 'def:dRegions|<&7>What happened? You are on version <&o>%currentVersion%<&7> and the repo says <&o>%repoVersion%<&7>!'
      }
Huh. Usually update checkers are just a !=, because versions only form valid numbers half the time.
Just look at the Denizen version: 0.9.8 - that's not a valid number, it has two decimals in it.
Denizen lead developer.
http://mcmonkey.org

Anthony
Regular
Regular
Posts: 35
Joined: August 5th, 2016, 9:01 pm

Re: Update script notification

Post by Anthony » August 20th, 2016, 8:50 pm

mcmonkey wrote:Huh. Usually update checkers are just a !=, because versions only form valid numbers half the time.
Just look at the Denizen version: 0.9.8 - that's not a valid number, it has two decimals in it.
Totally valid point. IF your version string is NAN than you won't be able to do numeric comparisons. That being said... i intentionally keep my version strings actual numbers so i can.

YMMV
We are the music makers, and we are the dreamers of dreams...

User avatar
Mwthorn
User
User
Posts: 39
Joined: August 6th, 2016, 8:35 am
Location: Roskilde, Sjælland, Denmark
Contact:

Re: Update script notification

Post by Mwthorn » August 22nd, 2016, 1:21 am

Using a numeric comparison version check, you could compare and show all the changes from the current version up to the newest.
This would allow a user to decide if the script should be updated or not (of course you should always update, right?).

BlackCoyote
Regular
Regular
Posts: 78
Joined: August 6th, 2016, 1:44 am

Re: Update script notification

Post by BlackCoyote » August 22nd, 2016, 1:22 am

Anthony wrote:
mcmonkey wrote:Huh. Usually update checkers are just a !=, because versions only form valid numbers half the time.
Just look at the Denizen version: 0.9.8 - that's not a valid number, it has two decimals in it.
Totally valid point. IF your version string is NAN than you won't be able to do numeric comparisons. That being said... i intentionally keep my version strings actual numbers so i can.

YMMV
I just keep my version strings actual numbers cuz its easier yolo

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest