HCC Module for Staff Bot v3

By Tamaki on Apr 01, 2009

Help Connection Center Module for Staff Bot v3. YOU MUST HAVE TAD'S INTEGRATION SCRIPT AND STAFF BOT V3 IN ORDER FOR THIS SCRIPT TO WORK.

Activates the Help menu option in Staff Bot v3.

on *:LOAD: {
  writeini sbot.ini settings modules $calc($modules + 1 )
  write $mfile hcc
  write $mpf hcc $modules
  writeini sbot.ini modules $modules $+ _name Help Connection Center
  writeini sbot.ini modules $modules $+ _creator The_Almighty_Duelist
  writeini sbot.ini modules $modules $+ _info Connect to help server.
  writeini sbot.ini modules $modules $+ _build 1.0.0.0
}

alias modins_hcc {
  writeini hcc.ini status installed yes
  writeini hcc.ini connection attempts 0
  writeini hcc.ini connection tries 5
  echo -a Help Connection Center module installed correctly.
}

alias hcc.attempt {
  return $readini(hcc.ini,connection,attempts)
}

alias hcc.tries {
  return $readini(hcc.ini,connection,tries)
}

alias config_hcc {
  start hcc
}

alias delete_hcc {
  remove hcc.ini
  var %temp.1 $read($mfile, s, hcc)
  remini sbot.ini modules %temp.1 $+ _name
  remini sbot.ini modules %temp.2 $+ _creator
  remini sbot.ini modules %temp.3 $+ _info
  echo -a Help Connection Center uninstall successfully.
}

dialog hcc {
  title Help Connection Center
  option dbu
  size -1 -1 201 101
  text "Help Connection Center Status", 1, 1 1 200 10
  list 2, 10 11 180 50, hsbar vsbar autohs autovs
  text "Connection Attempts", 3, 20 70 80 10,
  edit $hcc.tries, 4, 80 70 40 10, limit 2
  button "Connect to Server", 5, 20 80 80 10
  button "Disconnect from Server", 6, 20 90 80 10, disable
}

on *:DIALOG:hcc:*:0: {
  If ($devent == init ) {
    writeini hcc.ini connection attempts 0
    If ($server != $null ) {
      did -b hcc 5
      did -e hcc 6
      did -a hcc 2 Currently Connected: $server
      did -a hcc 2 If not connected to help server (irc.authoritygamer.com), disconnect with this dialog and reconnect by clicking the connect button.
    }
  }
  Elseif ($devent == close ) {
    set % $+ hcc $+ _open no
  }
}

on *:DIALOG:hcc:edit:4: {
  If ($did(4) < 3 ) {
    did -ra hcc 4 3
    writeini hcc.ini connection tries $did(4)
  }
  Else {
    writeini hcc.ini connection tries $did(4)
  }
}

on *:DIALOG:hcc:sclick:5: {
  did -r hcc 2
  server irc.authoritygamer.com -j #helpdesk
  did -a hcc 2 Connection to: Help Server
  did -a hcc 2 Testing Connection...
  testconnect
  did -b hcc 5
  did -e hcc 6
}

on *:DIALOG:hcc:sclick:6: {
  disconnect
  did -a hcc 2 Disconnected!
  did -b hcc 6
  did -e hcc 5
}

alias testconnect {
  If ($server != $null ) {
    did -a hcc 2 Connected!
    msg #helpdesk I am here because I'm having some trouble with a script.
  }
  Else {
    If ($hcc.attempt < $hcc.tries) {
      writeini hcc.ini connection attempts $calc($hcc.attempt + 1 )
      .timer 1 3 /testconnect
    }
    Else {
      did -a hcc 2 Connection Failed!
    }
  }
}

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.