mIRC Home    About    Download    Register    News    Help

Print Thread
Running Alias Identifier #38505 27/07/03 12:26 AM
Joined: Jun 2003
Posts: 114
T
Thray Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Jun 2003
Posts: 114
Is there an identifier to tell you what the name of the current alias is?


-------------
I am the self-appointed God of needlessly complex mIRCscript.
Re: Running Alias Identifier #38506 27/07/03 01:12 AM
Joined: Jun 2003
Posts: 36
E
elroyK Offline
Ameglian cow
Offline
Ameglian cow
E
Joined: Jun 2003
Posts: 36
this is the closest i can find..
$scriptline
Returns line number in current script.

Re: Running Alias Identifier #38507 27/07/03 04:27 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
alias somealias {
  var %this = somealias

  ---
  code
  ....
}


-KingTomato
Temporary Replacement #38508 27/07/03 05:05 AM
Joined: Jun 2003
Posts: 114
T
Thray Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Jun 2003
Posts: 114
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)


-------------
I am the self-appointed God of needlessly complex mIRCscript.
Re: Running Alias Identifier #38509 27/07/03 05:11 AM
Joined: Jun 2003
Posts: 114
T
Thray Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Jun 2003
Posts: 114
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. }


-------------
I am the self-appointed God of needlessly complex mIRCscript.
Re: Running Alias Identifier #38510 27/07/03 01:19 PM
Joined: Dec 2002
Posts: 117
R
Rich Offline
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
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


$input(Me like stars, You too?)