TAD's Home Integration Script 4.0.1.1

By Tamaki on Aug 17, 2008

The latest and greatest version of TAD's Home Integration Script. The script encompasses many of the old features streamlined. Please refer to the following list of commands:

/start - Opens a dialog on the desktop if it isn't already open. If it is open, it closes it and then re-opens it.

/desk - Opens a dialog in the IRC window if it isn't already open. If it is open, it closes it and then re-opens it.

/close - Closes an open dialog if it is open. If it isn't open, then the script refers to the built-in /close command.

/minimize - Minimizes an open dialog or tells you it isn't open.

/restore - Restores a minimized dialog or tells you it isn't open.

/focus - Focuses on an id in a dialog or tells you the dialog isn't open.

/activate - Enables an id in a dialog or tells you the dialog isn't open.

/deactivate - Disables an id in a dialog or tells you the dialog isn't open.

/mark - Places a check mark or radio mark where appropriate or tells you the dialog isn't open.

/uncheck - Removes a check mark where appropriate or tells you the dialog isn't open.

/add - Adds text to an id in an open dialog or tells you the dialog isn't open.

/purge - Clears all text form an id in an open dialog or tells you the dialog isn't open.

/replace - Replaces any text with the text specified in the id of an open dialog or tells you the dialog isn't open.

/resize.d - Resizes a dialog based on the dbu option or tells you the dialog isn't open.

/resize.p - Resizes a dialog based on the pixel option or tells you the dialog isn't open.

/ok - Closes an open dialog box as though the user clicked the 'ok' button or tells you the dialog isn't open.

/cancel - Closes an open dialog box as though the user click the 'cancel' button or tells you the dialog isn't open.

/speak - Displays text in the currently active window.

This new integration upgrade requires the AGFile script which can be found here: http://www.hawkee.com/snippet/8236/

alias homeperm {
  If ($1 == version) { return 4.0.1.1 }
  If ($1 == title) { return TAD's_Home_Integration_Script }
  If ($1 == author) { return The_Almighty_Duelist }
  If ($1 == description) { return Integration Help Script for Dialogs. }
  If ($1 == product_id) { return N001-4011 }
}

alias start {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1- == $null) { echo 2 -a * /start: Missing dialog name. | halt }
  If ($dialog($1) == $1) { dialog -x $1 }
  dialog -md $1 $1
}

alias desk {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1- == $null) { echo 2 -a * /desk: Missing dialog name. | halt }
  If ($dialog($1) == $1) { dialog -x $1 }
  dialog -m $1 $1
}

alias close {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1- == $null) { echo 2 -a * /close: Missing dialog name. | halt }
  If ($dialog($1) == $1) { dialog -x $1 }
  Else { close $1- }
}

alias minimize {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1- == $null) { echo 2 -a * /minimize: Missing dialog name. | halt }
  If ($dialog($1) == $1) { dialog -i $1 | return }
  echo 2 -a * /minimize: dialog ' $+ $1 $+ ' isn't open.| halt 
}

alias restore {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1- == $null) { echo 2 -a * /restore: Missing dialog name. | halt }
  If ($dialog($1) == $1) { dialog -e $1 | return }
  echo 2 -a * /restore: dialog ' $+ $1 $+ ' isn't open. | halt
}

alias focus {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($2- == $null) { echo 2 -a * /focus: Missing parameters. /focus <name> <id> | halt }
  If ($dialog($1) == $1) { did -f $1- | return }
  echo 2 -a * /focus: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias activate {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($2- == $null) { echo 2 -a * /activate: Missing parameters. /activate <name> <id> | halt }
  If ($dialog($1) == $1) { did -e $1- | return }
  echo 2 -a * /activate: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias deactivate {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($2- == $null) { echo 2 -a * /deactivate: Missing parameters. /deactivate <name> <id> | halt }
  If ($dialog($1) == $1) { did -b $1- | return }
  echo 2 -a * /deactivate: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias mark {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($2- == $null) { echo 2 -a * /check: Missing parameters. /check <name> <id> | halt }
  If ($dialog($1) == $1) { did -c $1- | return }
  echo 2 -a * /check: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias uncheck {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($2- == $null) { echo 2 -a * /uncheck: Missing parameters. /uncheck <name> <id> | halt }
  If ($dialog($1) == $1) { did -u $1- | return }
  echo 2 -a * /uncheck: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias add {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($3- == $null) { echo 2 -a * /add: Missing parameters. /add <name> <id> <info> | halt }
  If ($dialog($1) == $1) { did -a $1- | return }
  echo 2 -a * /add: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias purge {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($2- == $null) { echo 2 -a * /purge: Missing parameters. /purge <name> <id> | halt }
  If ($dialog($1) == $1) { did -r $1- | return }
  echo 2 -a * /purge: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias replace {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($3- == $null) { echo 2 -a * /replace: Missing parameters. /replace <name> <id> <new info> | halt }
  If ($dialog($1) == $1) { did -ra $1- | return }
  echo 2 -a * /replace: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias resize.d {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($5- == $null) { echo 2 -a * /resize.d: Missing parameters. /resize.d <name> <x y w h> | halt }
  If ($dialog($1) == $1) { dialog -sd $1- | return }
  echo 2 -a * /resize.d: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias resize.p {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($5- == $null) { echo 2 -a * /resize.p: Missing parameters. /resize.p <name> <x y w h> | halt }
  If ($dialog($1) == $1) { dialog -sp $1- | return }
  echo 2 -a * /resize.p: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias ok {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1 == $null) { echo 2 -a * /ok: Missing parameters. /ok <name> | halt }
  If ($dialog($1) == $1) { dialog -k $1 | return }
  echo 2 -a * /ok: dialog ' $+ $1 $+ ' isn't open. | halt 
}

alias cancel {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1 == $null) { echo 2 -a * /cancel: Missing parameters. /cancel <name> | halt }
  If ($dialog($1) == $1) { dialog -c $1 | return }
  echo 2 -a * /cancel: dialog ' $+ $1 $+ ' isn't open. | halt 
}

on *:LOAD: {
  echo 2 -a TAD's Home Integration Script (C) $+ $asctime(yyyy) DJ Bill Enterprizes
  If ($readini(agfile.ini,home,installed) != yes) {
    agfile register home $homeperm(version) $homeperm(title) $homeperm(author) yes $homeperm(description)
    echo -a Please type /install home to install TAD's Home Integration Script.
  }
  Else {
    If ($agversion(home) != $homeperm(version)) {
      agfile update home $homeperm(version) $homeperm(title) $homeperm(product_id) $homeperm(author) yes $homeperm(description)
      exit -nr
    }
  }
}

on *:START: {
  echo 2 -a TAD's Home Integration Script (C) $+ $asctime(yyyy) DJ Bill Enterprizes
  If ($readini(agfile.ini,home,installed) != yes) {
    agfile register home $homeperm(version) $homeperm(title) $homeperm(author) yes $homeperm(description)
    echo -a Please type /install home to install TAD's Home Integration Script.
  }
  Else {
    If ($agversion(home) != $homeperm(version)) {
      agfile update home $homeperm(version) $homeperm(title) $homeperm(product_id) $homeperm(author) yes $homeperm(description)
      exit -nr
    }
  }
}

alias speak {
  If ($readini(agfile.ini,home,installed) != yes) { halt }
  If ($1 == $null) { echo 2 -a * /speak: Missing paramaters: /speak <info> | halt }
  echo 2 -a $1-
}

alias home {
  If ($1 == install) {
    agfile install home $homeperm(product_id)
    writeini agfile.ini status installing no
  }
  If ($1 == update) {
    agfile update home $homeperm(version) $homeperm(title) $homeperm(product_id) $homeperm(author) yes $homeperm(description)
    writeini agfile.ini status updating no
  }
  If ($1 == register) {
    agfile register home $homeperm(version) $homeperm(title) $homeperm(author) yes $homeperm(description)
    echo 2 -a Registration complete! You may now type /install home
  }
  If ($1 == uninstall) {
    agfile uninstall home
    echo 2 -a Uninstall complete!
  }
}

dialog home {
  title Home
  option dbu
  size -1 -1 -1 -1
}

on *:DIALOG:home:init:*: {
  dialog -x home
}

Comments

Sign in to comment.
Tamaki   -  Dec 21, 2010

-edit-
Updated and streamlined. Now required the AGFile script which can be found here: http://www.hawkee.com/snippet/8236/

Will continue to update all other scripts to fit the new format. (With the exception of Staff Bot 5.2 and earlier)

 Respond  
Tamaki   -  May 20, 2009

-edit-
Revamped script completely, see description for more detail, will work on all previous script to reflect new TAD's Integration Script.

 Respond  
Tamaki   -  Mar 15, 2009

-edit-
Incorporated the ability to detect whether or not a window is already open. If a window is open that you want opened, it will close the window and reopen it to bring it to the front.
Will need an updated version off all previous scripts if you install this script

 Respond  
Tamaki   -  Mar 06, 2009

-edit-
Added a more simplified error checker. Either type /error to bring up dialog to enter code, or type /error <code 1> <code 2> and the script will return the error message.

 Respond  
Tamaki   -  Mar 01, 2009

-edit-
Added an error checker. More interactive than most. When an error message appears (example Error 002 00001), simply type /error and a dialog will appear. Simply provide in the spaces available. You will get another error code or message if you don't provide a correct error code.

All scripts that require this script will still work! This update is only to help you in-case you get an error message.
 Respond  
Tamaki   -  Feb 23, 2009

All of the useless and not needed scripting is there for 'integration'. supposed to make it easier to script. you only use what you need. most scripts that i post and bots will use this script and yes %uninstall.code will come in handy later on in life....trust me on this.
the @uninstall event:
If ($1- == $null ) {
echo -a Please type a command after this. This is the same command you used to install the program.
}.....
this is not done automatically (this is also apart of the uninstall script)
The only thing this really does is disable the script you are trying to uninstall
don't fret...this isn't the only upgrade to this script i'll be making...when i learn how to use $sockets i'll host script from another site using the integration script
but nobody said you have to use my scripts (obv)

 Respond  
Vox91   -  Feb 20, 2009

There is no point to the license part in the script cause it will auto do that on loading the script so there is no point for that.

  If ($1- == $null ) {
    echo -a Please type a command after this. This is the same command you used to install the program.
  }
  Else {

No check if it is the correct word from %uninstall.code?

@ uninstall event:

set %uninstall.code

useless because no check after reinstalling.

There is allot of not needed scripting in this script. and first release your bot before posting this cause it is no useless...
3/10

 Respond  
Tamaki   -  Jan 10, 2009

-edit-
I realized just how much this script was broken. Have made many fixes. NO MORE NEED TO INSTALL this program. It will install itself upon loading into your remotes. This code will no longer work with any previous scripts. Will update all other scripts when I get around to them.

You must have this script to operate Staff Bot 3 which will come out soon! (Hopefully)

For all services questions, you must install the Help Connection Center (which is included with Staff Bot 3). And will be available shortly after this update has been posted.

 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.