Closed Thread
Results 1 to 15 of 828

Thread: Basilisk extended downtime 08/09/2017

Hybrid View

  1. #1
    Newbie
    Join Date
    Jan 2017
    Posts
    3
    Play Stats
    Inactive
    Quote Originally Posted by jharmison View Post
    If you have *nix (or whatever generic access to something BASH-like), you could install an MTA and do this:
    Made a little powershell script for people who don't have a Linux box -

    Code:
    $sound = new-Object System.Media.SoundPlayer;
    $webclient = New-Object System.Net.WebClient
    $webClient.DownloadFile("http://www.wavsource.com/snds_2017-07-30_6786517629734627/movies/star_wars/chewy.wav", "$pwd\upsound.wav")
    $sound.SoundLocation="$pwd\upsound.wav";
    
    while ($true) {
      $url = "https://www.swgemu.com/status/basilisk.xml"
      $contents = $webclient.DownloadString($url)
      $down = Select-String -Pattern "down" -InputObject $contents
      $up = Select-String -Pattern "up" -InputObject $contents
      $locked = Select-String -Pattern "lock" -InputObject $contents
    
      if ($up.length -gt 0) {
        Write-Host("The server is UP!")
        $sound.Play();
      }
      if ($down.length -gt 0) {
        Write-Host("The server is still down.")
      }
      if ($locked.length -gt 0) {
        Write-Host("The server is LOCKED, interesting...")
      }
      Start-Sleep -s 30
    }
    Downloads a chewy wav file, then checks every 30 seconds to see if it's up, down, or locked. If it's up it'll play the chewy sound (every 30 seconds). If you hit ctrl+c it'll end it.

    To use this just copy (ctrl+c) the code and open notepad. Paste it into notepad, then save that as "CheckSwg.ps1" (without the quotes) - you should save it to your documents or something. Can't just upload it somewhere for download, Windows will understandably complain if you download a powershell script and try to run it. Obviously run at your own risk, but you can clearly read what it's doing there.

    Then browse to wherever you saved it (preferably your Documents) and right click it, and click "Run With Powershell" and a window will open and start checking every 30 seconds.

    Edit: fixed a bug
    Last edited by spiceymeme; 08-11-2017 at 09:00 PM.

  2. #2
    Member rwp389's Avatar
    Join Date
    Dec 2006
    Location
    Chattanooga, TN
    Posts
    355
    Play Stats
    Inactive
    Quote Originally Posted by spiceymeme View Post
    Made a little powershell script for people who don't have a Linux box -

    Code:
    $sound = new-Object System.Media.SoundPlayer;
    $webclient = New-Object System.Net.WebClient
    $webClient.DownloadFile("http://www.wavsource.com/snds_2017-07-30_6786517629734627/movies/star_wars/chewy.wav", "$pwd\upsound.wav")
    $sound.SoundLocation="$pwd\upsound.wav";
    
    while ($true) {
      $url = "https://www.swgemu.com/status/basilisk.xml"
      $contents = $webclient.DownloadString($url)
      $down = Select-String -Pattern "down" -InputObject $contents
      $up = Select-String -Pattern "up" -InputObject $contents
      $locked = Select-String -Pattern "lock" -InputObject $contents
    
      if ($up.length -gt 0) {
        Write-Host("The server is UP!")
        $sound.Play();
      }
      if ($down.length -gt 0) {
        Write-Host("The server is still down.")
      }
      if ($locked.length -gt 0) {
        Write-Host("The server is LOCKED, interesting...")
      }
      Start-Sleep -s 30
    }
    Downloads a chewy wav file, then checks every 30 seconds to see if it's up, down, or locked. If it's up it'll play the chewy sound (every 30 seconds). If you hit ctrl+c it'll end it.

    To use this just copy (ctrl+c) the code and open notepad. Paste it into notepad, then save that as "CheckSwg.ps1" (without the quotes) - you should save it to your documents or something. Can't just upload it somewhere for download, Windows will understandably complain if you download a powershell script and try to run it. Obviously run at your own risk, but you can clearly read what it's doing there.

    Then browse to wherever you saved it (preferably your Documents) and right click it, and click "Run With Powershell" and a window will open and start checking every 30 seconds.

    Edit: fixed a bug
    All you have to do is put your social security number in for the password! Make sure to include DOB lol
    Lonstetti Gorhime
    Gruka Gorhime
    Drop Off: BH Armor Depot CNET 300 -5572

  3. #3
    Newbie
    Join Date
    Oct 2011
    Posts
    11
    Play Stats
    Inactive
    Quote Originally Posted by spiceymeme View Post
    Made a little powershell script for people who don't have a Linux box -

    Code:
    ...Microsofty bits...
    Downloads a chewy wav file, then checks every 30 seconds to see if it's up, down, or locked. If it's up it'll play the chewy sound (every 30 seconds). If you hit ctrl+c it'll end it.

    To use this just copy (ctrl+c) the code and open notepad. Paste it into notepad, then save that as "CheckSwg.ps1" (without the quotes) - you should save it to your documents or something. Can't just upload it somewhere for download, Windows will understandably complain if you download a powershell script and try to run it. Obviously run at your own risk, but you can clearly read what it's doing there.

    Then browse to wherever you saved it (preferably your Documents) and right click it, and click "Run With Powershell" and a window will open and start checking every 30 seconds.

    Edit: fixed a bug
    Two things:
    1. If that "Chewy wav file" isn't really Rick Astley I'd be upset.
    2. This is maybe useful, if you want to be alerted when not around to get rick-rolled: https://www.pdq.com/blog/powershell-...message-gmail/

    Quote Originally Posted by Vlada View Post
    They don't need to go out to drink. Drinking at home is perfectly acceptable.
    Obligatory relevant xkcd.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

     

Posting Permissions

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