alias agent.state { return $gettok($did(agent,2).seltext,5,32) }
alias openagentsettings {
  if ( $dialog(agent).hwnd = $null ) { dialog -m agent agent  }
  if ( $dialog(agent).hwnd != $null ) { dialog -v agent agent  }
}
alias unloadagents { .gunload clippy }
alias agent.speak { .gtalk -l clippy $1- }
alias agent.think { .gtalk -k clippy $1- }
alias agent.move { .gmove clippy $1 $2 $3 }
alias agent.point { .gpoint clippy $1 $2 }
alias agent.anim { .gplay clippy $1- }
alias agent.hide { .ghide clippy }
alias agent.stop { .gstop clippy talk play }
alias agent.show { .gshow clippy }
alias Agent.speak.office.intro {
  agent.anim greet
  agent.speak Hello $+($me,.) Welcome to Hobo-Office 2.0.  My name is Merlin. I will be your guide.
  inc %start.times
}
alias agent.speak.hobonotes.intro {
  agent.show
  agent.anim Explain
  agent.speak Welcome to Hobo-Notes.I will guide you through the basic features and how to use them. We will start out with the sidebar.
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 30 * 70 100),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 70 100),3,32) 1
  agent.anim Gestureright
  agent.speak This is the sidebar. It has a Character Map, an Auto-Text Tree,a File Info Tree, and the New Log Viewer.
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 26 * 40 40),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 0 308),3,32) 1
  agent.anim GestureDown
  agent.speak Click on this button to close the sidebar.
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 26 * 25 25),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 0 308),3,32) 1
  agent.anim Suggest
  agent.speak Click on the buttons I explain, Just not that last one. This will give you a better understanding of what each one does.
  agent.anim GestureDown
  agent.speak Click on this button to display the Log Viewer. 
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 26 * 4 4),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 0 308),3,32) 1
  agent.anim GestureDown
  agent.Speak Click on this button to display the File Info tree.
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 26 * -18 -18),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 0 308),3,32) 1
  agent.anim GestureDown
  agent.speak Click on this button to display the Auto-Text tree.
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 26 * -39 -39),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 0 308),3,32) 1
  agent.anim GestureDown
  agent.speak Click on this button to display the Character Map.
  agent.move $gettok($dll($mdx.dll,ConvertCoords,Hobo 15 * 200 200),2,32) $gettok($dll($mdx.dll,ConvertCoords,Hobo * * 10 10),3,32) 1 
  agent.speak Now onto the Toolbar.
  agent.anim GestureUp
  agent.speak This is the toolbar. It is a quick way of accessing menu functions without using the menu.
  agent.anim Explain
  agent.speak From Left to right, the buttons are: 
  agent.speak New: Creates a New Document .
  agent.speak Open: Opens an existing Document .
  agent.speak Save: Saves the current Document.
  agent.speak Print: Opens the printing dialog.
  agent.speak Copy: Copies the selected text to the clipboard.
  agent.speak Paste: Inserts the clipboard text into the document.
  agent.speak Clipboard: Displays the Clipboard Viewer.
  agent.speak Settings: Displays the settings dialog.
  agent.speak About: Displays the about dialog.
  agent.speak Now onto the text area. I have left this last because it's obvious to most people.
  agent.anim GestureDown
  agent.speak This is the text area. Text goes here. You can change its colors by using the Themes dialog from Tools in the menubar.
  agent.anim Suggest
  agent.speak The text area currently does not support Rich Text (Formatted).
  agent.anim RestPose
  agent.speak And that concludes the basic tutorial for Hobo-Notes.
  agent.anim RestPose
  agent.speak To view this tutorial again, select tools  in the toolbar or menubar, and click "View Tutorial".
  agent.hide
  set %hobonotes.tutorial 1
}
dialog Agent {
  title "Agent Settings"
  size -1 -1 331 191
  icon $themeicons(agentsetting)
  option pixels notheme
  icon $beentertainment.ico ,0
  box "Options", 1, 0 -3 330 164
  list 2, 3 11 324 147, size extsel
  button "OK", 3, 132 165 65 25, ok
}
on *:dialog:Agent:init:0: {
  dll $mdx.dll SetMircVersion $version
  dll $mdx.dll MarkDialog $dname  
  dll $mdx.dll SetDialog $dname style title sysmenu 
  echo $gettok($dll($mdx.dll,SetControlMDX,2 ListView report select single nosortheader hottrack checkboxes underlinehot infotip showsel > $mdx.views),$9,45)
  did -i Agent 2 1 headerdims 88:1 autoheader:2
  did -i Agent 2 1 headertext +l 0 Action $tab Description
  if ( %agent.didle = on ) {
    did -a Agent 2 0 +f 0 0 2 Default Idle Actions $tab Enable Defualt Idle Actions.
  }
  if ( %agent.didle = off ) {
    did -a Agent 2 0 +f 0 0 1 Default Idle Actions $tab Enable Defualt Idle Actions.
  }
  if ( %agent.greet = on ) {
    did -a Agent 2 0 +f 0 0 2 Greet $tab Greet On Startup.
  }
  if ( %agent.greet = off ) {
    did -a Agent 2 0 +f 0 0 1 Greet $tab Greet On Startup.
  }
  if ( $agent(clippy).visible = $true ) {
    did -a Agent 2 0 +f 0 0 1 Hide $tab Hides The Agent
  }
  if ( $agent(clippy).visible = $false ) {
    did -a Agent 2 0 +f 0 0 2 Hide $tab Hides The Agent
  }
  if ( %agent.sidle = on ) {
    did -a Agent 2 0 +f 0 0 2 Special Actions $tab Enable Special Idle Actions.
  }
  if ( %agent.sidle = off ) {
    did -a Agent 2 0 +f 0 0 1 Special Actions $tab Enable Special Idle Actions.
  }
  if ( %agent.sound = on ) {
    did -a Agent 2 0 +f 0 0 2 Sound $tab Enable Sound.
  }
  if ( %agent.sound = off ) {
    did -a Agent 2 0 +f 0 0 1 Sound $tab Enable Sound.
  }
}
on *:dialog:agent:sclick:2: {
  if ( $did(agent,2).seltext = $null ) {
    halt
  }
  if ( $did(agent,2).seltext != $null ) {
    if ( $gettok($did(agent,2,1).text,1,32) = stateclick ) {
      if ( $mdx.page($dname,$did).event = 2 ) {
        if ( $agent.state = 1 ) {
          set %agent.didle on
          .gopts -i clippy on
        }
        if ( $agent.state = 2 ) {
          set %agent.didle off
          .gopts -i clippy off
        }
      }
      if ( $mdx.page($dname,$did).event = 3 ) {
        if ( $agent.state = 1 ) {
          set %agent.greet on
        }
        if ( $agent.state = 2 ) {
          set %agent.greet off
        }
      }
      if ( $mdx.page($dname,$did).event = 4 ) {
        if ( $agent.state = 1 ) {
          .agent.hide
        }
        if ( $agent.state = 2 ) {
          .agent.show
        }
      }
      if ( $mdx.page($dname,$did).event = 5 ) {
        if ( $agent.state = 1 ) {
          set %agent.sidle on
        }
        if ( $agent.state = 2 ) {
          set %agent.sidle off
        }
      }
      if ( $mdx.page($dname,$did).event = 6 ) {
        if ( $agent.state = 1 ) {
          set %agent.sound on
          .gopts -eq clippy on
        }
        if ( $agent.state = 2 ) {
          set %agent.sound off
          .gopts -eq clippy off
        }
      }
    }
  }
}
alias agent.state {
  return $gettok($did(agent,2).seltext,5,32)
}
alias openagentsettings {
  if ( $dialog(agent).hwnd = $null ) {
    dialog -m agent agent
  }
  if ( $dialog(agent).hwnd != $null ) {
    dialog -v agent agent
  }
}
alias loadagents {
  .gload -h clippy 1
  .gopts -b clippy size nopace
  .gopts -h clippy off
  agent.show
  if ( %agent.didle = on ) {
    .gopts -i clippy on
  }
  if ( %agent.didle = off ) {
    .gopts -i clippy off
  }
  if ( %agent.sound = on ) {
    .gopts -e clippy on
  }
  if ( %agent.sound = off ) {
    .gopts -e clippy off
  }
}
alias agent.speak {
  .gtalk -l clippy $1-
}
alias agent.think {
  .gtalk -k clippy $1-
}
alias agent.move {
  .gmove clippy $1 $2 $3
}
alias agent.point {
  .gpoint clippy $1 $2
}
alias agent.anim {
  .gplay clippy $1-
}
alias agent.hide {
  .ghide clippy
}
alias agent.stop {
  .gstop clippy talk play
}
alias agent.show {
  .gshow clippy
}
alias Agent.speak.hobonotes1.intro {
  agent.anim greet
  agent.speak Hello $+($me,.) Welcome to Hobo Notes.  My name is Merlin. I will be your guide.
  inc %start.times
}
alias -l wait {
  timerwait 1 4 $1-
}
alias agent.idle {
  .timeragent 0 1 .agent.idle1
}
alias -l agent.idle1 {
  if ( $window(@Agent_Terminal).hwnd = $null ) {
    if ( $agent(clippy).visible = $true ) {
      if ( %agent.sidle = on ) {
        if ( $agent(clippy).line = 0 ) {
          if ( %agent.idletime = 50 ) {
            agent.randomspeak
            set %agent.idletime 0
          }
          if ( %agent.idletime < 50 ) {
            inc %agent.idletime
          }
        }
        if ( $agent(clippy).line > 0 ) {
          set %agent.idletime 0
        }
      }
    }
  }
}
alias agent.randomspeak {
  .timeragent -p
  set %agent.random $rand(1,28)
  if ( %agent.random = 1 ) {
    agent.stop
    agent.anim GetAttention 
    agent.anim GetAttentionContinued 
    agent.anim GetAttentionContinued 
    agent.anim GetAttentionContinued 
    agent.anim GetAttentionContinued 
    agent.anim GetAttentionContinued 
    agent.anim GetAttentionContinued 
    agent.speak Hello???
    agent.anim GetAttentionReturn
    goto end
  }
  if ( %agent.random = 2 ) {
    agent.stop
    agent.anim Reading
    goto end
  }
  if ( %agent.random = 3 ) {
    agent.stop
    agent.anim Surprised
    agent.Speak Oh...Its just you...
    agent.anim sad
    goto end
  }
  if ( %agent.random = 4 ) {
    agent.stop
    agent.anim Decline
    agent.speak This is one ugly windows theme $+($me,.)
    goto end
  }
  if ( %agent.random = 5 ) {
    agent.stop
    agent.anim suggest
    agent.speak You do know that Windows $os sucks right?
    goto end
  }
  if ( %agent.random = 6 ) {
    agent.stop
    agent.anim DoMagic1
    agent.anim DoMagic2
    agent.anim Sad
    agent.Think Uh oh...Why is nothing happening?
    goto end
  }
  if ( %agent.random = 7 ) {
    agent.stop
    agent.anim Write
    agent.think Merlin's Log-Day 1- $asctime(mm/dd/yy)
    agent.think $me is making me angry. All they ever do is let me sit here bored.
    goto end
  }
  if ( %agent.random = 8 ) {
    agent.stop
    agent.anim Process
    goto end
  }
  if ( %agent.random = 9 ) {
    agent.stop
    agent.anim sad
    agent.speak You don't like me anymore...
    goto end
  }
  if ( %agent.random = 10 ) {
    agent.stop
    agent.anim think
    agent.think Why won't $me talk to me?
    agent.anim sad
    goto end
  }
  if ( %agent.random = 11 ) {
    agent.stop
    agent.anim StopListening 
    agent.speak LA LA LA LA LA LA!!!I CAN'T HEAR YOU!!
    agent.anim restpose
    agent.speak No seriously, I can't hear you.
    goto end
  }
  if ( %agent.random = 12 ) {
    agent.stop
    agent.speak *Yawn*
    agent.anim idle3_1 9000
    agent.anim idle3_2 9000
    agent.anim surprised 
    agent.speak I'm awake!!!!!!!
    goto end
  }
  if ( %agent.random = 13 ) {
    agent.stop 
    agent.anim announce
    agent.speak Lets dance!
    agent.anim Gestureup 2
    agent.anim Gesturedown 2
    agent.anim gestureup 2
    agent.anim gesturedown 2
    agent.anim gestureleft 2
    agent.anim gestureright 2
    agent.anim gestureup 2
    agent.anim gestureleft 2
    agent.anim gesturedown 2
    agent.anim gestureright 2
    agent.anim gestureup 2
    agent.anim gestureleft 2
    agent.anim gesturedown 2
    agent.anim gestureright 2
    agent.anim gestureup 2
    agent.anim gestureleft 2
    agent.anim gesturedown 2
    agent.anim gestureright 2
    goto end
  }
  if ( %agent.random = 14 ) {
    agent.stop 
    agent.anim WAVE
    agent.speak Hey $+($me,!!!!) 
    agent.anim Suggest
    agent.speak Make me do something that isn't BORING!!!
    goto end
  }
  if ( %agent.random = 15 ) {
    agent.stop
    agent.anim Confused
    agent.anim think
    agent.think I could've sworn the job description said "Meet INTERESTING people"..
    agent.anim sad
    agent.think Oh well..
    goto end
  }
  if ( %agent.random = 16 ) {
    agent.stop 
    agent.anim announce
    agent.speak MAY I HAVE YOUR ATTENTION PLEASE!!!!!
    agent.anim congratulate
    agent.speak Congratulations $+($me,!!!!!!!!!!) You've won the noble prize for "Most boring person in the world"
    goto end
  }
  if ( %agent.random = 17 ) {
    agent.stop
    agent.anim suggest
    agent.speak Heres a suggestion! DO SOMETHING INTERESTING ALREADY!!!!!!
    goto end
  }
  if ( %agent.random = 18 ) {
    agent.stop
    agent.anim pleased
    agent.speak I am pleased to be in your presence,King Bores-A-Lot.
    goto end
  }
  if ( %agent.random = 19 ) {
    agent.stop
    agent.anim Confused
    agent.think Why did I ever want this job....
    goto end
  }
  if ( %agent.random = 20 ) {
    agent.stop
    agent.anim Dontrecognize
    agent.speak I'm sorry did you say something?? No?? I thought so...
    agent.anim think
    agent.think This fool never says anything..
    goto end
  }
  if ( %agent.random = 21 ) {
    agent.stop
    agent.anim Domagic1
    agent.anim Domagic2
    agent.anim 20 2
    agent.anim 18 2
    agent.anim 18 2
    agent.anim 17 2
    agent.anim 20 2
    agent.anim 18 2
    agent.anim 17 2
    agent.anim 17 2
    agent.anim 20 2
    agent.anim 17 2
    agent.anim 20 2
    agent.anim 17 2
    agent.anim 20 2
    agent.anim 18 2
    agent.anim 20 2
    agent.anim lookdownblink
    agent.anim blink
    agent.anim Confused
    agent.speak What the <censored> was that?!
    goto end
  }
  if ( %agent.random = 22 ) {
    agent.stop
    agent.anim Reading 9000
    agent.think Boring:n.: $+($me,.)
    agent.anim Reading 9000
    agent.think Tedious:n.: $+($me,.)
    agent.anim Reading 9000
    agent.think Tedium:n.: The state of mind caused after a day of working for $+($me,.)
    agent.anim Reading 9000
    agent.think Annoyance:n.: $+($me,.)
    agent.anim Congratulate_2
    agent.speak Wow! You sure are a big hit in the dictionary $+($me,.)
    goto end
  }
  if ( %agent.random = 23 ) {
    agent.stop
    agent.speak *Yawn*
    agent.anim idle3_1 9000
    agent.anim think
    agent.think Working for $+($me) sure is boring..
    goto end
  }
  if ( %agent.random = 24 ) {
    agent.stop
    agent.anim suggest
    agent.speak More people would like you if you weren't so boring. Just a thought.
    goto end
  }
  if ( %agent.random = 25 ) {
    agent.stop
    agent.anim suggest
    agent.speak Leaving people bored like this causes them to hate you.
    goto end
  }
  if ( %agent.random = 26 ) {
    agent.stop
    agent.anim Congratulate_2
    agent.speak That's Amazing!!! No one has ever managed to bore me this much before!!!
    agent.anim congratulate
    goto end
  }
  if ( %agent.random = 27 ) {
    agent.stop
    agent.anim suggest
    agent.speak You won't like me when I'm BORED!!!
    goto end
  }
  if ( %agent.random = 28 ) {
    agent.anim congratulate
    agent.speak HA!! MY trophy!
  }
  :end
  .timeragent -r
}
alias getanim {
  var %anim1 $agent(clippy,0).anim
  var %anim2 1
  while ( %anim2 <= %anim1 ) {
    aline -l @Agent_Terminal 7 $+ $agent(clippy,%anim2).anim
    inc %anim2
  }
}
