SuperTemplate for VC6.0 — File Browser

SuperTemplateforVC6.0v2.0 / SuperTemplateforVC6.0v2.0 / SuperTemplate for VC6.0 - Version 2 / mIRC-DLL.mrc

mIRC-DLL.mrc — 4.01 KB — Download this file

; ***********************************************************************************
; *** Be sure mIRC.dll and mIRC-DLL.mrc remain in the same folder, Otherwise
; *** you will need to modify the $mIRCdll.file identifier below.
; ***********************************************************************************
alias mIRCdll.file { return $+(",$scriptdir,mIRC.dll,") }
alias mIRCdll { return $dll($mIRCdll.file, $1, $iif($2 == $null, -, $2)) }
alias quote { return $+(", $1, ") }

; ***********************************************************************************
; *** Loading the DLL will subclass the mIRC Toolbar's WinProc
; *** The DLL will prevent the default WinProc from receiving the click
; ***********************************************************************************
alias startdll {
  echo -a Load: $mIRCdll(Load)
  echo -a Test: $mIRCdll(Test)
  echo -a Subclass Test
  echo -a Results: $mIRCdll(SubClassTest)
}
on *:load:startdll
on *:start:startdll

; ***********************************************************************************
; *** This signal will occur when a "Mouse, Right Button Up" event occurs
; ***********************************************************************************
on *:signal:Toolbar_RClick:echo -a Signal: $signal
; ***********************************************************************************


; $xgettok -- Works like gettok but allows a token to not count if in quotes and,
;             Allows $null tokens (such as $xgettok(A..C.D, 4, $asc(.)) - returns D)
; ***********************************************************************************
; * Usage: $xgettok(1 "2 2 2" 3, 2, 32) == "2 2 2"
;          $xgettok(1 "2 2 2" 3, 0, 32) == 3 
;          $xgettok(1 2 3 4, 2, 32) == 2
;          $xgettok(1 2 3 4, 2-, 32) == 2 3 4
;          $xgettok(1 2 3 4, 2-3, 32) == 2 3
;          $xgettok(1 2 3 4, -1, 32) == 1 2 3
; ***********************************************************************************
alias xgettok {
  if ($2 isnum) && ($3 isnum) {
    return $mIRCdll(GetTok, $+($$2, $chr(124), $$3, $chr(124), $$1))
  }
}

; $strleft -- Works like $left (supports negative positions)
; ***********************************************************************************
; * Usage: $strleft(12345, 2) - returns 12 
; ***********************************************************************************
alias strleft {
  if ($2 isnum) return $mIRCdll(StrLeft, $2 $1)
}

; $strright -- Works like $right (supports negative positions)
; ***********************************************************************************
; * Usage: $strleft(12345, 2) - returns 45 
; ***********************************************************************************
alias strright {
  if ($2 isnum) return $mIRCdll(StrRight, $2 $1)
}

; $strmid -- Works like $mid
; ***********************************************************************************
; * Usage: $strmid(12345, 2, 2) - returns 23 
; ***********************************************************************************
alias strmid {
  if ($2 isnum) && ($3 isnum) return $mIRCdll(StrMid, $2 $3 $1)
}

; A Seedable $rand replacement
; ***********************************************************************************
; * Usage: $myrand(seed, min, max) - returns random number between min and max
; * Note:  In order for a number to be truely random, seed is usually $ctime
; ***********************************************************************************
alias myrand {
  if ($1 isnum) && ($2 isnum) && ($3 isnum) {
    return $mIRCdll(Rand, $1 $2 $3)
  }
}

; Additional Identifiers (Here for demonstration purposes)
; ***********************************************************************************
; * Usage: $myisin(sub, string) - returns $true/$false
; * Usage: $myisnum(x) - returns $true/$false
; ***********************************************************************************
alias myisnum return $mIRCdll(IsNum, $1)
alias myisin return $mircdll(IsIn, $quote($1) $quote($2))