mIRC Homepage
Posted By: laz Help with $submenu - 10/02/03 03:50 AM
Anybody have an idea of how to put menus in submenus? Here is my code:

Code:
  
menu menubar {
  .Script
  ..$submenu($channels($1))
}

alias channels {
  var %i $1, %s $lines(script.txt)
  while (%i <= %s) {
    tokenize 32 $read(script.txt,%i)
    return $+($1,:echo -a $2-)
    inc %i
  }
}



With this you could just put something like:

#test4 Hi guys

in script.txt, then clicking #test4 in your menubar under Script will echo 'Hi guys' to your active window. There is no point to this yet, but I want to add menus to the #test4 submenu like: Change echo lines, delete etc...

I've tried doing something like:

Code:
menu menubar {
  .Script
  ...$submenu($channels($1))
}


Adding an extra dot, but no luck, and tried return extra dots in my channels alias but no luck. If anybody can help out that will be great.
Posted By: Aubs Re: Help with $submenu - 10/02/03 12:11 PM
From the /help $submenu file:

Note: You can't use this to create nested submenus, it will only build one single submenu.

Doesn't seem as if you can nest $submenu()'s.

From what I gather, they are only used in this type of environment...
again from /help $submenu:
Code:
menu status {
  Animal
  .$submenu($animal($1))
}

alias animal {
  if ($1 == begin) return -
  if ($1 == 1) return Cow:echo Cow
  if ($1 == 2) return Llama:echo Llama
  if ($1 == 3) return Emu:echo Emu
  if ($1 == end) return -
}
Posted By: Nimue Re: Help with $submenu - 11/02/03 03:19 AM
Code:
menu menubar {
  Script
  .$submenu($channels($1))
}
alias channels {
  if ($1 isin begin end) return -
  if ($read(script.txt,$1)) return $+($gettok($ifmatch,1,32),:echo -a $gettok($ifmatch,2-,32))
}
© mIRC Discussion Forums