mIRC Home    About    Download    Register    News    Help

Print Thread
#99127 29/09/04 02:05 AM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
Code:
 
menu nicklist {
  blah:
  .$submenu($slap($1))
}
alias slap {
  if ($1 == begin) return -
  if ($1 == end) return -
  if ($1 isnum 1-10) return Slap $1 fish $+ : echo describe $chan slaps $nick with $1 fish.
}
 


Is there a way to do this? $nick in this context doesn't function, typically because $nick doesn't exist and secondly because it uses $1 as $nick which is already being used for the submenu?

#99128 29/09/04 02:18 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
menu nicklist {  
  blah:  
  .$submenu($slap($1))
}
alias slap {  
  if ($1 == begin) return -  
  if ($1 == end) return -  
  if ($1 isnum 1-10) return Slap $1 fish $+ : echo describe $chan slaps [color:red]$snicks[/color] with $1 fish.
}


New username: hixxy
#99129 29/09/04 04:04 AM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
Ah, that saves me some lines of code. I figured out a kludge around it. But that is far better.

#99130 29/09/04 08:10 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
FYI, you can pass parameters to the $submenu() alias if you want:
Code:
menu nicklist {
  blah:
  .$submenu($slap($1,[color:blue]$chan[/color],[color:purple]$nick[/color]))
}
alias slap {
  if ($1 == begin) return -
  if ($1 == end) return -
  if ($1 isnum 1-10) return Slap $1 fish $+ : echo describe [color:blue]$2[/color] slaps [color:purple]$3[/color] with $1 fish.
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard