$isalias: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
Daveoh (talk | contribs)
mNo edit summary
Daveoh (talk | contribs)
m added to aliases category
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Returns [[$true]] if the specified name is an alias command that exists in your aliases or scripts.
Returns [[$true]] if the specified name is an alias that exists in your aliases or scripts.
  $isalias(name)
  $isalias(name)
Properties:
===Properties===
* fname - returns the filename in which the alias exists
* '''fname''' - returns the filename in which the alias exists
* alias - returns the alias definition
* '''alias''' - returns the alias definition
==Example==
==Example==
  $isalias(join)       returns $true if you have an alias for /join
[[alias]] -l cow { [[say]] Cows go moo! }
alias fish {
  [[if]] (fishbot [[If-then-else#ison|ison]] [[$active]]) say I love the smell of fish in the morning.
  else say I wish I could smell fish.
}
  $isalias(cow)           returns $true since we have a cow alias.
$isalias(fish).fname    returns the filename in which the alias is saved or ''[[$null|null]]'' if the alias doesn't exist.
$isalias(fish).alias    returns fish {
$isalias(cow).alias     returns cow -l { say Cows go moo! }


$isalias(join).fname        returns the filename in which the alias exists
If the above $isalias() calls are being called from outside the same remote file as the cow alias mirc would return $false since cow is a local alias and the .alias property would return null.
 
$isalias(join).alias       returns the alias definition for /join
==See Also==
==See Also==
* [[alias|/alias]]
* [[alias|/alias]]
[[Category:Identifiers]]
[[Category:Identifiers]]
[[Category:Aliases]]

Latest revision as of 16:12, 29 November 2009

Returns $true if the specified name is an alias that exists in your aliases or scripts.

$isalias(name)

Properties

  • fname - returns the filename in which the alias exists
  • alias - returns the alias definition

Example

alias -l cow { say Cows go moo! }
alias fish {
  if (fishbot ison $active) say I love the smell of fish in the morning.
  else say I wish I could smell fish.
}

$isalias(cow)           returns $true since we have a cow alias.
$isalias(fish).fname    returns the filename in which the alias is saved or null if the alias doesn't exist.
$isalias(fish).alias    returns fish {
$isalias(cow).alias     returns cow -l { say Cows go moo! }

If the above $isalias() calls are being called from outside the same remote file as the cow alias mirc would return $false since cow is a local alias and the .alias property would return null.

See Also