mIRC Homepage
Posted By: Thray Running Alias Identifier - 27/07/03 12:26 AM
Is there an identifier to tell you what the name of the current alias is?
Posted By: elroyK Re: Running Alias Identifier - 27/07/03 01:12 AM
this is the closest i can find..
$scriptline
Returns line number in current script.
Posted By: KingTomato Re: Running Alias Identifier - 27/07/03 04:27 AM
Code:
alias somealias {
  var %this = somealias

  ---
  code
  ....
}
Posted By: Thray Temporary Replacement - 27/07/03 05:05 AM
Temporary in the sense that I hope mIRC will someday have a $calias or something identifier...

alias this { return $gettok($read($1,$2),2,32) }

call $this($script,$scriptline)
Posted By: Thray Re: Running Alias Identifier - 27/07/03 05:11 AM
That doesn't help me.

alias bannou.cmd.list { bannou.list $1-2 }

That is what I am doing. Basically, I have a server script that, when it recieves text, does a $isalias(bannou.cmd.<first word of text>) If thats true, it calls it and sends it the socket name and character name, and any text that comes with it ($3-, not used in the above command)

That alias then sends it to the actual command.

Rather roundabout, yes.... but the average person can easily change the command and syntax for any command in the bot.

I have a whole documentation thing on how it works (and the actual script itself as it is developed) at
http://landale.algolx.net/bannou/bannou-aliases.ini

So, the idea is.. if there were such an identifier I could add like..
if ($3 == help) { sockwrite -n $1 The command, $aliasname $+ , does stuff! W007. }
Posted By: Rich Re: Running Alias Identifier - 27/07/03 01:19 PM
If all these aliases are called from the same place you could set a global var (or even better, put it in a hash table) with the alias you're going to call
something like
Code:
on *:sockread:cmdsock:{
  .....
  if ($isalias(bannou.cmd. $+ $1) {
    set %bannou.alias bannou.cmd. $+ $1
    bannou.alias $sockname $charname? $2-
    unset %bannou.alias
  }
}
alias bannou.cmd.list {
  if ($3 == help)  { sockwrite -n $1 The command, %bannou.alias $+ , does stuff! W007. }
  else { blah }
}

I hope this helps
© mIRC Discussion Forums