HyPeR v2.0 Custom Bot

By Pepsi_Man0077 on May 07, 2008

Custom Bot i have been designing. Awesome setup Dialog script, and easy to use.

Bot must have the following:

-Registered Nick
-Specific Server to join
-Own Channel (For controlling and bot access)

To setup:

Load script, and in the status window, right click and go to "HyPeR v2.0 Setup"

Add autojoin channels (Include the Control Channel for the bot)

Then connect to a server and yourself to the access list as an Admin and join the Control Channel, on your IRC program and type !Commands for a list of commands you can use

[12:58am] -HyPeR- !Remote Command - Does the requested command
[12:58am] -HyPeR- !AutoJoin - Adds to AutoJoin list
[12:58am] -HyPeR- !View AutoJoin - Lists all Autojoin channels
[12:58am] -HyPeR- !Greet - Sets greet message for
[12:58am] -HyPeR- !notify <on,off> - Turns #HyPeR notify <on,off>
[12:58am] -HyPeR- !Identify - If my nick is not HyPeR, use this command to make me identify.
[12:58am] -HyPeR- !Add <admin,op,halfop,av> - Gives <admin,op,halfop,av> powers in #HyPeR
[12:58am] -HyPeR- !Spam <on,off> - Turns !commands <on,off> in
[12:58am] -HyPeR- !Join - Joins
[12:58am] -HyPeR- !Part - Parts
[12:58am] -HyPeR- !hop - Hops in
[12:58am] -HyPeR- !Say - Messages
[12:58am] -HyPeR- !info - Displays stats for
[12:58am] -HyPeR- !seen - Shows when was last on and what they were doing.
[12:58am] -HyPeR- !idle - Displays idle time
[12:58am] -HyPeR- !google - Gives a link to google for
[12:58am] -HyPeR- !img - Searches Google Image for
[12:58am] -HyPeR- !f - The temperature conversion for ° Fahrenheit to Celsius
[12:58am] -HyPeR- !c - The temperature conversion for ° Celsius to Fahrenheit
[12:59am] -HyPeR- !uptime - Displays my uptime
[12:59am] -HyPeR- !quote [quote number] - Displays a quote
[12:59am] -HyPeR- !addquote - Adds given quote if that channel is registered

If you have Questions or find errors, tell me.

note: I did not make the !weather script.

;==============|
;= HyPeR v2.0 =| - By PePSiMaN
;==============|

Menu Channel,Status {
  _-=HyPeR v2.0 setup=-_: { xHyPeR.setup }
}

;===========
;= Aliases =
;===========

alias voice.check {
  if ($1 !isop $2) && ($1 !ishop $2) && ($1 !isvoice $2) {
    mode $2 v $1
  }
}

alias xdefclear {
  unset %xseen
  unset %xseen.chan
  unset %xseen.nick
  unset %xseen.target
}

alias xauto.join {
  if ($chr(35) !isin $1) { halt }
  else {
    hadd Autojoin $1 spam
    msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ $1 has been added to my Autojoin list••7]
  }
}

alias test.hop {
  if ($1 != all) {
    hop $1
  }
  if ($1 = all) {
    var %hop.chans $chan(0)
    hmake Channel.Hops.List 10
    :Hop.Chans.List
    if (%hop.chans > 0) {
      hadd Channel.Hops.List $chan(%hop.chans)
      dec %hop.chans
      goto Hop.Chans.List
    }
    elseif (%hop.chans = 0) {
      var %hop.chans.hash $hget(Channel.Hops.List,0).item
      :Hop.Chans.Hash
      if (%hop.chans.hash > 0) {
        hop $hget(Channel.Hops.List,%hop.chans.hash).item
        dec %hop.chans.hash
        goto Hop.Chans.Hash
      }
      elseif (%hop.chans.hash = 0) {
        hfree Channel.Hops.List
      }
    }
  }
}

alias weather {
  sockclose weather- $+ $replace($1-,$chr(32),+)
  sockopen weather- $+ $replace($1-,$chr(32),+) www.weather.com 80
}

alias -l nohtml {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}

alias xadd.access {
  if (!$1) || (!$2) || ($3) { halt }
  hadd Access $3 $2 $address($3,1)
  if ($2 = 8) { msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ $3 has been added as an Admin••7] }
  elseif ($2 = 6) { msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ $3 has been added as an OP••7] }
  elseif ($2 = 4) { msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ $3 has been added as an Halfop••7] }
  elseif ($2 = 3) { msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ $3 has been added as an AV••7] }
}

alias googlereturn {
  var %i = 1,%r
  while (%i <= $len($1-)) {
    if ($mid($1-,%i,1) isalnum) { %r = %r $+ $ifmatch }
    else { %r = %r $+ % $+ $base($asc($mid($1-,%i,1)),10,16,2) }
    inc %i
  }
  return %r
}

alias HyPeR.Save {
  hsave AutoJoin AutoJoin.dat
  hsave Admins Admins.dat
  hsave Access Access.dat
  hsave HyPeR-v2.0 BoT-Configuration.dat
  hsave Help Help.dat
  hsave Greet Greet.dat
  hsave Quotes Quotes.dat
  hsave Stats Stats.dat
  hsave xSeen xSeen.dat
}

alias xxupdate {
  if (!$1) { halt }
  if ($hget(AutoJoin,$1)) { error.3 }
  if ($hget(Access,$1)) { error.4 }
  elseif ($chr(35) isin $1) {
    hadd -m AutoJoin $1 $1 spam
    did -a HyPeR 5 $1
    did -a HyPeR 22 Successful
    tokenize 32 $hget(AutoJoin,$1)
    did -a HyPeR 40 $1
    did -a HyPeR 42 $1
    halt
  }
  raw whois $1 $1
  .timercheck 1 3 nick.check $1 $2
}

alias nick.check {
  if (%address. [ $+ [ $1 ] ]) {
    hadd -m Access $1 $2 %address. [ $+ [ $1 ] ]
    if ($2 = 8) { did -a HyPeR 4 $1 $2 }
    if ($2 = 6) { did -a HyPeR 4 $1 $2 }
    if ($2 = 4) { did -a HyPeR 4 $1 $2 }
    if ($2 = 3) { did -a HyPeR 4 $1 $2 }
    did -a HyPeR 22 Successful: %address. [ $+ [ $1 ] ]
    unset %xxcount
    unset %address. [ $+ [ $1 ] ]
    halt
  }
}

alias error.channel {
  did -a HyPeR 22 Error: Invalid Channel
}

alias error.nick {
  did -a HyPeR 22 Error: Nick not found
}

alias error.1 {
  did -a HyPeR 22 Error: Specify a nick or a channel
}

alias error.2 {
  did -a HyPeR 22 Error: Pick what level of access $1 will recieve
}

alias error.3 {
  did -a HyPeR 22 Error: Already added to AutoJoin List
}

alias error.4 {
  did -a HyPeR 22 Error: Already added to Access List
}

alias error.5 {
  did -a HyPeR 22 Error: Critical Information missing (Bot nick, etc.)
}

alias xHyPeR.setup { dialog -m HyPeR HyPeR }

alias xxsuccessfull.setup { dialog -m xxcomplete xxcomplete }

;===========
;= Remotes =
;===========

raw 311:* {
  set %address. [ $+ [ $2 ] ] *!* $+ $3 $+ @ $+ $4
  if (%access = ON) {
    if (%accesslevel = admin) { hadd -m Access %accesstarget 8 %address. [ $+ [ $2 ] ] | msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ %accesstarget has been given Admin access••7] }
    elseif (%accesslevel = op) { hadd -m Access %accesstarget 6 %address. [ $+ [ $2 ] ] | msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ %accesstarget has been given OP access••7] }
    elseif (%accesslevel = halfop) { hadd -m Access %accesstarget 4 %address. [ $+ [ $2 ] ] | msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ %accesstarget has been given Halfop access••7] }
    elseif (%accesslevel = AV) { hadd -m Access %accesstarget 3 %address. [ $+ [ 23 ] ] | msg $hget(HyPeR-v2.0,Chan) 7[4•• $+ %accesstarget has been given AV access••7] }
    unset %access*
  }
}

raw 317:*:{
  if (%xseen) {
    msg %xseen.chan $2 was found on the server but not in any channel.
    notice %xseen.nick If you would like me to inform $2 you are looking for them, type !search
    set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
    hadd -m xSeen %xseen.target S $nick $ctime
    xdefclear
  }
  if (%idle.time.get = on) {
    set %temp.idle.time $3
    msg %idle.chan $2 has been idle for $duration(%temp.idle.time)
    unset %temp.idle.time
    unset %idle.nick
    unset %idle.chan
    unset %idle.time.get
    halt
  }
}

raw 319:*:{
  if (%xseen) {
    msg %xseen.chan User $2 is currently in: $remove($3-,$chr(94),$chr(64),$chr(43),$chr(37),$chr(42))
    notice %xseen.nick Click a room(s) to join them, or type !search & I'll tell them you're looking for them.
    set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
    hadd -m xSeen %xseen.target S $nick $ctime
    xdefclear
    ;halt
  }
}

raw 402:* {
  if (%access = ON) {
    .notice %accessnick 7[4 $+ %accesstarget was not found on the server7]
    unset %access*
  }
  if (%HyPeR.Setup = ON) {
    did -a HyPeR 22 Error: Nick was not on server
  }
  if (%xseen) {
    if (!$hget(xSeen,%xseen.target)) {  msg %xseen.chan Sorry, %xseen.target was not found in my database. }
    if ($hget(xSeen,%xseen.target)) {
      var %xseen.data $left($hget(xSeen,$2),1)
      tokenize 32 $hget(xSeen,%xseen.target)
      if ($1 = Q) { msg %xseen.chan $2 was last seen Quitting $duration($calc($ctime - $3)) ago. | msg %xseen.chan (Quit Message: $4- $+ ) }
      if ($1 = S) { msg %xseen.chan $2 was last seen by me on the server $duration($calc($ctime - $3)) ago. }
      if ($1 = K) { msg %xseen.chan $2 was last seen being kicked from $4 $duration($calc($ctime - $3)) ago. | msg %xseen.chan (Kick Reason: $5- $+ ) }
      if ($1 = P) { msg %xseen.chan $2 was last seen parting $4 $duration($calc($ctime - $3)) ago. | if ($5) { msg %xseen.chan (Part Reason: $5- $+ ) } }
      if ($1 = N) { msg %xseen.chan $2 was last seen changing his/her nick to $4 $duration($calc($ctime - $3)) ago. }
      if ($1 = J) { msg %xseen.chan $2 was last seen joining $4 $duration($calc($ctime - $3)) ago. }
      if ($1 = T) { msg %xseen.chan $2 was last seen talking in $4 $duration($calc($ctime - $3)) | msg %xseen.chan (Text said: $5- $+ ) }
    }
    xdefclear
  }
  if (%idle.time.get = on) {
    msg %idle.chan Sorry %idle.x $+ , %idle.nick was not found on this server. Try !seen %idle.nick
    unset %idle.nick
    unset %idle.chan
    unset %idle.time.get
    unset %idle.x
    halt
  }
}

on *:START: {
  if (!$isdir($mircdir $+ Quotes)) { mkdir " $+ $mircdir $+ Quotes $+ " }
  titlebar HyPeR v2.0 - By PePSiMaN
  echo 7Right click in here or in a channel and choose _-=HyPeR v2.0 setup=-_ to enter setup
  if (!$hget(Autojoin)) {
    hmake Autojoin 100
    if ($isfile(Autojoin.dat)) {
      hload Autojoin Autojoin.dat
    }
  }
  if (!$hget(Greet)) {
    hmake Greet 100
    if ($isfile(Greet.dat)) {
      hload Greet Greet.dat
    }
  }
  if (!$hget(Admins)) {
    hmake Admins 100
    if ($isfile(Admins.dat)) {
      hload Admins Admins.dat
    }
  }
  if (!$hget(Access)) {
    hmake Access 100
    if ($isfile(Access.dat)) {
      hload Access Access.dat
    }
  }
  if (!$hget(Quotes)) {
    hmake Quotes 500
    hmake Help 100
    if ($isfile(Quotes.dat)) {
      hload Quotes Quotes.dat
    }
    if ($isfile(Help.dat)) {
      hload Help Help.dat
    }
  }
  if ($isfile(BoT-Configuration.dat)) {
    hmake HyPeR-v2.0 5
    hload HyPeR-v2.0 BoT-Configuration.dat
  }
  if (!$hget(xSeen)) { hmake xSeen 10000 }
  if ($isfile(xSeen.dat)) { hload xSeen xSeen.dat }
  if (!$hget(Stats)) {
    hmake Stats 9999
    if ($isfile(Stats.dat)) {
      hload Stats Stats.dat
    }
  }
  HyPeR.Save
  .timerhypersave 0 300 HyPeR.Save
}

on *:UNLOAD: {
  timer* off
}

on *:EXIT: {
  HyPer.Save
}

on *:CONNECT: {
  hadd -m HyPeR-v2.0 Net $network
  if ($network = $hget(HyPeR-v2.0,Net)) {
    nick $hget(HyPeR-v2.0,Nick)
    identify $hget(HyPeR-v2.0,Pass)
    var %Auto.Join.Chans $hget(AutoJoin,0).item
    var %Auto.Join.Chan.Number $hget(AutoJoin,0).item
    :Get.Chans
    if (%Auto.Join.Chans > 0) {
      var %Auto.Join.Chans. [ $+ [ %Auto.Join.Chans ] ] $hget(AutoJoin,%Auto.Join.Chans).item
      dec %Auto.Join.Chans
      goto Get.Chans
    }
    :Auto.Join.Chans
    if (%Auto.Join.Chan.Number > 0) {
      .timer 1 6 join %Auto.Join.Chans. [ $+ [ %Auto.Join.Chan.Number ] ]
      dec %Auto.Join.Chan.Number
      goto Auto.Join.Chans
    }
  }
  hsave xSeen xSeen.dat
}

on 5:TEXT:*:?: {
  if (!$window(@Query)) { window @Query }
  echo @Query 14[4Query recieved from $nick 14- $1- $+ ]
  if ($hget(Admins,$nick)) && (%notify == ON) {
    msg $hget(HyPeR-v2.0,Chan) 7 $+ Query from $nick with access level $hget(Admins,$nick) $+ : $1-
  }
  if ($1 = !register) {
    if (!$2) { .msg $nick 7Syntax: 4!Register <channel> (only register channels you own) | halt }
    if ($hget(Quotes,$2)) { .msg $nick That channel is already registered | halt }
    if ($2 = $hget(HyPeR-v2.0,Chan)) { .msg $nick That channel cannot be registered. | halt } 
    if ($2) && (!$3) && ($chr(35) isin $2) {
      .msg $nick 7Your registration request for4 $chan 7is in pending, please allow up to 24 hours for the request to be checked.
      .msg $nick 7If it has been over 24 hours please PM me with !help. If it hasn't been 24 hours and you do, then your request will be denied.
      .notice @ $+ $hget(HyPeR-v2.0,Chan) $nick is requesting to register his channel of $2 $+ . To register the channel for $nick $+ , type in here !addquote $2
      hadd -m Help $nick $2 $ctime
    }
    if ($2 = help) {
      .msg $nick Registering your channel for quotes allows you to use the !addquote command inside the channel that you would be registering.
      .msg $nick After you add quotes to the channel, use the !quote command in the channel and it will randomly read one of the quotes you added.
      .msg $nick You can add any quotes you want, only 1 quote at a time however. Great for a laugh or two at times. To register type !register <channel>
    }
  }
  if ($1 = !help) && ($hget(help,$nick)) && (!$chan) {
    tokenize 32 $hget(Help,$nick)
    notice @ $+ $hget(HyPeR-v2.0,Chan) $nick still hasn't had his channel of $1 registered. It has been $duration($calc($ctime - $2)) since he requested registration
    notice @ $+ $hget(HyPeR-v2.0,Chan) To register the channel for him, type !addquote $1 $+ , then remove him from pending by typing !removepending $nick
  }
  close -m
}

on *:TEXT:*:*: {
  if ($query(1) = $nick) {
    if (!$window(@Query)) { window @Query }
    echo @Query 14[4Query recieved from $nick 14- $1- $+ ]
    if (!$hget(Admins,$nick)) {
      msg $hget(HyPeR-v2.0,Chan) 4 $+ Query from $nick $+ : $1-
    }
    if ($1 = !register) {
      if (!$2) { .msg $nick 7Syntax: 4!Register <channel> (only register channels you own) | halt }
      if ($hget(Quotes,$2)) { .msg $nick That channel is already registered | halt }
      if ($2 = $hget(HyPeR-v2.0,Chan)) { .msg $nick That channel cannot be registered. | halt }
      if ($2) && (!$3) && ($chr(35) isin $2) {
        .msg $nick 7Your registration request for4 $chan 7is in pending, please allow up to 24 hours for the request to be checked.
        .msg $nick 7If it has been over 24 hours please PM me with !help. If it hasn't been 24 hours and you do, then your request will be denied.
        .notice @ $+ $hget(HyPeR-v2.0,Chan) $nick is requesting to register his channel of $2 $+ . To register the channel for $nick $+ , type in here !addquote $2
        hadd -m Help $nick $2 $ctime
      }
      if ($2 = help) {
        .msg $nick Registering your channel for quotes allows you to use the !addquote command inside the channel that you would be registering.
        .msg $nick After you add quotes to the channel, use the !quote command in the channel and it will randomly read one of the quotes you added.
        .msg $nick You can add any quotes you want, only 1 quote at a time however. Great for a laugh or two at times. To register type !register <channel>
      }
    }
    if ($1 = !help) && ($hget(help,$nick)) && (!$chan) {
      tokenize 32 $hget(Help,$nick)
      notice @ $+ $hget(HyPeR-v2.0,Chan) $nick still hasn't had his channel of $1 registered. It has been $duration($calc($ctime - $2)) since he requested registration
      notice @ $+ $hget(HyPeR-v2.0,Chan) To register the channel for him, type !addquote $1 $+ , then remove him from pending by typing !removepending $nick
    }
    close -m
  }
  hadd -m Stats $nick $+ .TextCount $calc($hget(Stats,$nick $+ .TextCount) + 1)
  hadd -m Stats $nick $+ .ChrCount $calc($hget(Stats,$nick $+ .ChrCount) + $len($1-))
  hadd -m Stats $chan $+ .TextCount $calc($hget(Stats,$chan $+ .TextCount) + 1)
  hadd -m Stats $chan $+ .ChrCount $calc($hget(Stats,$chan $+ .ChrCount) + $len($1-))
  hadd -m xSeen $nick T $nick $ctime $chan $1-
  if ($nick isop $hget(HyPeR-v2.0,Chan)) && (!$hget(Admins,$nick)) { hadd -m Admins $nick 8 | .notice $nick [•• $+ $hget(HyPeR-v2.0,Nick) Admin access has been turned on••] | auser 5 $nick }
  elseif ($nick ishop $hget(HyPeR-v2.0,Chan)) && (!$hget(Admins,$nick)) { hadd -m Admins $nick 6 | .notice $nick [•• $+ $hget(HyPeR-v2.0,Nick) Halfop access has been turned on••] | auser 5 $nick }
  elseif ($nick isvoice $hget(HyPeR-v2.0,Chan)) && (!$hget(Admins,$nick)) { hadd -m Admins $nick 4 | .notice $nick [•• $+ $hget(HyPeR-v2.0,Nick) Voice access has been turned on••] | auser 5 $nick }
  if ($hget(Admins,$nick) >= 8) {
    if ($1 = !remote) && ($2 = command) {
      if (!$3) { .notice $nick 7[4Syntax: 3!Remote Command <commands to initiate>7] }
      else { $3- }
    }
    if ($1 = !identify) {
      if ($me = $hget(HyPeR-v2.0,Nick)) { .notice $nick I am already identified! }
      else {
        if ($hget(HyPeR-v2.0,Nick) ison $hget(HyPeR-v2.0,Chan)) { 
          ns ghost $hget(HyPeR-v2.0,Nick) $hget(HyPeR-v2.0,Pass)
        }
        .timer 1 1 nick $hget(HyPeR-v2.0,Nick)
        .timer 1 2 identify $hget(HyPeR-v2.0,Pass)
        .timer 1 3 test.hop all
        .timer 1 4 .notice $nick Successfully identified, thanks :) 
      }
    } 
    if ($1 = !autovoice) {
      if ($2) && ($3) {
        set %avoice. [ $+ [ $2 ] ] $3
      }
    }
    if ($1 = !greet) {
      if (!$2) || (!$3) { .notice $nick 7[4Syntax: 3!Greet <Channel> <Greet Message>>7] | halt }
      if (!$hget(AutoJoin,$2)) { .notice $nick $2 is not in my AutoJoin list. | halt }
      else { hadd -m Greet $2 $3- | .notice $nick Greet message was recorded. }
    }
    if ($1 = !protect) {
      if (!$2) { halt }
      hadd -m Protect $2
      hsave Protect Protect.dat
      .notice $nick $2 added to Protect list
    }
    if ($1 = !autovoice) && ($2) && ($3) && (!$4) {
      set %av. [ $+ [ $2 ] ] $3
    }   
    if ($1 = !view) && ($2 = autojoin) && ($3 = $null) {
      .notice $nick Channels on my Auto-Join List:
      var %Auto.Join.Chans $hget(AutoJoin,0).item
      var %Auto.Join.Chan.Number $hget(AutoJoin,0).item
      :Get.Chans
      if (%Auto.Join.Chans > 0) {
        var %Auto.Join.Chans. [ $+ [ %Auto.Join.Chans ] ] $hget(AutoJoin,%Auto.Join.Chans).item
        dec %Auto.Join.Chans
        goto Get.Chans
      }
      :Auto.Join.Chans
      if (%Auto.Join.Chan.Number > 0) {
        .notice $nick %Auto.Join.Chans. [ $+ [ %Auto.Join.Chan.Number ] ]
        dec %Auto.Join.Chan.Number
        goto Auto.Join.Chans
      }
    }
    if ($1 = !notify) && ($2) {
      if ($2 = on) { set %notify on | msg $hget(HyPeR-v2.0,Chan) Notify turned on }
      if ($2 = off) { unset %notify | msg $hget(HyPeR-v2.0,Chan) Notify turned off  }
    }
    if ($1 = !autojoin) {
      if (!$2) { .notice $nick 7[4Syntax: 3!Autojoin <channel>7] }
      elseif ($2) && ($3) { .notice $nick 7[4Syntax: 3!Autojoin <channel>7] }
      else { xauto.join $2 }
    }
    if ($1 = !add) {
      if (!$3) || (!$2) { .notice $nick 7[4Syntax: 3!add <admin, op, halfop, av> <nick>7] }
      elseif ($4) { .notice $nick 7[4Syntax: 3!add <admin, op, halfop, av> <nick>7] }
      set %access ON
      set %accessnick $nick
      set %accesstarget $3
      set %accesslevel $2
      raw whois $3 $3
    }
  }
  if ($hget(Admins,$nick) >= 6) {
    if ($1 = !spam) {
      if (!$2) { .notice $nick 7[4Syntax: 3!spam <channel> <on,off>7] }
      elseif ($4) { .notice $nick 7[4Syntax: 3!spam <channel> <on,off>7] }
      elseif ($2 = $hget(HyPeR-v2.0,Chan)) && ($3 = off) { .notice $nick [••I will not turn off spam for my channel••] }
      elseif ($2 = $hget(HyPeR-v2.0,Chan)) && ($3 = on) { halt }
      elseif (!$hget(AutoJoin,$2)) { .notice $nick [•• $+ $2 is not in my Autojoin list••] }
      elseif (!$3) {
        .notice $nick Spam status for $2:
        if ($hget(AutoJoin,$2) = $2 spam) {
          .notice $nick $2 $+ : on
        }
        elseif ($hget(AutoJoin,$2) = $2 nospam) {
          .notice $nick $2 $+ : off
        }
      }
      elseif ($3 = on) {
        if ($hget(AutoJoin,$2) = $2 spam) { .notice $nick [••Spam is already turned on for $2 $+ ••] }
        else {
          hadd -m AutoJoin $2 $2 spam
          .notice $nick [••Spam now turned on for $2 $+ ••]
        }
      }
      elseif ($3 = off) {
        if ($hget(AutoJoin,$2) = $2 nospam) { .notice $nick [••Spam is already turned off for $2 $+ ••] }
        else {
          hadd -m AutoJoin $2 $2 nospam
          .notice $nick [••Spam now turned off for $2 $+ ••]
        }
      }
    }
    if ($1 = !join) {
      if (!$2) { notice $nick 7[4Syntax: 3!join <channel>7] }
      elseif ($3) { notice $nick 7[4Syntax: 3!join <channel>7] }
      else { join $2 }
    }
    if ($1 = !part) {
      if (!$2) { notice $nick 7[4Syntax: 3!part <channel>7] }
      elseif ($3) { notice $nick 7[4Syntax: 3!part <channel>7] }
      elseif ($me !ison $chan) { notice $nick I am not on $2 }
      else { part $2 }
    }
  }
  if ($hget(Admins,$nick) >= 4) {
    if ($1 = !hop) {
      if (!$2) { notice $nick 7[4Syntax: 3!hop <channel>7] }
      elseif ($3) { notice $nick 7[4Syntax: 3!hop <channel>7] }
      elseif ($me !ison $chan) { notice $nick I am not on $2 }
      else { part $2 | timerjoin 1 1 join $2 }
    }
    if ($1 = !say) {
      if (!$2) || (!$3) { notice $nick 7[4Syntax: 3!say <channel> <text>7] }
      elseif ($me !ison $chan) { notice $nick I am not on $2 }
      else { msg $2 $3- }
    }
  }
  if (%spam [ $+ [ $nick ] ] >= 3) {
    if ($1 = !seen) || ($1 = !idle) {
      msg $chan Do not abuse the !seen or !idle commands
      halt
    }
  }
  if ($hget(AutoJoin,$chan) != $chan spam) { halt }
  if ($1 = !seen) {
    inc -u300 %spam [ $+ [ $nick ] ]
    if (%spam [ $+ [ $nick ] ] >= 3) { Do not abuse my commands, you will have a 10 min wait before you can use my commands again. | halt }
    elseif (!$2) { msg $chan are you looking for someone? | halt }
    elseif ($2 = $nick) { msg $chan Are you trying to find yourself $nick $+ ? I know of some great Counselors that might be able to help you :- | halt }
    elseif ($2 = $me) { msg $chan Find my yet, $nick $+ ? | halt }
    elseif ($2 ison $chan) { msg $chan $2 is currently on the channel. | halt }
    elseif (%xseen = $null) {
      raw whois $2 $2
      set %xseen ON
      set %xseen.chan $chan
      set %xseen.nick $nick
      set %xseen.target $2
    }
    elseif (%xseen != $null) {
      msg $chan There is currently already a !seen check in progress $nick $+ , please wait a second and try again.
    }
  }
  if ($1 = !search) && (%xfind. [ $+ [ $nick ] ]) {
    msg %xfind. [ $+ [ $nick ] ] Hello there, I am an automated bot, please do not reply.
    msg %xfind. [ $+ [ $nick ] ] $nick performed a !seen command on you and wanted me to let you know he was looking for you.
    msg $chan Message has been send.
    unset %xfind*
  }
  if ($1 = !idle) {
    inc -u300 %spam [ $+ [ $nick ] ]
    if (%spam [ $+ [ $nick ] ] >= 3) { Do not abuse my commands, you will have a 10 min wait before you can use my commands again. | halt }
    if (!$2) { msg $chan I need a nick to idle :P | halt }
    if ($2 = $nick) { msg $chan Idle'n youself, $nick $+ ? | halt }
    if ($2 = $me) { msg $chan I never idle $nick $+ . :) | halt }
    else {
      if (%idle.time.get) { msg $chan I am sorry $nick $+ , but there is already an idle check in progress, please try in a second. | halt }
      raw whois $2 $2
      set %idle.time.get on
      set %idle.chan $chan
      set %idle.nick $2
      set %idle.x $nick
    }
  }
  if ($1 = !google) {
    msg $chan http://www.google.com/search?q= $+ $googlereturn($2-)
  }
  if ($1 = !img) {
    msg $chan http://images.google.com/images?gbv=2&svnum=10&hl=en&q= $+ $googlereturn($2-)
  }
  if ($1 = !uptime) {
    if (!$2) {
      msg $chan 14System: $+ 9 $uptime(system,1) $+ 14.
      msg $chan 14mIRC: $+ 9 $uptime(mirc,1) $+ 14.
      msg $chan 14Server: $+ 9 $uptime(server,1) $+ 14.
    }
  }
  if ($1 = !F) {
    if ($2 = 0) { msg $chan 14The temperature conversion for 0° Fahrenheit to Celsius: $+ 9 -17.77° Celsius | halt }
    if (!$2) { msg $chan I need a temperature to convert you idiot... }
    if ($2 isletter) { msg $chan 14The temperature conversion for $2: $+ 9 Your an Idiot° Celsius | halt }
    if ($2 isnum) {
      set %t1 $calc($2 - 32)
      set %temp $calc(%t1 * 0.55555555555555555555555555555556)
      msg $chan 14The temperature conversion for $2 $+ ° Fahrenheit to Celsius: $+ 9 $round(%temp,2) $+ ° Celsius
    }
  }
  if ($1 = !C) {
    if ($2 = 0) { msg $chan 14The temperature conversion for 0° Celsius to Fahrenheit: $+ 9 32° Fahrenheit | halt }
    if (!$2) { msg $chan I need a temperature to convert you idiot... }
    if ($2 isletter) { msg $chan 14The temperature conversion for $2: $+ 9 Your an Idiot° Fahrenheit | halt }
    if ($2 isnum) {
      set %t1 $calc($2 * 1.8)
      set %temp $calc(%t1 + 32)
      msg $chan 14The temperature conversion for $2 $+ ° Celsius to Fahrenheit: $+ 9 $round(%temp,2) $+ ° Fahrenheit
    }
  }
  if ($1 = !info) {
    if (!$2) { msg $chan You must specify a nick | halt }
    if ($2 = $me) { msg $chan I dont keep stats for myself. | halt }
    if (!$hget(Stats,$2 $+ .JoinCount)) {
      if ($2 ison $chan) { msg $chan I have not started taking stats for $2 yet, i will when they rejoin }
      if ($2 !ison $chan) { msg $chan $2 was not found in my database }
    }
    else {
      inc -u300 %spam [ $+ [ $nick ] ]
      if (%spam [ $+ [ $nick ] ] >= 3) { .notice $nick Do not abuse my commands, you will have a 5 min wait til you can use these commands. | halt }
      if ($chr(35) isin $2) {
        msg $chan 15[4Stats for  $+ $2 $+ 15]
        msg $chan 15[7Lines of Text:  $+ $hget(Stats,$2 $+ .TextCount) $+ 15][7Characters said:  $+ $hget(Stats,$2 $+ .ChrCount) $+ 15]
        msg $chan 15[7Join Count:  $+ $hget(Stats,$2 $+ .JoinCount) $+ 15][7Part Count:  $+ $hget(Stats,$2 $+ .PartCount) $+ 15]
        msg $chan 15[7Ban Count:  $+ $hget(Stats,$2 $+ .BanCount) $+ 15][7Kick Count:  $+ $hget(Stats,$2 $+ .KickCount) $+ 15]
        msg $chan 15[7The most nicks in $2 at once:  $+ $hget(Stats,$2 $+ .Record) $+ 15]
        msg $chan 15[7I have been taking stats for $2 since:  $+ $hget(Stats,$2 $+ .Start) $+ 15]
      }
      else {
        msg $chan 15[3Stats for  $+ $2 $+ 15]
        msg $chan 15[7Lines of Text:  $+ $hget(Stats,$2 $+ .TextCount) $+ 15][7Characters said:  $+ $hget(Stats,$2 $+ .ChrCount) $+ 15]
        msg $chan 15[7Join Count:  $+ $hget(Stats,$2 $+ .JoinCount) $+ 15][7Part Count:  $+ $hget(Stats,$2 $+ .PartCount) $+ 15]
        msg $chan 15[7Bans:  $+ $hget(Stats,$2 $+ .BanCount) $+ 15][7Kicks:  $+ $hget(Stats,$2 $+ .KickCount) $+ 15]
        msg $chan 15[7Times Banned:  $+ $hget(Stats,$2 $+ .BannedCount) $+ 15][7Times Kicked:  $+ $hget(Stats,$2 $+ .KickedCount) $+ 15]
        msg $chan 15[7I have been taking stats for $2 since:  $+ $hget(Stats,$2 $+ .Start) $+ 15]
      }
    }
  }
  if ($1 = !weather) {
    inc -u300 %co. [ $+ [ $nick ] ]
    if (%co. [ $+ [ $nick ] ] <= 2) {
      if ($2 isnum) && ($len($2) == 5) {
      weather $2 | set %we.chan $chan | inc -u300 %co. [ $+ [ $nick ] ] }
      else {
        msg $chan Incorrect zip code format.
      }
    }
    else { msg $chan Do not abuse the !weather command. }
  }
  if ($1 = !Quote) {
    if ($hget(Quotes,$chan)) {
      if (!$isfile(Quotes $+ $chan $+ .txt)) { msg $chan 7I am sorry but4 $3 7does not have any Quotes. | halt }
      if ($isfile(Quotes $+ $chan $+ .txt)) {
        if (!$2) {
          var %rand.quote $rand(1,$lines(Quotes $+ $chan $+ .txt))
          msg $chan 7[Quote %rand.quote of $lines(Quotes $+ $chan $+ .txt) $+ ] - $read(Quotes $+ $chan $+ .txt, %rand.quote)
          halt
        }
        if ($2) && ($2 isnum) && ($2 <= $lines(Quotes $+ $chan $+ .txt)) {
          var %quote.read $2
          msg $chan 7[Quote %quote.read of $lines(Quotes $+ $chan $+ .txt) $+ ] - $read(Quotes $+ $chan $+ .txt, %quote.read)
        }
        if ($2) && ($2 isnum) && ($2 > $lines(Quotes $+ $chan $+ .txt)) { msg $chan I dont have that many quotes for $chan }
      }
    }
    else { msg $chan This channel is not registered for quotes. To learn more about quotes, PM me with !register help }
  }
  if ($1 = !addquote) && ($chan = $hget(HyPeR-v2.0,Chan)) && ($nick isop $chan) {
    if ($2 != $hget(HyPeR-v2.0,Chan)) {
      hadd -m Quotes $2 on | msg $chan Successfully added quotes for $2 $+ , now !removepending <nick>
    }
    halt
  }
  if ($1 = !addquote) && ($hget(Quotes,$chan)) { write Quotes $+ $chan $+ .txt $2- | msg $chan Added quote number $lines(Quotes $+ $chan $+ .txt)  }
  if ($1 = !addquote) && (!$hget(Quotes,$chan)) { msg $chan $chan isn't registered. For info about registration, type !register help }
  if ($1 = !delquote) && ($hget(Quotes,$chan)) { 
    if ($2) && ($2 isnum) { 
      write -dl $+ $2 Quotes $+ $chan $+ .txt 
      msg $chan Deleted quote number $2
      if ($lines(Quotes $+ $chan $+ .txt) = 0) { remove Quotes $+ $chan $+ .txt }
    }
    else { .notice $nick 4[Syntax:7 !delquote <quote number>] }
  }
  if ($1 = !removepending) && ($chan = $hget(HyPeR-v2.0,Chan)) {
    if ($nick isop $chan) && ($1 = !removepending) {
      if ($hget(help,$2)) { hdel help $2 | say Successfully removed }
      else { msg $chan $2 is not in the pending list }
    }
  }
  if ($1 = !commands) {
    if ($nick isop $hget(HyPeR-v2.0,Chan)) { .notice $nick 7 $+ $hget(HyPeR-v2.0,Nick) Admin commands are as follows: }
    if ($nick ishop $hget(HyPeR-v2.0,Chan)) { .notice $nick 7 $+ $hget(HyPeR-v2.0,Nick) Halfop commands are as follows: }
    if ($nick isvoice $hget(HyPeR-v2.0,Chan)) { .notice $nick 7 $+ $hget(HyPeR-v2.0,Nick) Voice commands are as follows: }
    if (!$hget(Admins,$nick)) { .notice $nick 7 $+ $hget(HyPeR-v2.0,Nick) Commands are as follows: }
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!Remote Command <commands to initiate> 14- Does the requested command } 
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!AutoJoin 14<channel> - Adds <channel> to AutoJoin list }
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!View AutoJoin 14- Lists all Autojoin channels }
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!Greet 14<chan> <message> - Sets greet message for <chan> }
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!notify 14<on,off> - Turns $hget(HyPeR-v2.0,Chan) notify <on,off> }
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!Identify 14- If my nick is not $hget(HyPeR-v2.0,Nick) $+ , use this command to make me identify.  }
    if ($hget(Admins,$nick) >= 8) { .notice $nick 4!Add 14<admin,op,halfop,av> <nick> - Gives <nick> <admin,op,halfop,av> powers in $hget(HyPeR-v2.0,Chan) }
    if ($hget(Admins,$nick) >= 6) { .notice $nick 4!Spam 14<channel> <on,off> - Turns !commands <on,off> in <channel> }
    if ($hget(Admins,$nick) >= 6) { .notice $nick 4!Join 14<channel> - Joins <channel> }
    if ($hget(Admins,$nick) >= 6) { .notice $nick 4!Part 14<channel> - Parts <channel> }
    if ($hget(Admins,$nick) >= 4) { .notice $nick 4!hop 14<channel> - Hops in <channel> }
    if ($hget(Admins,$nick) >= 4) { .notice $nick 4!Say 14<channel> <text> - Messages <channel> <text> }
    .notice $nick 4!info 14<nick> - Displays stats for <nick>
    .notice $nick 4!seen 14<nick> - Shows when <nick> was last on and what they were doing.
    .notice $nick 4!idle 14<nick> - Displays <nick> idle time
    .notice $nick 4!google 14<google item> - Gives a link to google for <google item>
    .notice $nick 4!img 14<image item> - Searches Google Image for <image item>
    .notice $nick 4!f 14<temp> - The temperature conversion for <temp>° Fahrenheit to Celsius
    .notice $nick 4!c 14<temp> - The temperature conversion for <temp>° Celsius to Fahrenheit 
    .notice $nick 4!uptime 14- Displays my uptime
    .notice $nick 4!quote 14[quote number] - Displays a quote
    .notice $nick 4!addquote 14<quote to add> - Adds given quote if that channel is registered
  }
}

on *:JOIN:#: {
  hadd -m Stats $nick $+ .JoinCount $calc($hget(Stats,$nick $+ .JoinCount) + 1)
  hadd -m Stats $chan $+ .JoinCount $calc($hget(Stats,$chan $+ .JoinCount) + 1)
  if ($hget(Stats,$chan $+ .Record) < $nick($chan,0)) { hadd -m Stats $chan $+ .Record $nick($chan,0) }
  if (!$hget(Stats,$chan $+ .Record)) { hadd -m Stats $chan $+ .Record $nick($chan,0) }
  if (!$hget(Stats,$nick $+ .Start)) { hadd -m Stats $nick $+ .Start $time(h:nntt) pacific on $date | .notice $nick I will be taking stats for you $nick $+ , to view stats type !info $nick }
  if (!$hget(Stats,$chan $+ .Start)) { hadd -m Stats $chan $+ .Start $time(h:nntt) pacific on $date }
  if (!$hget(Stats,$chan $+ .PartCount)) { hadd -m Stats $chan $+ .PartCount 0 }
  if (!$hget(Stats,$nick $+ .PartCount)) { hadd -m Stats $nick $+ .PartCount 0 }
  if (!$hget(Stats,$chan $+ .BanCount)) { hadd -m Stats $chan $+ .BanCount 0 }
  if (!$hget(Stats,$nick $+ .BanCount)) { hadd -m Stats $nick $+ .BanCount 0 }
  if (!$hget(Stats,$nick $+ .BannedCount)) { hadd -m Stats $nick $+ .BannedCount 0 }
  if (!$hget(Stats,$chan $+ .KickCount)) { hadd -m Stats $chan $+ .KickCount 0 }
  if (!$hget(Stats,$nick $+ .KickCount)) { hadd -m Stats $nick $+ .KickCount 0 }
  if (!$hget(Stats,$nick $+ .KickedCount)) { hadd -m Stats $nick $+ .KickedCount 0 }
  hadd -m xSeen $nick J $nick $ctime $chan
  if (%kick. [ $+ [ $knick ] ] == $chan) && ($me isop $chan) {
    ban -u900 $chan $nick
    kick $chan $nick Banned for 15 minutes. Reason: 3 or more kicks within 30 mins
  }
  if ($chan = $hget(HyPeR-v2.0,Chan)) {
    if ($hget(Access,$nick)) {
      tokenize 32 $hget(Access,$nick)
      if ($1 = 8) && ($2 = $address($nick,1)) { mode $chan oa $nick $nick }
      if ($1 = 6) && ($2 = $address($nick,1)) { mode $chan o $nick }
      if ($1 = 4) && ($2 = $address($nick,1)) { mode $chan h $nick }
      if ($1 = 3) && ($2 = $address($nick,1)) { mode $chan v $nick }
    }
    elseif (!$hget(Access,$nick)) && ($nick != $me) { cs akick $chan add $nick You are not Authorized to be here }
  }
  hsave xSeen xSeen.dat
  if (%avoice. [ $+ [ $chan ] ] = ON) {
    .timer 1 1 voice.check $nick $chan
  }
}

on *:PART:#: {
  hadd -m Stats $nick $+ .PartCount $calc($hget($nick $+ .PartCount) + 1)
  hadd -m Stats $chan $+ .PartCount $calc($hget($chan $+ .PartCount) + 1)
  hadd -m xSeen $nick P $nick $ctime $chan $1-
  if ($chan = $hget(HyPeR-v2.0,Chan)) {
    if ($hget(Admins,$nick)) { hdel Admins $nick | .notice $nick [••Access has been turned off••] | ruser $nick }
  }
}

on *:KICK:#: {
  hadd -m Stats $knick $+ .KickedCount $calc($hget(Stats,$knick $+ .KickedCount) + 1)
  hadd -m Stats $chan $+ .KickCount $calc($hget($chan $+ .KickCount) + 1)
  hadd -m Stats $nick $+ .KickCount $calc($hget($nick $+ .KickCount) + 1)
  inc %ki. [ $+ [ $knick ] ]
  if (!$timer(unsetkick [ $+ [ $knick ] ])) { .timerunsetkick [ $+ [ $knick ] ] 1 1800 unset %ki. [ $+ [ $knick ] ] }
  if (%ki. [ $+ [ $knick ] ] >= 3) {
    set %kick. [ $+ [ $knick ] ] $chan
  }
}

on *:BAN:#: {
  if ($bnick) { hadd -m Stats $bnick $+ .BannedCount $calc($hget(Stats,$bnick $+ .BannedCount) + 1) }
  hadd -m Stats $chan $+ .BanCount $calc($hget($chan $+ .BanCount) + 1)
  hadd -m Stats $nick $+ .BanCount $calc($hget($nick $+ .BanCount) + 1)
  if ($hget(AutoJoin,$chan) == $chan spam) {
    if ($bnick) { notice $chan 7Ban Detection:4 $bnick was banned by $nick }
    elseif ($banmask) { notice $chan 7Ban Detection:4 $banmask was banned by $nick }
  }
}

on *:MODE:*: {
  if (+m isin $1) && ($islower(m)) { msg $chan 14[•• $+ $nick Muted tha channel, you can talk if you are +v or higher••] }
  if (-m isin $1) && ($islower(m)) { msg $chan 14[•• $+ $nick unmuted the channel, you can all talk now••] }
}

on *:QUIT: {
  hadd -m xSeen $nick Q $nick $ctime $1-
  if ($nick = $me) { quit HyPeR v2.0 }
}

on *:KICK:#: {
  hadd -m xSeen $knick K $nick $ctime $chan $1-
}

on *:SOCKOPEN:weather*:{
  sockwrite -n $sockname GET /weather/local/ $+ $gettok($sockname,2-,45) $+ ?lswe= $+ $gettok($sockname,2-,45) $+ &lwsa=WeatherLocalUndeclared&from=whatwhere HTTP/1.1
  sockwrite -n $sockname Host: www.weather.com
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname Authorization: Basic
  sockwrite -n $sockname $crlf
}
on *:SOCKREAD:weather*: {
  sockread %temp
  if (">Updated isin %temp) {
    set %we.update $nohtml(%temp) | haltdef
  }
  if (</B></TD> isin %temp) {
    if (&nbsp; isin $nohtml(%temp)) {
      set %we.cond $remove($nohtml(%temp),$chr(9)) | haltdef
    }
  }
  if (ALIGN="left"><H2 CLASS="moduleTitleBar"><B>Right Now for</B><BR> isin %temp) {
    set %we.loc $remove($remove($gettok($nohtml(%temp),3-,32),for),Save Location) | haltdef
  }
  if (Feels Like isin %temp) {
    set %we.temp $remove($nohtml(%temp),$chr(9)) | set %we.temperature $remove($replace($gettok(%we.temp,1,32),&deg;, $+ $chr(176)),Feels) | set %we.feelslike $chr(40) feels like $replace($gettok(%we.temp,3,32),&deg;, $+ $chr(176)) $chr(41) | haltdef
  }
  if (*CLASS="obsTextA">*%</td>* iswm %temp) {
    set %we.hum %temp | set %we.humidity $gettok($gettok(%we.hum,2,62),1,60) | haltdef
  }
  if (*CLASS="obsTextA">*&nbsp;in. iswm %temp) {
    set %we.pr %temp | set %we.pressure $replace($gettok($gettok(%we.pr,2,62),1,60),&nbsp;,$chr(160)) | haltdef
  }
  if (*CLASS="obsTextA">* Low</td>* iswm %temp) {
    set %we.uv %temp | set %we.uvex $gettok($gettok(%we.uv,2,62),1,60) | haltdef
  }
  if (*CLASS="obsTextA">*mph</td>* iswm %temp) {
    set %we.wind %temp | set %we.windex $gettok($gettok(%we.wind,2,62),1,60) | haltdef
  }
  if (*CLASS="obsTextA">*&deg;*</td>* iswm %temp) {
    set %we.dew %temp | set %we.dewpoint $replace($gettok($gettok(%we.dew,2,62),1,60),&deg;, $+ $chr(176)) | haltdef
  }
  if (sunrise: isin %temp) {
    set %we.sunrise $remove($nohtml(%temp),$chr(9),sunrise:)
  }
  if (sunset: isin %temp) {
    set %we.sunset $remove($nohtml(%temp),$chr(9),sunset:)
  }
  if (*CLASS="obsTextA">*miles</td>* iswm %temp) {
    set %we.vis %temp | set %we.visibility $gettok($gettok(%we.vis,2,62),1,60) | haltdef
  }
}
on *:SOCKCLOSE:weather*:{
  if (%we.loc == $null) { msg %we.chan Please choose another Zip Code. | halt }
  else {
    .timer 1 2 msg %we.chan 04Location: %we.loc
    .timer 1 3 msg %we.chan 04Current Temp: %we.temperature / $round($calc(($remove(%we.temperature,$chr(176),$chr(70)) - 32 ) / 1.8),0) $+ $chr(176) $+ $chr(67) 04Feels Like: $remove(%we.feelslike,$( feels like),$chr(41),$chr(40)) / $round($calc(($remove(%we.feelslike,$chr(40),$chr(41),$(feels like),$chr(176),$chr(70)) - 32 ) / 1.8),0) $+ $chr(176) $+ $chr(67)
    .timer 1 4 msg %we.chan 12Current Conditions:  03Pressure: %we.pressure 03Humidity: %we.humidity 03Visibility: %we.visibility 03UV Index: %we.uvex 03Wind: %we.windex 03Dew Point: %we.dewpoint ( $round($calc(($remove(%we.dewpoint,,$chr(176),$chr(70)) - 32) / 1.8),0) $+ $chr(176) $+ $chr(67) ) 03Sunrise: %we.sunrise 03Sunset: %we.sunset
    .timer 1 5 msg %we.chan 03Last Updated: %we.update 03Info From: www.weather.com | unset %we.*  | unset %temp
  }
}

;===========
;= Dialogs =
;===========

dialog HyPeR {
  title "HyPeR v2.0 Setup"
  size -1 -1 171 151
  option dbu
  tab "Main", 14, 3 1 165 146
  button "OK and Close", 2, 7 116 103 13, tab 14 ok cancel
  button "Update", 13, 11 98 44 11, tab 14
  radio "Nick as AV", 12, 11 84 50 10, tab 14
  radio "Nick as Halfop", 11, 11 74 50 10, tab 14
  radio "Nick as Op", 10, 11 64 50 10, tab 14
  radio "Nick as Admin", 9, 11 54 50 10, tab 14
  edit "", 7, 11 25 52 11, tab 14
  edit "", 8, 11 40 52 11, tab 14
  box "Edit Box", 1, 7 16 103 97, tab 14
  edit "", 17, 113 26 50 10, tab 14
  edit "", 18, 113 46 50 10, tab 14
  edit "", 19, 113 66 50 10, tab 14
  edit "", 20, 113 86 50 10, tab 14
  text "Created by PePSiMaN", 21, 113 117 52 10, tab 14
  text "AutoJoin", 24, 65 26 38 9, tab 14 center
  text "Nick Access to HyPeR", 25, 64 39 40 19, tab 14 center
  text "Network", 26, 113 98 50 9, tab 14 center
  text "Bot Channel", 27, 113 77 50 8, tab 14 center
  text "Nickserv Password", 28, 113 57 50 8, tab 14 center
  text "Bot Nick", 29, 114 37 50 8, tab 14 center
  text "", 22, 29 136 131 9, tab 14
  box "Status", 30, 8 130 155 16, tab 14
  tab "Edit List", 15
  box "Access and Autojoin List", 3, 6 19 160 113, tab 15
  combo 4, 10 33 75 81, tab 15 size
  combo 5, 87 33 75 81, tab 15 size
  button "Remove Access", 6, 11 115 74 13, tab 15
  button "Remove Autojoin", 16, 88 115 74 13, tab 15
  text "8 = Admin", 23, 10 132 29 8, tab 15 center
  text "6 = Op", 31, 4 139 34 8, tab 15 center
  text "4 = Halfop", 32, 53 132 34 8, tab 15 center
  text "3 = AV", 33, 52 138 27 8, tab 15 center
  tab "Spam Control", 34
  box "List of Channels", 37, 6 18 81 126, tab 34
  box "List of talkChannels", 39, 87 18 81 111, tab 34
  button "Add selected", 41, 89 131 37 12, tab 34
  combo 42, 88 27 78 99, tab 34 size
  button "Del Selected", 43, 128 131 37 12, tab 34
  combo 40, 8 26 77 116, tab 34 size
  tab "Info", 35
  box "Info", 36, 5 14 162 132, tab 35
  text "Info:", 44, 8 22 157 10, tab 35
  text "Bot info", 45, 8 33 158 33, tab 35
  text "Spam Channel info", 46, 8 70 158 41, tab 35
  text "About:", 47, 8 115 156 29, tab 35
}

dialog xxcomplete {
  title "Setup Successful"
  size -1 -1 135 33
  option dbu
  button "Goodbye", 1, 46 16 37 12, ok cancel
  text "Congratulations, setup was complete", 2, 5 4 126 9, center
  text "PePSiMaN", 3, 87 19 45 8, center
}

;==================
;= Dialog Remotes =
;==================

on *:DIALOG:HyPeR:init:0: {
  set %HyPeR.Setup ON
  did -a HyPeR 22 Starting up...
  did -a HyPeR 44 Info for setup and HyPeR:
  did -a HyPeR 45 HyPeR: HyPeR is a bot intended for 1 network, the bot has an autojoin feature, and access features which allow them to have powers if they are in the bot channel, you must specify a Bot Nick, Password after the nick is registered, a Network ($network), and a Control Channel (Bot channel)
  did -a HyPeR 46 A talkchannel is a channel in the bots autojoin list where he is allowed to respond to the !commands (!seen, !idle, etc.). When a channel is added to the bots AutoJoin list, it is automatically placed in the spam channel list.
  did -a HyPeR 47 HyPeR was scripted by PePSiMaN as an intention to release to the public as an easy to use, friendly bot. If you have any questions feel free to Email me at CamBarton@Live.com
  if (%access.level) { unset %access.level }
  var %xxaccess 1
  while (%xxaccess <= $hget(Access,0).item) {
    tokenize 32 $hget(Access,%xxaccess).data
    did -a HyPeR 4 $hget(Access,%xxaccess).item $1
    inc %xxaccess
  }
  var %xxautojoin 1
  while (%xxautojoin <= $hget(AutoJoin,0).item) {
    did -a HyPeR 5 $hget(AutoJoin,%xxautojoin).item
    did -a HyPeR 40 $hget(AutoJoin,%xxautojoin).item
    if ($hget(AutoJoin,%xxautojoin).data = $hget(AutoJoin,%xxautojoin).item spam) { did -a HyPeR 42 $hget(AutoJoin,%xxautojoin).item }
    inc %xxautojoin
  }
  if ($hget(HyPeR-v2.0,Nick)) { did -a HyPeR 17 $hget(HyPeR-v2.0,Nick) }
  if ($hget(HyPeR-v2.0,Pass)) { did -a HyPeR 18 $hget(HyPeR-v2.0,Pass) }
  if ($hget(HyPeR-v2.0,Chan)) { did -a HyPeR 19 $hget(HyPeR-v2.0,Chan) }
  if ($hget(HyPeR-v2.0,Net)) { did -a HyPeR 20 $hget(HyPeR-v2.0,Net) }
  .timerstartup 1 1 did -a HyPeR 22 Startup Complete...
}

on *:DIALOG:HyPeR:sclick:13: {
  if ($hget(Access,$did(8))) { error.4 | halt }
  if ($hget(AutoJoin,$did(7))) { error.3 | halt }
  if (!$did(7)) && (!$did(8)) { error.1 }
  if ($did(7)) {
    if ($chr(35) !isin $did(7)) {
      error.channel
      halt
    }
    xxupdate $did(7)
  }
  if ($did(8)) {
    if (!%access.level) { error.2 $did(8) | halt }
    xxupdate $did(8) %access.level
    set %xxcount 1
    did -a HyPeR 22 Receiving nick info... please wait...
  }
}

on *:DIALOG:HyPeR:sclick:2: {
  if (!$did(17)) { error.5 | halt }
  if (!$did(19)) { error.5 | halt }
  if (!$did(10)) { error.5 | halt }
  if ($me != $did(17)) { nick $did(17) }
  xxsuccessfull.setup
}

on *:DIALOG:HyPeR:close:0: {
  hadd -m HyPeR-v2.0 Nick $did(17)
  hadd -m HyPeR-v2.0 Pass $did(18)
  hadd -m HyPeR-v2.0 Chan $did(19)
  hadd -m HyPeR-v2.0 Net $did(20)
  hadd -m AutoJoin $did(19) $did(19) spam
  unset %HyPeR.Setup
  hsave AutoJoin AutoJoin.dat
  hsave Access Access.dat
  hsave HyPeR-v2.0 BoT-Configuration.dat
  unset %access.level
  unset %x*
}

on *:DIALOG:HyPeR:sclick:*: {
  if ($did == 5) { set %xtext $did(5).seltext }
  if ($did == 9) { set %access.level 8 }
  elseif ($did == 10) { set %access.level 6 }
  elseif ($did == 11) { set %access.level 4 }
  elseif ($did == 12) { set %access.level 3 }
  elseif ($did == 6) {
    did -d HyPeR 4 $did(4).sel
    hdel -w Access $did(4) $+ *
  }
  elseif ($did == 16) {
    did -d HyPeR 5 $did(5).sel
    hdel AutoJoin %xtext
    did -r HyPeR 40
    did -r HyPeR 42
    var %xxautojoin 1
    while (%xxautojoin <= $hget(AutoJoin,0).item) {
      did -a HyPeR 40 $hget(AutoJoin,%xxautojoin).item
      if ($hget(AutoJoin,%xxautojoin).data = $hget(AutoJoin,%xxautojoin).item spam) { did -a HyPeR 42 $hget(AutoJoin,%xxautojoin).item }
      inc %xxautojoin
    }
  }
  elseif ($did == 41) {
    if (!$did(40)) { halt }
    inc %x. [ $+ [ $did(40) ] ]
    if (%x. [ $+ [ $did(40) ] ] <= 1) {
      if (!$hget(AutoJoin,$did(40))) { halt }
      if ($hget(AutoJoin,$did(40) = $did(40) spam)) { halt }
      else { did -a HyPeR 42 $did(40) | hadd -m AutoJoin $did(40) $did(40) spam }
      hsave AutoJoin AutoJoin.dat
    }
  }
  elseif ($did == 42) {
    set %xchan.status nospam
    set %xchan $did(42)
  }
  elseif ($did == 43) {
    if (!$did(42)) { halt }
    else {
      did -d HyPeR 42 $did(42).sel
      hadd -m AutoJoin %xchan %xchan %xchan.status
    }
    hsave AutoJoin AutoJoin.dat
    unset %x. [ $+ [ $did(42) ] ]
  }
}

Comments

Sign in to comment.
Skylar   -  Feb 06, 2009

u did a great job on this.. im using it for my bot and works good.

 Respond  
Pepsi_Man0077   -  Jun 10, 2008

Yes add yourself as an admin on the bots dialog setup

 Respond  
Adam118   -  May 31, 2008

the bot keeps akicking me when i rejoin its home channel any way to make it not do that?

 Respond  
Pepsi_Man0077   -  May 11, 2008

!help isn\'t how you get the commands, that is !commands lol

 Respond  
^Alexis^   -  May 10, 2008

i think u forgot to add the !idle And !seen thimgs to the command list when type !help

 Respond  
Scakk   -  May 07, 2008

I do not mind it in there, but perhaps mention where you got it.

 Respond  
Pepsi_Man0077   -  May 07, 2008

According to my last comment my xseen alias comes from my last script i made with the !seen and !idle script...

 Respond  
Pepsi_Man0077   -  May 07, 2008

Yes i do admit i did use your weather snippet, i will remove it if you dont like it in there.

the xseen i made though if it has the same alias name or not, i never saw xdameons script

 Respond  
Scakk   -  May 07, 2008

Indeed greenlanter. I knew the xseen was familiar but could not remember whose it was.

 Respond  
greenlanter420   -  May 07, 2008

scakk

it looks like a few peoples work put into a bot like xdaemons xseen

 Respond  
Scakk   -  May 07, 2008

Is there a reason you added a version of the weather bot I posted on Hawkee in your bot?

 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.