Server Sync Rate

By Tamaki on Jan 11, 2009

This is a dialog based sync rate to your server. There maybe some glitches...please let me know.

YOU MUST HAVE TAD'S HOME INTERGRATION SCRIPT IN ORDER FOR THIS SCRIPT TO WORK. YOU CAN FIND IT HERE: http://www.hawkee.com/snippet/4936/

This will determine your sync rate and echo it if you choose, including if there is a netsplit. If you don't like your current sync rate (or if it drops to 0) you can resync by clicking the button on the dialog. TO OPEN THE DIALOG: type /sync

To install:

  1. Load into your remotes.

  2. Click 'yes' to initialization.

  3. Type /install sync

  4. Follow all on-screen prompts.

To start:

Type /install sync

IF YOU ARE HAVING ANY PROBLEMS AND CANNOT WAIT FOR ME TO RESPOND:
You may contact me via the Help Connection Center. You can find it here:
http://www.hawkee.com/snippet/5590/

-edit-
Is now ready for the new TAD's Integration Script

on *:LOAD: {
  createlicense sync
  echo -a Type /install sync to install the Sync Rate Program
}

on *:START: {
  If ($readini(sync.ini,status,installed) == yes ) {
    If ($readini(sync.ini,settings,auto_start) == yes ) {
      check sync
    }
    Else {
      echo -a Type /sync to start up the Sync Rate Program
    }
  }
  Else {
    echo -a Type /install sync to install the Sync Rate Program
  }
}

alias sync_install {
  writeini sync.ini status installed yes
  set %echo.sync no
  set %echo.split no
  set %netsplit no
  set %sync.rate 0
  echo -a Type /sync to run the Sync Rate Program.
}

alias sync_uninstall {
  remove sync.ini
  unset %echo.sync
  unset %echo.split
  unset %netsplit
  unset %sync.rate
  echo -a Uninstalled! Please type /install sync to reinstall
}

alias sync {
  check sync
}

dialog sync {
  title Sync Rate
  option dbu
  size -1 -1 51 42
  check "Echo Sync Rate", 1, 1 1 50 10
  check "Echo Netsplit", 2, 1 11 50 10
  text "Sync Rate", 3, 1 21 30 10
  edit %sync.rate, 4, 31 21 19 10, read
  button "Resync", 5, 1 31 50 10
}

on *:DIALOG:sync:*:0: {
  If ($devent == init ) {
    If (%echo.sync == yes ) {
      did -c sync 1
    }
    If (%echo.split == yes ) {
      did -c sync 2
    }
    resync
  }
  Elseif ($devent == close ) {
    set % $+ sync $+ _open no
  }
}

on *:DIALOG:sync:sclick:1: {
  If (%echo.sync == yes ) {
    did -u sync 1
    set %echo.sync no
  }
  Else {
    did -c sync 1
    set %echo.sync yes
  }
}

on *:DIALOG:sync:sclick:2: {
  If (%echo.split == yes ) {
    did -u sync 2
    set %echo.split no
  }
  Else {
    did -c sync 2
    set %echo.split yes
  }
}

on *:DIALOG:sync:sclick:5: {
  resync
}

alias resync {
  If ($server != $null ) {
    If (%echo.sync == yes ) {
      did -c sync 1
    }
    Else {
      did -u sync 1
    }
    If (%echo.split == yes ) {
      did -c sync 2
    }
    Else {
      did -u sync 2
    }
    If (%netsplit == yes ) {
      did -ra sync 4 0
      set %sync.rate 0
    }
    Else {
      did -ra sync 4 100
      set %sync.rate 100
    }
    echo -a Resync has been completed. Sync Rate is: %sync.rate
    If (%sync.rate <= 0 ) {
      set %sync.rate 100
      reresync
    }
  }
  Else {
    echo -a You are not connected to any server.
    did -ra sync 4 0
    set %sync.rate 0
  }
}

alias reresync {
  resync
}

on *:QUIT: { 
  If (.net isin $1) || (.com isin $1) || (.org isin $1) || (.irc isin $1) && (.net isin $2) || (.com isin $2) || (.org isin $2) || (.irc isin $2) && (!$3-)) {
    set %netsplit yes
    If (%echo.split == yes ) {
      echo -a There is a netsplit coming in between $1 and $2
    }
    resync
  }
  Else {
    If (ping isin $2) {
      set %sync.rate $calc(%sync.rate - 10)
      did -ra sync 4 %sync.rate
    }
    If (pipe isin $2 ) {
      set %sync.rate $calc(%sync.rate -5 )
      did -ra sync 4 %sync.rate
    }
    If (user isin $2 ) {
      set %sync.rate $calc(%sync.rate -1 )
      did -ra sync 4 %sync.rate
    }
    set %netsplit no
    If (%echo.sync == yes ) {
      echo -a Sync Rate is: %sync.rate
    }
    If (%sync.rate <= 0 ) {
      resync
    }
  }
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.