################################################################

# Set this to the password you're bot is to use to identify with. / Set password nick bot
set nickpass "tambunmarisi"

# Set the service client bots on the network here. / Set nama service server anda
# These are set to DALnet at present so they will not work if changed.
set nickserv "nickserv@services.dal.net"
set chanserv "chanserv@services.dal.net"
set memoserv "memoserv@services.dal.net"

# End of Configuration
# Do not modify below this line

# Lets start identifying to the server once connected and remove modes "sw".
set init-server {
putserv "PRIVMSG $nickserv :identify $nickpass"
putserv "MODE $botnick -sw"
}

# We may need to know when to identify again, so this takes care of that.
# Do not modify if you use dalnet, otherwise change to you're suited network.
bind notc - "*This nick is owned by someone else*" ident_nickserv
bind notc - "*Password accepted for*" op_chanserv
bind notc - "*You have*" rm_memos

# Some binds, best leave alone ey? :)
bind dcc o rop op_chanserv
bind dcc o identify dcc_identify

proc ident_nickserv { nick uhost hand args } {
 global botnick nickpass nickserv
    putlog "Ada notice dari $nickserv"
    putserv "PRIVMSG $nickserv :identify $nickpass"
    putlog "Identify ke $nickserv dulu nih"
  }

proc dcc_identify { hand idx mascara } {
 global nickserv botnick nickpass 
 putserv "PRIVMSG $nickserv :identify $nickpass"
 }

proc op_chanserv { nick uhost hand args } {
   global botnick chanserv channame
     putlog "Password diterima. Minta @ ke $chanserv ahh"
     foreach channame [channels] {
     putserv "PRIVMSG $chanserv :OP $channame $botnick" }
     putlog "Mbah $chanserv @ gue di $channame dong"
}

proc rm_memos { nick uhost hand args } {
   global botnick memoserv
     putlog "Ada memo notice dari $memoserv"
     putserv "PRIVMSG $memoserv :DEL ALL"
     putlog "Gue gak butuh memo. hapus aja!"
}

putlog "autoidentify.tcl by dex loaded"
