!------------------------------------------------------------------------------!
!                               mIRC-Agent v1.1a                               !
!                                 by Dan Miles                                 !
!                            dmiles@geekatlarge.net                            !
!                  http://www.geekatlarge.net/irc/mirc-agent/                  !
!------------------------------------------------------------------------------!

!------------------------------------------------------------------------------!
! CONTENTS                                                                     !
!------------------------------------------------------------------------------!

     Contents
     Preface
     Section I: Prerequisites
     Section II: Commands
          Control Commands
          Action Commands
          Remote Control Commands
     Section III: Menus
     Section IV: Installation
     Section V: Additional Information
          Users & Access Levels
          How To Get Help

!------------------------------------------------------------------------------!
! PREFACE                                                                      !
!------------------------------------------------------------------------------!

This all started when a friend of mine said "Hey, mIRC has agent support now." I
think I said "What support?".

So he pointed me to a web site and I read all about Microsoft Agents. I set out
to write a short script that would utilize the text-to-voice functions of Agent,
and it just snowballed from there.

Now this script supports almost every aspect of the Agent program, and also
includes a series of "remote control" functions which allow you to mess around
with your friends agents (which can be absolutely hysterical if you've had 
enough beer...).

Since there's no money in mIRC scripts I release all the code below to the
public domain, do with it as you please. I request, however, that you give some
credit if you decide to use any of my effort in different script of your own.

To the best of my knowledge this code is perfectly safe. However, I do not 
assume any responsibility for the effect this script may have on your computer,
so if you install it on your system and green smoke comes pouring out of the 
floppy drive and you find that you can't access any of your data and you mom 
calls you and asks you why you keep sending porn to her e-mail address don't 
come running to me.

(If that's not clear enough perhaps this will be: I am no in any way liable for
any damages, loss of data, loss of life, loss of limb, loss of property, loss of
money, anguish, despair, depression, social awkwardness, or anything else that
might result, directly or indirectly, as a result of running this script)

Remember, the best rule of thumb you can follow to avoid having problems is to 
NEVER INSTALL ANYTHING ON YOUR SYSTEM THAT YOU DON'T UNDERSTAND. Remember, There
about a billion ways for someone to have modified it between when it left my
computer and when it arrived on yours.


!------------------------------------------------------------------------------!
! SECTION I: PREREQUISITES                                                     !
!------------------------------------------------------------------------------!

You will need to following software installed to use this script:

     mIRC 32 - The most current version available as of this time is v5.7.
     mIRC is available at http://www.mirc.com/
               
     Microsoft Agent - All the text to speed conversion, animations, etc are
     part of the microsoft agent distribution. You can get Microsoft Agent at 
     http://msdn.microsoft.com/workshop/imedia/agent/agentdl.asp
     
          Download and install the following MS agent files:
     
          Microsoft Agent Core Components (msagent.exe)
          Microsoft Agent Character Files (genie.exe)
                                          (merlin.exe)
                                          (peedy.exe)
                                          (robby.exe)
          Lernout & Hauspie TruVoice Text-To-Speech Engine (english)
                                          (tv_enua.exe)
                                          
Once you've got everything installed your ready to proceed. Section II is an
overview of the commands available to you. Section III is an overview of the
menus. Section IV includes the script itself and some information about
defining users.


!------------------------------------------------------------------------------!
! SECTION II: COMMANDS                                                         !
!------------------------------------------------------------------------------!

CONTROL COMMANDS
----------------

Control commands are related to the basic functionality of the agent. Using the
control commands you can turn your agent off and on, and control the various
aspects of the agents functionality.

/summon <agent>
     Summon agent specified by <agent> argument. Valid arguments: Genie, Merlin,
     Peedy, and Robby.
     
     ex. /summon merlin       (agent merlin will be loaded)
         
/dismiss
     Dismiss active agent.
     
     ex. /dismiss             (current agent will be unloaded)
     
/agentchannel <#channel>
     Agent will monitor the specified channel,
     
     ex. /agentchannel #mirc  (agent will read all text from channel #mirc)

/agentmonitor <on/off>
     Enable or disable agent channel text-to-speech conversion.
     
     ex. /agentmonitor on     (agent will read text from channel)
         /agentmonitor off    (agent will not read text from channel)
     
/agenttext <on/off>
     Show text balloons. (display spoken output must be enabled in agent 
     settings, otherwise it will act as though it is always off)
   
     ex. /agenttext on        (agent will show text in a speech balloon)
         /agenttext off       (agent will not show text in a speech balloon)

/agentthink <on/off>
     Show thought balloons when text-to-speech conversion is disabled.
   
     ex. /agentthink on       (agent will show text in a thought balloon)
         /agentthink off      (agent will not show text in a thought balloon)

/agentremote <on/off>
     Allow remote users to control your agent. (remote users will be able to
     make your agent change, move, resize, and speak)
     
     ex. /agentremote on      (remote users can control your agent)
         /agentremote off     (remote users can not control your agent)

/agentsync <on/off> <nickname>
     Synchronize your agent with a remote agent of specified user.
     
     ex. /agentsync on roofuss (synchronize with user roofuss)
         /agentsync off       (desynchronize with user)

/agentadduser <nickname>
     Add specified user to your access list.

     ex. /agentadduser roofuss (add roofuss to you access list)

/agentdeleteuser <nickname>
     Delete specified user from your access list.
     
     ex. /agentdeleteuser roofuss
                              (remove roofuss from your access list)

/agentshowusers
     Show all users on your access list.
     
     ex. /agentshowusers      (users will be listed in #channel)

/agentskip
     Skip current agent request in buffer.
     
     ex. /agentskip           (agent will stop processing current action)

/agentclear
     Clear all agent requests from buffer, but continue to accept agent
     requests.
     
     ex. /agentclear          (agent will clear all actions from buffer)

/agentdefaults
     Reset agent variables to default. Usually this is only used from within the
     script itself, can be used from the command line if you quickly want to
     reset to the scripts defaults.
     
     ex. /agentdefaults       (agent variables will be reset to their default
                              settings)

/agentunload
     This will unload the agent.ini script, effectively disabling all aspects of
     the agent.
     
     ex. /agentunload         (agent.ini is unloaded disabling agent control)

/agentabout
     Shows script version information.

     ex. /agentabout          (show version information)

/agenthelp
     Shows a brief help file.
     
     ex. /agenthelp           (shows help files)


ACTION COMMANDS
---------------         

Action commands are related to the movement and personality of your agent. You
can use the action commands to move the agent around the screen, run agent
animations, and make your agent talk.

/agenthide
     Agent will hide in the background.
     
     ex. - /agenthide         (agent hides)

/agentshow
     Agent will appear in the foreground.

     ex. - /agentshow         (agent appears)

/agentmove <type> <h> <v>
     Cause agent to move to specified preset or coordinates. Valid types: home,
     custom.
     
     ex. /move home           (move the agent to home coordinates)
         /move custom 800 50  (move the agent to 800 horizontal, 50 vertical)


/agentpoint <type> <h> <v>
     Cause agent to point to specified preset or coordinates. Valid types: left,
     right, up, down, custom.
     
     ex. /point left          (agent gestures to it's left)
         /point custom 500 500
                              (agent gestures to coordinates 500h 500v)
     
/agentlook <type>
     Cause agent to look in the specified direction. Valid types are: left,
     right, up, & down.
     
     ex. 

/agentsize <type> <h> <v>
     Cause agent to point to specified preset or coordinate based size. Valid 
     types: left, right, down, up, custom.
     
     ex. /point left          (agent gestures to it's left)
         /point custom 500 500
                              (agent gestures to coordinates 500h 500v)

/agentaction <action>
     Cause agent to perform the specified action(s). (up to 10 actions can be
     queued on the same line)
     
     Some valid actions include:
     
          Acknowledge              Alert               Announce
          Blink                    Confused            Decline
          DontRecognize            Explain             GetAttention
          GetAttentionContinued    GetAttentionReturn  Greet
          LookDown                 LookLeft            LookRight
          LookUp                   DoMagic1            DoMagic2
          Pleased                  GestureDown         GestureLeft
          GestureRight             GestureUp           Process
          Read                     ReadContinued       ReadReturn
          RestPose                 Sad                 Search
          StopListening            Suggest             Think
          Wave
          
     ex, /agentact suggest    (agent runs the "suggest" animation)
         /agentact getattention getattentioncontinued getattentionreturn
                              (agent runs each animation sequentially)

/agentsay <text>
     Cause agent to speak the specified text.
     
     ex. /agentsay hello, I am an agent!
                              (agent will say "Hello, I am an agent!")


REMOTE CONTROL COMMANDS
-----------------------

Remote control commands are related to your ability to control an agent on
someone elses machine. In order for the remote control commands to work the
remote agent must have remote control enabled.

/remoteagentstatus <nickname>
     Check the status of an agent on a remote machine. If remote control is
     enabled you will be notified, additionally, if an agent is activated you
     will be notified which agent is loaded.
     
     ex. /remoteagentstatus roofuss
                              (returns agent status for user roofuss)
     
/remoteagentsummon <nickname> <agent>
     Works like the /summon command with the addition of a remote username.
     
     ex. /remoteagentsummon roofuss merlin
                              (cause the agent merlin to be loaded on roofusss 
                              machine)

/remoteagentdismiss <nickname>
     Works like the /dismiss command with the addition of a remote username.
     
     ex. /remoteagentdismiss roofuss merlin
                              (cause the current agent on roofusss machine to be
                              unloaded)

/remoteagenthide <nickname>
     Works like the /agenthide command with the addition of a remote username.
     
     ex. /remoteagenthide roofuss
                              (cause the current agent on roofusss machine to 
                              hide)

/remoteagentshow <nickname>
     Works like the /agentshow command with the addition of a remote username.
     
     ex. /remoteagentshow roofuss
                              (cause the current agent on roofusss machine to
                              appear)

/remoteagentmove <nickname> <type> <h> <v>
     Works like the /agentmove command with the addition of a remote username.
     
     ex. /remoteagentmove roofuss home
                              (cause the current agent on roofusss machine to
                              move to the home coordinates)
         /remoteagentmove roofuss custom 800 50
                              (cause the current agent on roofusss machine to
                              move to the specified coordinates)

/remoteagentpoint <nickname> <type> <h> <v>
     Works like the /agentpoint command with the addition of a remote username.
     
     ex. /remoteagentpoint roofuss left
                              (cause the current agent on roofusss machine to 
                              point to the left)
         /remoteagentpoint roofuss custom 500 500
                              (cause the current agent on roofusss machine to 
                              point towards the specified coordinates)

/remoteagentlook <nickname> <type>
     Works like the /agentlook command with the addition of a remote username.
     
     ex. /remoteagentlook roofuss left
                              (cause the current agent on roofusss machine to
                              look to the left)

/remoteagentsize <nickname> <type> <h> <v>
     Works like the /agentsize command with the addition of a remote username.
     
     ex. /remoteagentsize roofuss huge
                              (cause the current agent on roofusss machine to be
                              huge!)     
         /remoteagentsize roofuss custom 650 650
                              (cause the current agent on roofusss machine to be
                              650 pixels wide and 650 pixels tall)

/remoteagentaction <nickname> <action>
     Works like the /agentaction command with the addition of a remote username.
     
     ex. /remoteagentaction roofuss suggest
                              (cause the current agent on roofusss machine to
                              execute the "suggest" animation)
         /remoteagentaction roofuss domagic1 domagic2
                              (cause the current agent on roofusss machine to
                              execute all the specified animations)

/remoteagentsay <nickname> <text>
     Works like the /agentsay command with the addition of a remote username.
     Additionally, the agent will indicate who sent the message.
     
     ex. /remoteagentsay roofuss Hello buddy!
                              (cause the current agent on the remote machine to
                              say "Roofuss says... Hello buddy!")


!------------------------------------------------------------------------------!
! SECTION III: MENUS                                                           !
!------------------------------------------------------------------------------!

CHANNEL/MENUBAR MENU
--------------------

This is the primary control menu for your agent. The menu can be accessed by
right clicking on the channel window or from the menubar/commands menu. These
commands are all representative of their respective command line commands, as
represented below.

[Square Brackets] indicate an automatically supplied variable.
{Curly Brackets} indicate a variable you are prompted to provide.

mIRC-Agent
     Control
          Summon
               Genie                    (/summon genie)
               Merlin                   (/summon merlin)
               Peedy                    (/summon peedy)
               Robby                    (/summon robby)
          Dismiss                       (/dismiss)
          Set Channel                   (/agentchannel [#channel])
          Monitor Channel
               Enable                   (/agentmonitor on)
               Disable                  (/agentmonitor off)
          Show Speech
               Enable                   (/agenttext on)
               Disable                  (/agenttext off)
          Think Speech
               Enable                   (/agentthink on)
               Disable                  (/agentthink off)
          Remote Control
               Enable                   (/agentremote on)
               Disable                  (/agentremote off)
          Users
               Add                      (/agentadduser {nick})
               Remove                   (/agentdeleteuser {nick})
               List                     (/agentshowusers)
          Advanced
               Skip Current Request     (/agentskip)
               Clear Request Buffer     (/agentclear)
               Unload Agent Script      (/agentunload)
     Actions
          Show                          (/agentshow)
          Hide                          (/agenthide)
          Move
               Home                     (/agentmove home)
               Custom                   (/agentmove custom {h v})
          Size
               Small                    (/agentsize small)
               Normal                   (/agentsize normal)
               Big                      (/agentsize big)
               Huge                     (/agentsize huge)
               Custom                   (/agentsize custom {h v})
          Point
               Left                     (/agentpoint left)
               Right                    (/agentpoint right)
               Up                       (/agentpoint up)
               Down                     (/agentpoint down)
               Custom                   (/agentpoint custom {h v})
          Look
               Left                     (/agentlook left)
               Right                    (/agentlook right)
               Up                       (/agentlook up)
               Down                     (/agentlook down)
          Animations
               Acknowledge              (/agentaction acknowledge)
               Announce                 (/agentaction announce)
               Blink                    (/agentaction blink)
               Decline                  (/agentaction decline)
               Don't Listen             (/agentaction dontlisten)
               Don't Recognize          (/agentaction dontrecognize)
               Explain                  (/agentaction explain)
               Get Attention            (/agentaction getattention
                                             ...getattentioncontinue 
                                             ...getattentionreturn)
               Greet                    (/agentaction greet)
               Magic                    (/agentaction domagic1 domagic2)
               Process                  (/agentaction process)
               Read                     (/agentaction read readcontinue 
                                             ...readreturn)
               Search                   (/agentaction search)
               Suggest                  (/agentaction suggest)
               Think                    (/agentaction think)
               Wave                     (/agentaction wave)
          Emotions
               Alert                    (/agentaction alert)
               Confused                 (/agentaction confused)
               Pleased                  (/agentaction pleased)
               Rest                     (/agentaction rest)
               Sad                      (/agentaction sad)
          Say                           (/agentsay {text})
     Help                               (/agenthelp)
     About                              (/agentabout)

NICKLIST/QUERY MENU
-------------------

This menu allows you to remotely control another users agent if the function is
enabled on their machine. The menu can be accessed by highlighting a user in a
channel nicklist and right clicking, or by right clicking on a private message
window. These commands are all representative of their respective command line
commands, as represented below.

mIRC-Agent
     Access
          Allow Access                  (/agentadduser [nick])
          Revoke Access                 (/agentdeleteuser [nick])
     Synchronize
          Synchronize                   (/agentsync [nick])
          Desynchronize                 (/agentsync off)
     Control
          Status                        (/remoteagentstatus [nick])
          Summon
               Genie                    (/remoteagentsummon [nick])
               Merlin                   (/remoteagentsummon [nick])
               Peedy                    (/remoteagentsummon [nick])
               Robby                    (/remoteagentsummon [nick])
          Dismiss                       (/remoteagentdismiss [nick])
     Actions
          Show                          (/remoteagentshow [nick])
          Hide                          (/remoteagenthide [nick])
          Move
               Home                     (/remoteagentmove [nick] home)
               Custom                   (/remoteagentmove [nick] custom {h v})
          Size
               Small                    (/remoteagentsize [nick] small)
               Normal                   (/remoteagentsize [nick] normal)
               Big                      (/remoteagentsize [nick] big)
               Huge                     (/remoteagentsize [nick] huge)
               Custom                   (/remoteagentsize [nick] custom {h v})
          Point
               Left                     (/remoteagentpoint [nick] left)
               Right                    (/remoteagentpoint [nick] right)
               Up                       (/remoteagentpoint [nick] up)
               Down                     (/remoteagentpoint [nick] down)
               Custom                   (/remoteagentpoint [nick] custom {h v})
          Look
               Left                     (/remoteagentlook [nick] left)
               Right                    (/remoteagentlook [nick] right)
               Up                       (/remoteagentlook [nick] up)
               Down                     (/remoteagentlook [nick] down)
          Animations
               Acknowledge              (/remoteagentaction [nick] acknowledge)
               Announce                 (/remoteagentaction [nick] announce)
               Blink                    (/remoteagentaction [nick] blink)
               Decline                  (/remoteagentaction [nick] decline)
               Don't Listen             (/remoteagentaction [nick] dontlisten)
               Don't Recognize          (/remoteagentaction [nick] 
                                             ...dontrecognize)
               Explain                  (/remoteagentaction [nick] explain)
               Get Attention            (/remoteagentaction [nick] gettattention
                                             ...getattentioncontinue
                                             ...getattentionreturn)
               Greet                    (/remoteagentaction [nick] greet)
               Magic                    (/remoteagentaction [nick] domagic1 
                                             ...domagic2)
               Process                  (/remoteagentaction [nick] process)
               Read                     (/remoteagentaction [nick] read 
                                             ...readcontinue readreturn)
               Search                   (/remoteagentaction [nick] search)
               Suggest                  (/remoteagentaction [nick] suggest)
               Think                    (/remoteagentaction [nick] think)
               Wave                     (/remoteagentaction [nick] wave)
          Emotions
               Alert                    (/remoteagentaction [nick] alert)
               Confused                 (/remoteagentaction [nick] confused)
               Pleased                  (/remoteagentaction [nick] pleased)
               Rest                     (/remoteagentaction [nick] rest)
               Sad                      (/remoteagentaction [nick] sad)
          Say                           (/remoteagentsay [nick] {text})

!------------------------------------------------------------------------------!
! SECTION IV: INSTALLATION                                                     !
!------------------------------------------------------------------------------!

To install the script copy agent.ini into your mIRC directory. Open mIRC, goto
Tools, Remote. In the remote window go to View, script.ini. Paste the following
line into the resulting window (leave out the <--- Begin ---> and <--- End --->
lines!):

<---Begin SCRIPT.INI Code Block--->

on *:START:/load -rs agent.ini

<--- End SCRIPT.INI Code Block --->

When the agent.ini is loaded it contains a startup command to tell you that it
has been loaded correctly. mIRC may warn you that the script contains startup
commands and ask you if you want to go ahead and load the script anyways.
Because these scripts are inevitable modified a billion times as they get passed
around you should make sure and look at the agent.ini before you load it to
ensure it doesn't execute any commands that could be lethal to your system!

!------------------------------------------------------------------------------!
! SECTION V: ADDITIONAL INFORMATION                                            !
!------------------------------------------------------------------------------!

USERS & ACCESS LEVELS
---------------------

CTCPs are protected to keep people from messing with your agent. If you don't 
care about this level of protection add the following line to your "Users"
window:
                   
     agent:*!*@*

This will allow anyone to manipulate your agent unless you use the
'/agentremote off' command, at which point nobody will be able to remotely 
manipulate your agent.

For further information about users and access levels please consult the 
documentation provided with mIRC.
                   
HOW TO GET HELP
---------------

If you need help feel free to contact me at dmiles@geekatlarge.net. I'll answer
your questions as soon as I can and to the best of my ability, but please be
patient as I don't always have time to respond immediately.

You can also find additional information about this script, an HTML version of
this document, and the latest version of the script on my website at:

http://www.geekatlarge.net/irc/mIRC-agent/

!------------------------------------------------------------------------------!
!                                                                              !
!------------------------------------------------------------------------------!