Dynamic K9 Popups — File Browser

DynamicK9Popupsv4.13 / DynamicK9Popupsv4.13 / dk9.mrc

dk9.mrc — 18.49 KB — Download this file

; ######################################
; #
; #   Dynamic K9 Popups   ###   flipster@netegra.com
; #                      http://dk9.tripod.com
; #
; ######################################
alias k9.version return 4.12
alias k9.home return http://dk9.tripod.com/
alias k9.email return pgeurtz@email.com
alias qa if ($isalias(qa) != $true) quickauth $1 $2
alias k9.uload .timer 1 0 k9unload
alias k9.read return $readini -n $scriptdirdk9.ini $1 $2
alias k9.read.com $readini $scriptdirdk9.ini $1 $2
alias k9.write .writeini -n $scriptdirdk9.ini $1-
alias k9.rem .remini $scriptdirdk9.ini $1-
alias k9.raw raw -q privmsg $1-
alias k9.1 return -cr @Createhelp $k9.3 14 5 $1 $k9.6
alias k9.2 return -cr @Createhelp $k9.3 12 5 $1 $k9.7
alias k9.3 return $rgb(0,0,0) Arial
alias k9.4 return -cr @Createhelp $k9.3 12 15 $1 $k9.7
alias k9.5 return -cr @Createhelp $k9.3 14 15 $1 $k9.6
alias k9.6 return 190 15
alias k9.7 return 190 12
alias k9.8 return Arial 14 5 5 $k9.6
alias k9.9 return -cor @Createhelp
alias k9.b return @Createhelp 0 0 $scriptdirdk9.bmp
alias k9.c return @Createhelp $nofile($scriptdirdk9.bmp)
alias k9check socku http://members.tripod.com/dk9/index.htm DynamicK9Popups $k9.version $k9.read(data,autoupgrade) dk9n mrc $scriptdir 0 Dynamic K9 Popups
alias k9.a {
  drawsave $k9.c $+ $1 $+ .bmp
  drawpic $k9.b
}
alias k9.help {
  k9.rem help 
  k9.write check 1 Help 
  k9.write check help 1 
  k9.write help parm $1
}
alias k9.com {
  k9.rem help 
  k9.write check 1 Commands 
  k9.write check com 1 
  k9.write help parm $1
}
alias k9.banlist {
  k9.rem banlist 
  k9.write check banlist 1 
  k9.write banlist channel $1 
  k9.write banlist date $fulldate
}
alias k9.access {
  k9.rem access 
  k9.rem check again 
  k9.write check access 1 
  k9.write access channel $1 
  k9.write access parm $iif(($2),$2,-) 
  k9.write access date $fulldate
}
alias k9fix {
  k9.rem check
  k9.rem auth
  echo $colour(info2) -a *** Fixing Auth log, you can AUTH with k9 now
}
alias quickauth {
  if ($chatserv != chatnet) echo $colour(info2) -a *** This command is only available for use on Chatnet servers
  elseif ($2) && ($left($1,1) == $chr(35)) k9.raw k9@k9.chatnet.org :auth $1 $2 
  elseif ($2) && ($left($2,1) == $chr(35)) k9.raw k9@k9.chatnet.org :auth $2 $1
  elseif ($1) && ($left($1,1) == $chr(35)) k9.raw k9@k9.chatnet.org :auth $1 $k9.password(1)
  elseif ($1) && ($active ischan) k9.raw k9@k9.chatnet.org :auth # $1
  elseif ($1) k9.raw k9@k9.chatnet.org :auth $iif(($script(dk9.ppa)),$_entry(0,#,What channel do you want to auth in?),$$?="Channel") $1
  elseif ($active ischan) k9.raw k9@k9.chatnet.org :auth $active $k9.password(1)
  elseif ($active !ischan) k9.raw k9@k9.chatnet.org :auth $iif(($script(dk9.ppa)),$_entry(0,#,What channel do you want to auth in?),$$?="Channel") $k9.password(1)
}
alias raw { 
  if ($1 == -q) && (($3 == k9@k9.chatnet.org) || ($3 == k9)) {
    if ($4 == :auth) {
      if ($k9.read(check,auth)) || ($k9.read(check,check)) {
        var %k9count = 0
        :loop1
        inc %k9count 1
        if ($k9.read(auth,%k9count)) goto loop1
        k9.write auth %k9count $5-
        echo $colour(info2) -a *** Delayed auth - Dynamic K9 processing
        return
      }
    }
    k9.triggers $remove($4-,$left($4,1)) 
  }
  elseif (($2 == k9@k9.chatnet.org) || ($2 == k9)) {
    if ($3 == :auth) {
      if ($k9.read(check,auth)) || ($k9.read(check,check)) {
        var %k9count = 0
        :loop2
        inc %k9count 1
        if ($k9.read(auth,%k9count)) goto loop2
        k9.write auth %k9count $4-
        echo $colour(info2) -a *** Delayed auth - Dynamic K9 processing
        return
      }
    }
    k9.triggers $remove($3-,$left($3,1)) 
  }
  raw $1-
}
alias msg { 
  if (($1 == k9@k9.chatnet.org) || ($1 == k9)) {
    if ($2 == auth) {
      if ($k9.read(check,auth)) || ($k9.read(check,check)) {
        var %k9count = 0
        :loop1
        inc %k9count 1
        if ($k9.read(auth,%k9count)) goto loop1
        k9.write auth %k9count $3-
        echo $colour(info2) -a *** Delayed auth - Dynamic K9 processing
        return
      }
    }
    k9.triggers $2- 
  }
  if ($halted) return 
  msg $$1-
}
alias chatserv {
  if ($k9.read(data,server)) && (chatnet !isin $server) return not 
  elseif ($network) return $network
  elseif (chatnet isin $server) return chatnet 
  else return not
}
alias k9unload { 
  if ($script(dk9.ppa)) return
  if ($?!="Are you sure you want to unload?") { 
    .unload -rs $scriptdirdk9_dialog.mrc 
    .ruser k9 k9!k9@k9.chatnet.org 
    echo $colour(info2) -a *** Unloaded Dynamic K9 Popups $k9.version $+ , its /load -rs $script $+  to reload 
    if ($script(dk9_popup_option.mrc)) .unload -rs $script(dk9_popup_option.mrc)
    .timer 1 0 .unload -rs $script 
  } 
  else echo $colour(info2) -a *** Good! 
}
alias k9.password {
  if ($k9.read(data,password)) {
    if ($1) return $k9.read(data,password)
    elseif ($k9.read(data,auth)) return $k9.read(data,password)
  }
  elseif ($script(dk9.ppa)) return $_entry(0,$null,What is your password?) 
  else return $$?="Enter password" 
}
alias k9.count { 
  var %k9count = 0 
  :loop 
  inc %k9count
  if ($k9.read($1,%k9count)) goto loop 
  return %k9count
} 
alias k9.triggers { 
  if ($chatserv != chatnet) return 1 
  if ($1 == auth) { k9.write check auth 1 | k9.write check channel $2 } 
  elseif ($1 == access) && ($k9.read(check,check)) return
  elseif ($1 == banlist) && ($k9.read(check,b-again) != 1) && ($k9.read(data,dialog)) k9.banlist $2
  elseif ($1 == access) && ($k9.read(check,auth) != 1) && ($k9.read(check,a-again) != 1) && ($k9.read(data,dialog)) k9.access $2 $3
  elseif ($1 == help) && ($k9.read(data,dialog)) k9.help $2 
  elseif ($1 == commands) && ($k9.read(data,dialog)) k9.com $2 
  elseif ($k9.read(check,access)) && ($1 == access) return 
}
alias k9.apply.changes.2 {
    k9.raw k9 : $+ $k9.read(apply,$k9.read(apply,total)) 
  k9.write apply total $calc($k9.read(apply,total) - 1) 
  if ($k9.read(apply,total) == 0) {
    k9.rem apply 
    k9.rem check
  }
}
alias k9.auto.auth {
  if ($istok($k9.read(data,channels),$1,58)) return
  elseif ($?!="Add to Auto-auth list?") k9.write data channels $addtok($k9.read(data,channels),$1,58)
}
alias k9.process.auth {
  k9.rem check
  var %k9count = 0
  :loop
  inc %k9count 1
  if ($k9.read(auth,%k9count)) goto loop
  if (%k9count == 1) return
  dec %k9count 1
  k9.raw k9@k9.chatnet.org :auth $k9.read(auth,%k9count)
  k9.rem auth %k9count
}
ctcp *:*:if ($istok(addon.add-on.clientinfo.userinfo.script,$1,46)) && ($script(dk9.ppa) == $null) .ctcpreply $nick ADDON Dynamic k9 Popups $k9.version loaded < $+ $k9.home $+ >
on *:connect:{
  if ($script(upgrade_module.mrc)) && ($k9.read(data,upgrade)) k9check
  k9.rem session
  k9.rem check
  k9.rem auth
}
on *:disconnect:k9.rem session
on *:load:{
  if ($script(dk9.ppa)) return
  if ($version < 5.61) {
    echo $colour(info2) -a *** Only works with mIRC v5.61
    .timer 1 1 .unload -rs $script 
  }
  else {
    echo $colour(info2) -a *** Intializing
    var %k9count = 0
    :loop
    inc %k9count 1
    if ($exists($scriptdir $+ %k9count $+ .bmp)) remove $scriptdir $+ %k9count $+ .bmp
    if (%k9count < 20) goto loop
    window -np +d @Createhelp -1 -1 200 170
    drawpic $k9.b
    drawtext $k9.9 $rgb(0,0,120) Arial 21 6 10 190 21 Dynamic K9 Popups
    drawtext $k9.9 $k9.3 14 60 60 $k9.6 online help
    drawtext -cr @Createhelp $k9.3 14 65 100 $k9.6 Click here
    drawtext -cr @Createhelp $k9.3 14 40 115 $k9.6 or the list to the left
    k9.a 1
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /quickauth
    drawtext $k9.1(20) /quickauth is an alternative way to
    drawtext $k9.1(35) auth with K9. Its not meant to replace
    drawtext $k9.1(50) how you auth, but to provide another
    drawtext $k9.1(65) way.
    drawtext $k9.2(80) SYNTAX /quickauth
    drawtext $k9.2(93) [password|channel]
    drawtext $k9.2(106) channel and password are interchangeable,
    drawtext $k9.2(119) or leave them blank and it will use the saved
    drawtext $k9.2(132) password or ask for it and the channel or use
    drawtext $k9.2(145) $ $+ active.
    k9.a 3
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /qa
    drawtext $k9.1(20) Shorter form of /quickauth, exact
    drawtext $k9.1(35) same syntax.
    drawtext $k9.1(65) Made this an alternative shortcut
    drawtext $k9.1(80) because some scripts use /qa.
    k9.a 4
    drawtext $k9.9 $rgb(0,0,120) $k9.8 AUTH
    drawtext $k9.1(20) Will catch it anytime you auth with K9,
    drawtext $k9.1(35) no matter if its another shortcut or
    drawtext $k9.1(50) script, and wether you message or use 
    drawtext $k9.1(65) raw format. It does not do anything 
    drawtext $k9.1(80) except when you auth, it does a few
    drawtext $k9.1(95) things, nothing bad, don't belive me?
    drawtext $k9.1(110) look in the script.
    k9.a 6
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /k9fix
    drawtext $k9.1(20) Will clear the auth list in case an
    drawtext $k9.1(35) a previous attmpt to auth failed.
    k9.a 7
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /k9custom
    drawtext $k9.1(20) Brings up the customize menu, its
    drawtext $k9.1(35) not meant to be used that often, but
    drawtext $k9.1(50) incase the popups arn't there or you
    drawtext $k9.1(65) like using the keyboard more.
    k9.a 8
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /k9help
    drawtext $k9.1(20) Will bring up this dialog, so you can
    drawtext $k9.1(35) have easy access to this help file.
    k9.a 9
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /k9check
    drawtext $k9.1(20) Will check the DKP website  for any
    drawtext $k9.1(35) updates. You can check for updates
    drawtext $k9.1(50) on connect* and download the
    drawtext $k9.1(65) update automatically*.
    drawtext $k9.2(85) This feature was taken out, but we brought
    drawtext $k9.2(98) it back for v4.0
    drawtext $k9.2(118) Only works if the upgrade_module.mrc is
    drawtext $k9.2(131) loaded
    drawtext $k9.1(150) * option
    drawtext $k9.1(160) * not available yet
    k9.a 10
    drawtext $k9.9 $rgb(0,0,120) $k9.8 /k9unload
    drawtext $k9.1(20) Unload Dynamic K9 Popups real fast.
    drawtext $k9.1(35) It will ask you if you are sure first, just
    drawtext $k9.1(50) to make sure.
    k9.a 11
    drawtext $k9.9 $rgb(120,0,0) $k9.8 Dialogs
    drawtext $k9.1(20) With the advent of dialogs in mIRC 5.5
    drawtext $k9.1(35) it opened up a whole new way to do
    drawtext $k9.1(50) things in mIRC.
    drawtext $k9.1(65) There is an option to use dialogs or
    drawtext $k9.1(80) the normal way to display K9's
    drawtext $k9.1(95) responses, usually access and banlist.
    k9.a 13
    drawtext $k9.9 $rgb(120,0,0) $k9.8 Update
    drawtext $k9.1(20) Dynamic K9 Popups will check the
    drawtext $k9.1(35) DKP website for any updates and
    drawtext $k9.1(50) automatically download them.
    drawtext $k9.1(65) Options: can check for updates on
    drawtext $k9.1(80) connect, will automatically download
    drawtext $k9.1(95) if update exists.
    k9.a 15
    drawtext $k9.9 $rgb(0,120,0) $k9.8 Credits
    drawtext $k9.1(20) Thanks to pooch, herc128, and |Dude|
    drawtext $k9.5(35) for testing.
    drawtext $k9.1(50) Special thanks to CHRiSTy41 for giving
    drawtext $k9.5(65) me access in the beginning.
    drawtext $k9.1(80) Shouts out to paIRC's webboard and 
    drawtext $k9.5(95) text documents.
    drawtext $k9.1(110) Credits go up to sik0fewl, Sting, and pai
    k9.a 16
    drawtext $k9.9 $rgb(0,120,0) $k9.8 Miscellaneous
    drawtext $k9.1(20) Dynamic K9 Popups tries not to 
    drawtext $k9.1(35) complicate other addons but to 
    drawtext $k9.1(50) compliment them.
    drawtext $k9.1(70) Currently supported scripts:
    drawtext $k9.4(83) Peace & Protection 4.00; ircN 7.11;
    drawtext $k9.4(96) ShowDown v10 Pro; I² 1.04; Basic 3.0;
    drawtext $k9.4(109) VirusScript 2øøø; Havok 2k; Leopard
    drawtext $k9.4(122) Script 2000; Elite Script 2000; [AciD
    drawtext $k9.4(135) Script] 2000;  7th SpaRRow 5.0;
    drawsave $k9.c $+ 17.bmp
    window -c  @Createhelp
    .load -rs $scriptdirdk9_dialog.mrc
    .auser -a k9 k9!k9@k9.chatnet.org Chatnet's channel services otherwise known as K9
    if ($exists($scriptdirdk9_popup_option.mrc)) && ($?!="Press yes to load the dynamic popups $+ $crlf $crlf $+ Press no to just load the interface $+ $crlf $crlf $+ You can always load the popups later, look for dk9_popup_option.mrc") .load -rs $scriptdirdk9_popup_option.mrc
    k9custom
  }
}
on *:join:#:{
  if (($nick == $me) || ($nick == k9)) && ($istok($k9.read(data,channels),$chan,58)) && ($k9.read(data,password)) && ($k9.read(data,auto)) && ($chatserv == chatnet) k9.raw k9@k9.chatnet.org :auth $chan $k9.read(data,password)
}
on *:input:#:{
  if ($1 == k9) && ($3) k9.triggers $$2 $active $3- 
  elseif ($1 == k9) k9.triggers $$2 $active
}
on *:input:k9:k9.triggers $1-
raw 401:*k9*:if ($2 == k9) && $k9.read(check,auth) k9fix
on !^k9:notice:*:?:{
  if ($k9.read(check,apply)) { k9.apply.changes.2 }
  elseif ($k9.read(check,auth)) && ($1- === AUTHENTICATION SUCCESSFUL! Yes Master!) {
    k9.rem check auth 
    k9.write check check 1 
    k9.write session channels $addtok($k9.read(session,channels),$k9.read(check,channel),58) 
    if ($script(dk9.ppa)) .timer 1 0 k9.auto.ppa $k9.read(check,channel);
    else .timer 1 0 k9.auto.auth $k9.read(check,channel) 
    k9.raw k9 :access $k9.read(check,channel) $me 
    if ($k9.read(data,echo)) { 
      .timer 1 0 k9yesmaster $1- 
      haltdef
    }
  }
  elseif ($k9.read(check,check)) { 
    .timerk9access.check off
    if ($gettok($1,1,58) === ULEVEL) k9.write level $k9.read(check,channel) $gettok($1,2,58) 
    if ($gettok($1,1,58) === MASK) .timerk9access.check 1 3 k9.process.auth
    haltdef
  }
  elseif ($k9.read(check,banlist)) {
    if ($gettok($1-,1,58) === BANNED MASK) { 
      k9.write check ban $k9.count(banlist) 
      k9.write banlist $k9.read(check,ban) $addtok($k9.read(banlist,$k9.read(check,ban)),$gettok($gettok($1-,2,32),2,58),127) 
      k9.write banlist $k9.read(check,ban) $addtok($k9.read(banlist,$k9.read(check,ban)),$gettok($gettok($1-,4,32),2,58),127)
    }
    elseif ($gettok($1-,1,58) === REASON)  if ($gettok($1-,2-,58)) k9.write banlist $k9.read(check,ban) $addtok($k9.read(banlist,$k9.read(check,ban)),$gettok($1-,2-,58),127) 
    elseif ($gettok($1-,1,58) === BANNED FROM) {
      k9.write banlist $k9.read(check,ban) $instok($k9.read(banlist,$k9.read(check,ban)),$gettok($1-,3,32),3,127)
      k9.write banlist $k9.read(check,ban) $instok($k9.read(banlist,$k9.read(check,ban)),$gettok($1-,4,32),4,127) 
      k9.write banlist $k9.read(check,ban) $instok($k9.read(banlist,$k9.read(check,ban)),$gettok($gettok($1-,7,32),2,58),5,127)
      if ($numtok($1-,32) > 7) k9.write banlist $k9.read(check,ban) $instok($k9.read(banlist,$k9.read(check,ban)),$gettok($1-,8,32),6,127) 
    }
    elseif ($1-2 === k9 banlist) { 
      k9.write check b-again 1 
      k9.raw k9 :banlist $3 $4
    } 
    elseif ($1-3 === End of BanList) && ($k9.read(check,b-again) != 1) k9.show.banlist
    elseif ($1-8 === Displaying up to 10 records starting with record) k9.rem check b-again
    haltdef
  }
  elseif ($k9.read(check,access)) {
    .timeraccess off
    if ($gettok($1-,1,58) === USERID) { 
      k9.write check nick $k9.count(access)
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($gettok($1-,2,58),1,32),1,127) 
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($1-,3,58),2,127) 
    }
    elseif ($gettok($1-,1,58) === ULEVEL) { 
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($gettok($1-,2,58),1,32),3,127)
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($gettok($1-,3,58),1,32),4,127)
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($gettok($1-,4,58),1,32),4,127)
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$iif(($gettok($1-,5,58)),$gettok($1-,5,58),n),6,127) 
    }
    elseif ($gettok($1-,1,58) === LAST SEEN) { 
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($1-,3,32),7,127) 
      k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$gettok($1-,4,32),8,127) 
    }
    elseif ($gettok($1-,1,58) === COMMENT) k9.write access $k9.read(check,nick) $instok($k9.read(access,$k9.read(check,nick)),$iif(($gettok($1-,2,58)),$gettok($1-,2-,58), ),9,127)
    elseif ($gettok($1-,1,58) === MASK) {
      if ($gettok($k9.read(access,$k9.read(check,nick)),10,127)) k9.write access $k9.read(check,nick) $reptok($k9.read(access,$k9.read(check,nick)),$gettok($k9.read(access,$k9.read(check,nick)),10,127),$addtok($gettok($k9.read(access,$k9.read(check,nick)),10,127),$gettok($1-,2-3,58),30),1,127) 
      else k9.write access $k9.read(check,nick) $addtok($k9.read(access,$k9.read(check,nick)),$gettok($1-,2-3,58),127)
      if ($istok(61.62.45,$chr($left($k9.read(access,parm),1)),46) == $false) .timeraccess 1 2 k9.show.access
    }
    elseif ($1-2 === k9 access) { 
      k9.write check a-again 1 
      k9.raw k9 :access $3 $4 $iif(($5),$5)
    } 
    elseif ($1-3 === End of Access) && ($k9.read(check,a-again) != 1) k9.show.access
    elseif ($1-8 === Displaying up to 10 records starting with record) k9.rem check a-again 
    haltdef
  }
  elseif ($k9.read(check,com)) { 
    .timerk9com.check off 
    k9.write help help $k9.read(help,help) $1- $chr(36) $+ crlf 
    .timerk9com.check 1 1 k9.show.help
    haltdef 
  }
  elseif ($k9.read(check,help)) { 
    .timerk9help.check off 
    k9.write help help $k9.read(help,help) $1- $chr(36) $+ crlf 
    .timerk9help.check 1 1 k9.show.help
    haltdef
  }
  elseif ($k9.read(data,echo)) {
    if ($1- === Yes master.) || ($1- === Sorry you dont have rights to do that.) || ($1- === Do i know you?) || ($1- === AUTHENTICATION FAILED! Better luck next time.) || ($1- === you need a #channel after the command if you are on more than one channel with me.) || ($1-5 === Sorry master i don't see) || (($1-2 === Yes master) && ($4-6 === Has no access.)) || ($1- === That's funny I see a @ by their name, don't you master?.) || ($1- === Sorry master, I don't see that nick on the channel.) || ($1- === Sorry nick already has a valid mask.) { 
      .timer 1 0 k9yesmaster $1- 
      haltdef
    }
  }
}