mIRC Home    About    Download    Register    News    Help

Print Thread
Help with $submenu #10412 10/02/03 03:50 AM
Joined: Dec 2002
Posts: 54
L
laz Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
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.

Re: Help with $submenu #10413 10/02/03 12:11 PM
Joined: Dec 2002
Posts: 143
A
Aubs Offline
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
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 -
}


Aubs.
cool

Re: Help with $submenu #10414 11/02/03 03:19 AM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
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))
}