alias -l options.load {
if ($hget(mirc.options)) return
hmake mirc.options 100
if ($exists($scriptdirmirc.options.ini)) {
hload mirc.options $scriptdirmirc.options.ini
return
}
; TODO: n3, n4, n5, n6, n7
; see: https://web.archive.org/web/20071116220323/http://www.mishscript.de/help/mircini/index.htm
; run "/options -c" whenever this list is updated
; Add the ":*" suffix to any code whose value is numeric (non-boolean).
options.build n0 conn-start,show-user-addr,chan-beep,show-ident-req,highlight,notify,dde-delay:*,kick-rejoin,esc-cancel-away,list-type-active,fill-switchbar,_,list-type-op,list-type-protect,dcc-send-req-action:*,dcc-get-req-minimize,dcc-beep,dcc-chat-req-action:*,connect-perform,dcc-chat-req-minimize,dcc-packet-size:*,single-msg-win,prefix-own-msg,_,dcc-get-beep,dcc-chat-beep,ident-only-conn,chan-list-sort,strip-codes,strip-codes-max:*,hide-ping-pong,line-marker,ident-warn,file-type-ignore-warn,confirm-disconn
options.build n1 event-beep-times:*,event-beep-delay:*,online-timer,online-timer-reset-conn,online-timer-hrs:*,online-timer-mins:*,online-timer-secs:*,multi-line-edit,_,event-disconn-beep:*,skip-motd,conn-localhost,log-chan,log-msg,event-query-beep:*,event-notice-beep:*,dual-monitor,icon-query,whois-query,listen-get-req,buffer-beep,event-invite-beep:*,send-req-msg,auto-arrange,max-get-user,event-flash-beep:*,minimize-tray,default-dirs,default-nicklist,line-spacing:*,titlebar-shift,internal-beep,pc-speaker,nav-clicks,confirm-paste,confirm-paste-max:*
options.build n2 dcc-complete-close,startup-dialog,dcc-get-minimize,event-dcc-send-beep:*,host-lookup:*,listen-raw,listen-ctcp,default-level:*,auto-cascade,dcc-req-timeout:*,dcc-transfer-timeout:*,listen-events,links-listbox,notifies-window,event-highlight-beep:*,finger-req,short-joins,fserve-timeout:*,fserve-req-max:*,fserve-max:*,auto-tile,next-server,highlight-nicks,whois-active,conn-rejoin,confirm-save,always-on-top,show-mode-prefix,notify-display,switchbar-ctrl-tab,editbox-tab,window-on-top,active-alt-z,reload-logs
hsave mirc.options $scriptdirmirc.options.ini
}
alias -l options.build {
var %i = 1, %max = $numtok($2,44)
while (%i < %max) {
var %tok = $gettok($2,%i,44)
var %name = $gettok(%tok,1,58)
hadd -m mirc.options %name $1 %i
if ($numtok(%tok,58) > 1) hadd -m mirc.options __numeric. $+ %name $true
inc %i
}
}
; Usage: $options(NAME)
; Example: //echo -a $options(fill-switchbar) $options(dcc-packet-size)
alias options {
if (!$isid && $1 == -c) { hfree mirc.options | .remove $scriptdirmirc.options.ini | return }
options.load
var %v = $hget(mirc.options,$1)
if (%v == $null || $1 == _) { echo -ac info * $!options: invalid option $1 | halt }
var %l = $gettok(%v,1,32), %n = $gettok(%v,2,32)
var %result = $gettok($readini($mircini,options,%l),%n,44)
if ($hget(mirc.options,__numeric. $+ $1)) return %result
return $iif(%result == 1, $true, $false)
}