TAD's Away Script v1.0.0.0

By Tamaki on Apr 05, 2009

This is a very simple away script. Even the coding isn't hard. Mainly for people who wish to learn more about scripting. However, YOU MUST HAVE TAD'S HOME INTEGRATION SCRIPT IN ORDER FOR THIS TO WORK: http://www.hawkee.com/snippet/4936/

To install, type /install away and follow the on-screen prompts.

To start-up, press F6 or type /imaway to start it up.

While you don't have to set an away or return message you can do so by clicking on settings.

Do not use while taking a shower.

dialog away {
  title Away Script
  option dbu
  size -1 -1 101 33
  button "Away", 1, 1 1 100 10
  button "Return", 2, 1 11 100 10, disable
  button "Settings", 3, 1 22 100 10
  menu "Help", 4
  item "Help", 5, 4
}

dialog away_settings {
  title Away Settings
  option dbu
  size -1 -1 101 55
  button "Set Away Message", 1, 1 1 100 10
  button "Set Return Message", 2, 1 11 100 10
  check "Return on Activity", 3, 1 22 100 10
  check "AMSG on event", 4, 1 33 100 10
  button "Back", 7, 1 44 100 10
  menu "Help", 5
  item "Help", 6, 5
}

on *:DIALOG:away:init:0: {
  If ($im_away == on ) {
    did -b away 1
    did -e away 2
  }
}

on *:DIALOG:away:sclick:1: {
  If ($im_away == on ) {
    echo -a You're already away!
    did -b away 1
    did -e away 2
  }
  Else {
    If ($away_message == $null) {
      away I am away from my computer right now.
    }
    Else {
      away $away_message
    }
    If ($amsg_on_event == on ) {
      If ($away_message != $null) {
        amsg I am away, Reason: $away_message
      }
      Else {
        amsg I am away, Reason: I am away from my computer right now.
      }
    }
    did -b away 1
    did -e away 2
    writeini away.ini status away on
    echo -a You are now marked as away.
  }
}

on *:DIALOG:away:sclick:2: {
  If ($im_away == on ) {
    away
    If ($amsg_on_event == on ) {
      If ($return_message == $null) {
        amsg I have returned from away.
      }
      Else {
        amsg $return_message
      }
    }
    writeini away.ini status away off
    echo -a You are no longer marked as being away.
    did -e away 1
    did -b away 2
  }
  Else {
    echo -a You're not marked as away!
    did -e away 1
    did -b away 2
  }
}

on *:DIALOG:away:sclick:3: {
  close away
  start away_settings
}

on *:DIALOG:away:menu:5: {
  echo -a For help, please open your Help Connection Center or type /server -m irc.authoritygamer.com -j #helpdesk
}

on *:DIALOG:away_settings:init:0: {
  If ($return_on_activity == on) {
    did -c away_settings 3
  }
  If ($amsg_on_event == on ) {
    did -c away_settings 4
  }
}

on *:DIALOG:away_settings:sclick:1: {
  dialog -i away_settings
  writeini away.ini settings away_message $?="Please enter your away message."
  dialog -e away_settings
  echo -a Your away message has been changed to: $away_message $+ .
}

on *:DIALOG:away_settings:sclick:2: {
  dialog -i away_settings
  writeini away.ini settings return_message $?="Please enter your return message."
  dialog -e away_settings
  echo -a Your return message has been changed to: $return_message $+ .
}

on *:DIALOG:away_settings:sclick:3: {
  If ($return_on_activity == on) {
    writeini away.ini settings return_on_activity off
  }
  Else {
    writeini away.ini settings return_on_activity on
  }
}

on *:DIALOG:away_settings:sclick:4: {
  If ($amsg_on_event == on ) {
    writeini away.ini settings amsg_on_event off
  }
  Else {
    writeini away.ini settings amsg_on_event on
  }
}

on *:DIALOG:away_settings:menu:6: {
  echo -a For help, please open your Help Connection Center or type /server -m irc.authoritygamer.com -j #helpdesk
}

on *:DIALOG:away_settings:sclick:7: {
  close away_settings
  start away
}

alias im_away {
  return $readini(away.ini,status,away)
}

alias away_message {
  return $readini(away.ini,settings,away_message)
}

alias return_message {
  return $readini(away.ini,settings,return_message)
}

alias return_on_activity {
  return $readini(away.ini,settings,return_on_activity)
}

alias amsg_on_event {
  return $readini(away.ini,settings,amsg_on_event)
}

on *:LOAD: {
  createlicense away
}

alias away_install {
  writeini away.ini status away off
  writeini away.ini status installed yes
  echo -a Away program install successfully, press F6 or type /imaway to start the away Program.
}

alias away_uninstall {
  remove away.ini
  echo -a Away program uninstall successfully, type /install away to reinstall the Away program.
}

on *:START: {
  If ($readini(away.ini,status,installed) == yes ) {
    If ($readini(away.ini,settings,auto_start) == yes ) {
      check away
    }
    Else {
      echo -a Press F6 or type /imaway to start the Away Program
    }
  }
  Else {
    echo -a Type /install away to install the Away Program
  }
}

on *:INPUT:*: {
  If ($im_away == on) {
    If ($return_on_activity == on ) {
      away
      writeini away.ini status away off
      If ($amsg_on_event == on ) {
        If ($return_message == $null ) {
          amsg I have returned to my computer.
        }
        Else {
          amsg $return_message
        }
      }
    }
  }
}

alias f6 {
  check away
}

alias imaway {
  check away
}

Comments

Sign in to comment.
Tamaki   -  Apr 06, 2009

a nick manager? what's the point, it's only for being away, and it doesn't amsg your status when you leave, because ur leaving?

i may not be getting what ur saying

 Respond  
Kinight   -  Apr 06, 2009

8 > You need to have a nick manager, and is it supposed to amsg my status when i leave? cuz it doesnt :\

 Respond  
Tamaki   -  Apr 06, 2009

the script is integrated in with TAD's integration script, i do this on purpose, really i do

 Respond  
Scakk   -  Apr 05, 2009

You said

"However, YOU MUST HAVE TAD'S HOME INTEGRATION SCRIPT IN ORDER FOR THIS TO WORK: http://www.hawkee.com/snippet/4936/"

Update that script with this so as not to waste people's time with needing to get two scripts just to make one work.

 Respond  
napa182   -  Apr 05, 2009

i agree with Scakk..

 Respond  
Tamaki   -  Apr 05, 2009

the integration script is used to help the scripting process go easier, if you don't believe me, look at the script yourself.

why not update what script? this is the 1st version of this script
and it's not filled with color and this is my script i made on hawkee...just an plain /amsg

 Respond  
Kinight   -  Apr 05, 2009

Yessssss i've been waiting a few hours for this! thanks man!

 Respond  
Aucun50   -  Apr 05, 2009

Seems like he want you to have his scripts to run other scripts of his, I don't see the reason for this. The script itself is good.

 Respond  
Scakk   -  Apr 05, 2009

Why do people post codes that you need to have something else to make it work? Also why nto just update the script it goes to??

 Respond  
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.