Retribution V101 : Syndicate — File Browser

RetributionSyndicatev1.01 / RetributionSyndicatev1.01 / System / Syndicate / cline.mrc

cline.mrc — 16.55 KB — Download this file

;[----------------------------------------------------------------------]
;[	Name	: Syndicate : Retribution V101				]
;[	Support	: DefCon Industries					]
;[	Author	: Risc							]
;[									]
;[	This Code, Content, is CopyRight 1999 : DefCon Industries	]
;[	No Copying, Ripping, or calling this Code your own		]
;[									]
;[----------------------------------------------------------------------]

alias cline-setup dialog -mdo hd-cline hd-cline

alias unloadCLINE {
  ;unloads the script and removes all variables involed with the script
  echo 4 -a *** Cline Addon has been unloaded
  unset %hd-cline*
  .timer 1 1 unload -rs $script
}
alias -l dialog-fx {
  if ($1 == ?) {
    echo 14 -a * /dialog-fx: This alias does 'special effects' by changing the size of your dialog. The format is: /dialog-fx <type> <x> <y> <end width> <end height> <dname> <table> <jump length> 
    echo 14 -a * /dialog-fx: <type> is the type of fx you wish to do, x & y are just like x and y for /dialog, end width and end height is the FINAL mesurements for your dialog
    echo 14 -a * /dialog-fx: <dname> is the dialog name, <table> is the name of the table to be related to this dialog, <jump length> is basiclly the speed at which the fx runs at. A number between 1-10 for the jump length is recomended.
    echo 14 -a * /dialog-fx: The Types are repersented by letters a to e:
    echo 14 -a * /dialog-fx: a) Makes dialog expand from 0 width to its end width, no height change
    echo 14 -a * /dialog-fx: b) Makes dialog drop down from 0 height to its end height, no length change
    echo 14 -a * /dialog-fx: c) Makes dialog drop down & expand at the same time
    echo 14 -a * /dialog-fx: d) Makes dialog 0 height, expands the dialog, then 'drops' the dialog down
    echo 14 -a * /dialog-fx: e) Makes the dialog 0 width, drops the dialog, then expands the dialog accross.
    echo 14 -ea * /dialog-fx: Example: /dialog-fx b -1 -1 400 355 hdflood hdfood 2 (This requires my flood prot. addon to be loaded).
    echo 14 -ea * /dialog-fx: Created By Pasmal - www.helpdesk.mircx.com/documents
    halt
  }
  ;if the 8th paramter dosn't exist, then the person did not enter enough paramaters to use this alias
  if ($8 == $null) { echo 14 -a * /dialog-fx: insufficient parameters. Use: /dialog-fx <type> <x> <y> <end width> <end height> <dname> <table> <jump length> | halt }  
  ;the first paramter must be a letter, and cannot be more than 1 character 
  if ($1 !isletter abcde) || ($len($1) > 1) { 
    echo 14 -a * /dialog-fx: invalid parameters: You must specify a type from range a to e for first parameter 
    echo 14 -a * /dialog-fx: invalid parameter used: $ifmatch | halt 
  }
  ;paramater 2,3,4,5 & 8 all must be numbers 
  if ($2 !isnum) || ($3 !isnum) || ($4 !isnum) || ($5 !isnum) || ($8 !isnum) { 
    echo 14 -a * /dialog-fx: invalid parameters: You must use numbers for <x> <y> <w> <h> (2nd to 5th parameter) and <jump length> (8th parameter)
    echo 14 -a * /dialog-fx: invalid parameter used: $ifmatch | halt 
  }
  ;if the dialog ($6) is not open, this will open it and rerun the alias  
  if ($dialog($6) == $null) { .timer -m 1 1 dialog -m $6 $7 | .timer -m 1 500 dialog-fx $1- | halt }
  if ($1 == a) {
    dialog -s $6 $2 $3 0 0
    ;type a makes dialog from width 1 expand to its full length
    set %dialog-fx-length 0
    :start
    inc %dialog-fx-length $8
    dialog -s $6 $2 $3 %dialog-fx-length $5
    if (%dialog-fx-length < $4) { goto start }
  }
  if ($1 == b) {
    dialog -s $6 $2 $3 0 0
    ;type b makes dialog from height 1 expand to its full lheight
    set %dialog-fx-height 0
    :start
    inc %dialog-fx-height $8
    dialog -s $6 $2 $3 $4 %dialog-fx-height
    if (%dialog-fx-height < $5) { goto start }
  }
  if ($1 == c) {
    dialog -s $6 $2 $3 0 0
    ;type c is a win98 style drop down
    set %dialog-fx-height 0
    set %dialog-fx-length 0
    :start
    if (%dialog-fx-height < $5) { inc %dialog-fx-height $8 }
    if (%dialog-fx-length < $4) { inc %dialog-fx-length $8 }
    dialog -s $6 $2 $3 %dialog-fx-length %dialog-fx-height
    if (%dialog-fx-length < $4) || (%dialog-fx-height < $5) { goto start } 
  }
  if ($1 == d) {
    ;type d is a weird one :), does length first (no height) then drops down
    set %dialog-fx-height 0
    set %dialog-fx-length 0
    dialog -s $6 $2 $3 0 0
    :start
    inc %dialog-fx-length $8
    dialog -s $6 $2 $3 %dialog-fx-length 0
    if (%dialog-fx-length < $4) { goto start } 
    :startb
    inc %dialog-fx-height $8
    dialog -s $6 $2 $3 %dialog-fx-length %dialog-fx-height
    if (%dialog-fx-height < $5) { goto startb } 
  }
  if ($1 == e) {
    ;type e is another weird one :), does height first (no length) then expands
    set %dialog-fx-height 0
    set %dialog-fx-length 0
    dialog -s $6 $2 $3 0 0
    :startb
    inc %dialog-fx-height $8
    dialog -s $6 $2 $3 0 %dialog-fx-height
    if (%dialog-fx-height < $5) { goto startb } 
    :start
    inc %dialog-fx-length $8
    dialog -s $6 $2 $3 %dialog-fx-length %dialog-fx-height
    if (%dialog-fx-length < $4) { goto start } 
  }
}
dialog hd-cline {
  title "Nicklist Colour Settings..."
  size 20 20 1 1
  button "Done",1,220 15 88 30,OK
  box "NickList Colours",2,5 5 210 190
  text "Normal Nick",3, 15 28 70 25
  text "Opped Nick",4, 15 58 70 25
  text "Voiced Nick",5, 15 83 70 25
  text "Banned Nick",6, 15 108 70 25
  text "Away Nick",7, 15 133 70 25
  text "Oper Nick",8, 15 163 70 25
  combo 9,90 25 120 120,drop
  combo 10,90 55 120 120,drop
  combo 11,90 80 120 120,drop
  combo 12,90 105 120 120,drop
  combo 13,90 130 120 120,drop
  combo 14,90 160 120 120,drop
  box "Other Settings",15,5 190 310 85
  check "Prefix Channel Talk with Users Status",16,15 210 210 20
  check "Update Away/Oper nicks every",17,15 230 168 20
  edit "",18,190 230 35 20,autohs
  text "seconds",19,230 230 60 20
  button "Help",21,220 50 88 30
  check "/Who #chan on Join to Colour List (recomended)",22,15 250 250 20
}
on *:DIALOG:hd-cline:sclick:*: {
  if ($did == 1) {
    ;if you clicked on the Done button, and had chosen to update the away/oper nicks, this will set a timer to do so
    if (%hd-cline-update == 1) && (%hd-cline-update-interval isnum) { .timerCLINEUP 0 %hd-cline-update-interval whoall-cline }
  }
  ;if you check/dechecked the who on join function, this if statement records the change
  if ($did == 22) { set %hd-cline-who-join $did(22).state }
  ;if you clicked on the help button, this if runs the help file
  if ($did == 21) { run cline-help.txt }
  ;if you clicked on the #HelpDesk now icon, mIRC will attempt to open the docs site homepage
  if ($did == 20) { run http://home.dreamhaven.net/~hdesk/documents }
  ;the following 6 if's detect and record any changes to your colour preferences for the nicklist colours
  if ($did == 9) && ($did(9,$did(9).sel).text != $null) { set %hd-cline-col-norm $gettok($did(9,$did(9).sel).text,1,41) }
  if ($did == 10) && ($did(10,$did(10).sel).text != $null) { set %hd-cline-col-op $gettok($did(10,$did(10).sel).text,1,41) }
  if ($did == 11) && ($did(11,$did(11).sel).text != $null) { set %hd-cline-col-voice $gettok($did(11,$did(11).sel).text,1,41) }
  if ($did == 12) && ($did(12,$did(12).sel).text != $null) { set %hd-cline-col-ban $gettok($did(12,$did(12).sel).text,1,41) }
  if ($did == 13) && ($did(13,$did(13).sel).text != $null) { set %hd-cline-col-away $gettok($did(13,$did(13).sel).text,1,41) }
  if ($did == 14) && ($did(14,$did(14).sel).text != $null) { set %hd-cline-col-oper $gettok($did(14,$did(14).sel).text,1,41) }
  ;if you want to prefix peoples nicknames with their status & click on the appropiate checkbox, this if statement picks that up & records your setting
  if ($did == 16) { set %hd-cline-prefix $did(16).state }
  ;if you choose to update the oper/away at a selected interval, then this below if statement sets a variable to tell the script that you want to do so 
  if ($did == 17) { set %hd-cline-update $did(17).state }
}
;this edit event sets a variable to the value of the number of seconds in the update editbox
on *:DIALOG:hd-cline:edit:18: set %hd-cline-update-interval $did(18).text
;mdid2 is one of two aliases that i made to cut down on file size. the first can be found in my flood kicker.
;mdid2 is like /did -switch dialog id1,id2,id3,id3,etc.... TEXT
alias -l mdid2 {
  ;mass /did command
  set %hd-mdid-ids $calc($count($3,$chr(44)) + 1)
  set %hd-mdid-ids-count 0
  :start
  inc %hd-mdid-ids-count 1
  did $1 $2 $gettok($3,%hd-mdid-ids-count,44) $4-
  if (%hd-mdid-ids-count < %hd-mdid-ids) { goto start }
}
on *:LOAD: {
  echo 3 -a *** Cline Script Loaded! You can access this script via the menubar, channel, and status popups.
  set %hd-cline-who-join 1
  set %hd-cline-update-interval 300
  set %hd-cline-update 1
  set %hd-cline-col-away 14
  set %hd-cline-col-ban 4
  set %hd-cline-col-norm 1
  set %hd-cline-col-op 2
  set %hd-cline-col-oper 7
  set %hd-cline-col-voice 10

}
on *:DIALOG:hd-cline:init:0: {
  ;the timer command calls upon another one of my custom aliases to start 'expanding the dialog'. $rand(a,e) determines the style the dialog-fx alias will use 
  .timer -m 1 200  dialog-fx $rand(a,e) 20 20 320 280 hd-cline hd-cline 2
  ;the below few lines are just used to display settings from your last session
  if (%hd-cline-update-interval) { did -a hd-cline 18 %hd-cline-update-interval }
  if (%hd-cline-prefix == 1) { did -c hd-cline 16 }
  if (%hd-cline-who-join == 1) { did -c hd-cline 22 }
  if (%hd-cline-update == 1) { did -c hd-cline 17 }
  ;mdid2 in use :) write the text to all of the drop down combos
  mdid2 -a hd-cline 9,10,11,12,13,14 0) White
  mdid2 -a hd-cline 9,10,11,12,13,14 1) Black
  mdid2 -a hd-cline 9,10,11,12,13,14 2) Blue
  mdid2 -a hd-cline 9,10,11,12,13,14 3) Green
  mdid2 -a hd-cline 9,10,11,12,13,14 4) Lightred
  mdid2 -a hd-cline 9,10,11,12,13,14 5) Brown
  mdid2 -a hd-cline 9,10,11,12,13,14 6) Purple
  mdid2 -a hd-cline 9,10,11,12,13,14 7) Orange
  mdid2 -a hd-cline 9,10,11,12,13,14 8) Yellow
  mdid2 -a hd-cline 9,10,11,12,13,14 9) Lightgreen
  mdid2 -a hd-cline 9,10,11,12,13,14 10) Cyan
  mdid2 -a hd-cline 9,10,11,12,13,14 11) Lightcyan
  mdid2 -a hd-cline 9,10,11,12,13,14 12) Lightblue
  mdid2 -a hd-cline 9,10,11,12,13,14 13) Pink
  mdid2 -a hd-cline 9,10,11,12,13,14 14) Grey
  mdid2 -a hd-cline 9,10,11,12,13,14 15) Lightgrey
  mdid2 -a hd-cline 9,10,11,12,13,14 16) No Change
}
on &^*:TEXT:*:#: {
  ;if you set the script to prefix nicks, then do the following:
  if (%hd-cline-prefix == 1) {
    ;if the person is a voice AND an OP, then display just that
    if ($nick isvo $chan) && ($nick isop $chan) { echo $chan < $+ $clinecol(op,a) $+ @ $+ $clinecol(voice,a) $+ + $+ $nick $+ > $1- | haltdef | goto end }
    ;if the person is JUST an op, then display just that
    if ($nick isop $chan) { echo $chan < $+ $clinecol(op,a) $+ @ $+ $nick $+ > $1- | haltdef | goto end }
    ;    if the person is JUST a voice, then display just that
    if ($nick isvo $chan) && ($nick !isop $chan) { echo $chan < $+ $clinecol(voice,a) $+ + $+ $nick $+ > $1- | haltdef | goto end }
    ;if the person is none of the above, then he is a norm user (sorry efnet - no %help here)
    echo $chan < $+ $nick $+ > $1- | haltdef
    :end
  }
}
alias -l clinecol {
  if ($2 == a) {
    if ($1 == op) && (%hd-cline-col-op != 16) { return %hd-cline-col-op }
    if ($1 == voice) && (%hd-cline-col-voice != 16) { return %hd-cline-col-voice }
    if ($1 == norm) && (%hd-cline-col-norm != 16)  { return %hd-cline-col-norm }
    if ($1 == away) && (%hd-cline-col-away != 16)  {  return %hd-cline-col-away }
    if ($1 == oper) && (%hd-cline-col-oper != 16)  { return %hd-cline-col-oper }
    if ($1 == ban) && (%hd-cline-col-ban != 16)  { return %hd-cline-col-ban }
    ;ok, i hate else if's - SUE ME! =P~
    if ($1 == op) && (%hd-cline-col-op == 16) { return $colour(listbox text) }
    if ($1 == voice) && (%hd-cline-col-voice == 16) { return $colour(listbox text) }
    if ($1 == norm) && (%hd-cline-col-norm == 16)  { return $colour(listbox text) }
    if ($1 == away) && (%hd-cline-col-away == 16)  {  return $colour(listbox text) }
    if ($1 == oper) && (%hd-cline-col-oper == 16)  { return $colour(listbox text) }
    if ($1 == ban) && (%hd-cline-col-ban == 16)  { return $colour(listbox text) }
  }
  if ($1 == op) { return %hd-cline-col-op }
  if ($1 == voice) { return %hd-cline-col-voice }
  if ($1 == norm) { return %hd-cline-col-norm }
  if ($1 == away) {  return %hd-cline-col-away }
  if ($1 == oper) { return %hd-cline-col-oper }
  if ($1 == ban) { return %hd-cline-col-ban }
}
;if the person is voiced, and is not already an op, then change his colour on the nicklist
on *:VOICE:#: if ($vnick !isop $chan) && ($clinecol(voice) != 16) { cline $clinecol(voice) $chan $vnick }
;if the person who has devoiced is not an op, this will colour him as a normal nick
on *:DEVOICE:#: if ($vnick !isop $chan) && ($clinecol(voice) != 16) { cline $clinecol(norm) $chan $vnick }
;if a person is opped, then this will colour him as an op nick
on *:OP:#: if ($clinecol(op) != 16) { cline $clinecol(op) $chan $opnick }
;this colours the nick a normal user when they deop & are not a voice, else it colours them as a voice
on *:DEOP:#: if ($opnick !isvo $chan) && ($clinecol(norm) != 0) { cline $clinecol(norm) $chan $opnick } | if ($opnick isvo $chan) { cline $clinecol(voice) $chan $opnick }
raw 352:*: {
  ;raw 352 is the /who reply for each individual match
  ;based on its reply, we can colour the nicklist according to the users propertys
  if ($7 == H) && ($2 ischan) && ($clinecol(norm) != 16) { cline $clinecol(norm) $2 $6 }
  if (+ isin $7) && ($2 ischan) && ($clinecol(voice) != 16) {  cline $clinecol(voice) $2 $6 }
  if (@ isin $7) && ($2 ischan) && ($clinecol(op) != 16) {  cline $clinecol(op) $2 $6 }
  if (G isin $7) && ($2 ischan) && ($clinecol(away) != 16) {  cline $clinecol(away) $2 $6 }
  if (* isin $7) && ($2 ischan) && ($clinecol(oper) != 16) {  cline $clinecol(oper) $2 $6 }
}
;when you connect to a server, and have your auto update every x seconds, then this will start a timer
on *:CONNECT: if (%hd-cline-update == 1) && (%hd-cline-update-interval isnum) { .timerCLINEUP 0 %hd-cline-update-interval whoall-cline }
;and this will stop the timer when you disconnect
on *:DISCONNECT: if (%hd-cline-update == 1) { .timerCLINEUP OFF }
alias whoall-cline {
  ;this alias /who's all channels you are on
  echo 3 -s *** /who'n all channels as to obtain IRC Operator & Away information
  set %hd-cline-comchan $comchan($me,0)
  set %hd-cline-count 0
  :start
  inc %hd-cline-count 1
  if ($comchan($me,%hd-cline-count)) { who $comchan($me,%hd-cline-count) }
  if (%hd-cline-count < %hd-cline-comchan) { goto start }
}
on *:BAN:#: {
  ;$ialchan(mask,#,N)
  ;colours all users who are affected by a ban with the ban colour
  if ($ialchan($banmask,$chan,0) > 0) && ($clinecol(ban) != 16) {
    set %cline.ban.nicks $ialchan($banmask,$chan,0)
    set %cline.ban.count 0
    :start
    inc %cline.ban.count 1
    if ($ialchan($banmask,$chan,%cline.ban.count).nick) {  cline $clinecol(ban) $chan $ialchan($banmask,$chan,%cline.ban.count).nick }
    if (%cline.ban.count < %cline.ban.nicks) { goto start }
  }
}
on *:UNBAN:#: {
  ;$ialchan(mask,#,N)
  ;removes the ban colour from all people affected by an unban to their current status (i.e. reg user, voice, op)
  if ($ialchan($banmask,$chan,0) > 0) && ($clinecol(norm) != 16) {
    set %cline.uban.nicks $ialchan($banmask,$chan,0)
    set %cline.uban.count 0
    :start
    inc %cline.uban.count 1
    if ($ialchan($banmask,$chan,%cline.uban.count).nick) {
      if ($ialchan($banmask,$chan,%cline.uban.count).nick isreg $chan) { cline $clinecol(norm) $chan $ialchan($banmask,$chan,%cline.uban.count).nick }
      if ($ialchan($banmask,$chan,%cline.uban.count).nick isop $chan) { cline $clinecol(op) $chan $ialchan($banmask,$chan,%cline.uban.count).nick }
      if ($ialchan($banmask,$chan,%cline.uban.count).nick isvo $chan) && ($ialchan($banmask,$chan,%cline.uban.count).nick !isop $chan) { cline $clinecol(voice) $chan $ialchan($banmask,$chan,%cline.uban.count).nick }
    }
    if (%cline.uban.count < %cline.uban.nicks) { goto start }
  }
}
on me:*:JOIN:#: { 
  ;if you want to /who #chan on join then this script will set a timer for 5 seconds
  ;once five seconds is up, an alias will check to see if another script has already /who'd the channel ($chan(#).ial)
  ;if it has not, then this script will /who the #channel
  if (%hd-cline-who-join == 1) { .timer 1 5 cline-up-ial $chan }
}
alias cline-up-ial {
  if ($chan($1).ial == $false) { who $1 }
}