mIRC Home    About    Download    Register    News    Help

Print Thread
Nicklist Popup Menu #189798 12/11/07 12:47 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
So, I have a menu nicklist{ } in a script. However, is there a way to make that extra option on the nicklist appear for only one window?

Also, I'm having trouble with /write. I want to write a file to the mirc directoy, IE: C:\Program Files\mIRC\, but the /write command doesn't work when there's a space in the specified location. How can I get around this?

Last edited by Mpot; 12/11/07 02:02 AM.
Re: Nicklist Popup Menu [Re: Mpot] #189813 12/11/07 02:02 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: Mpot
So, I have a menu nicklist{ } in a script. However, is there a way to make that extra option on the nicklist appear for only one window?
Code:
menu nicklist {
  $iif(# == #channelname,Option):command
}



Originally Posted By: Mpot
Also, let's say I want to write to a file in the mIRC directory, will this work:

/write $mircdir $+ /filename.mrc texttowrite

Also, /write doesn't work with spaces in it, and since mIRC is installed in Program Files, that would put a space in the file path. IE: C:\Program Files\mIRC\ . Would using $mircdir get past the space snag?

write filename.mrc or write $qt($mircdir $+ filename.mrc)

Re: Nicklist Popup Menu [Re: deegee] #189816 12/11/07 02:18 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Alright. I'm lost. Could you edit this to work on one channel only:

Code:
menu nicklist { 
  A-Voice Shitlist Nick:/write shitlist.mrc $$1 yes
}


Also, can you explain $iif? Is it like if in an if-then-else statement?

Re: Nicklist Popup Menu [Re: Mpot] #189817 12/11/07 02:27 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Code:
menu nicklist {
  $iif(# == #specificchannel, A-Voice Shitlist Nick): write shitlist.mrc $$1 yes
}


Yes, $iif() is an Inline-If-Else.

$iif([color:orange]condition, true, false)[/color].

Re: Nicklist Popup Menu [Re: Mpot] #189818 12/11/07 02:29 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: Mpot
Alright. I'm lost. Could you edit this to work on one channel only:

Code:
menu nicklist { 
  A-Voice Shitlist Nick:/write shitlist.mrc $$1 yes
}
Code:
menu nicklist {
  $iif(# == #channelname,A-Voice Shitlist Nick):write shitlist.mrc $$1 yes
}
Change "#channelname"


Originally Posted By: Mpot
Also, can you explain $iif? Is it like if in an if-then-else statement?
Click

Re: Nicklist Popup Menu [Re: deegee] #189820 12/11/07 02:34 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I don't understand the comma separation in the $iff and what you cna put there.

Code:
menu nicklist {
  $iif(# == #channel,A-Voice Shitlist Nick):/write shitlist.mrc $$1 yes
}

on *:JOIN:#channel:{
  if ($me !isop $chan) { echo -a You're not opped on #channel, might wanna get that fixed. | return }
  elseif ($read(shitlist.mrc, s, $nick) == yes) { return }
  else { mode $chan +v $nick }
}


How is that? It supposed to be, if the nick is in the shitlist.mrc with yes after it, then the script halts.

Last edited by Mpot; 12/11/07 02:35 AM.
Re: Nicklist Popup Menu [Re: Mpot] #189822 12/11/07 02:37 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
if ($true) { execute true command }
else { execute false command }

$iif($true,execute true command,execute false command)

Re: Nicklist Popup Menu [Re: Mpot] #189824 12/11/07 02:40 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: Mpot
How is that? It supposed to be, if the nick is in the shitlist.mrc with yes after it, then the script halts.

Well, does it? If it does what you want then it's OK...

Re: Nicklist Popup Menu *DELETED* [Re: deegee] #189825 12/11/07 02:44 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Post deleted by Mpot

Last edited by Mpot; 12/11/07 02:46 AM.
Re: Nicklist Popup Menu [Re: Mpot] #189828 12/11/07 03:00 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I have decided to include a "unshitlist option". This will require changing the menu format to

A-Voice Control
.Shitlist
.Un-Shitlist

I also want the script to check if the nickname is already shitlisted. If the nickname is not already shitlisted, it will echo that it's not shitlisted. If it IS shitlisted, it would unshitlist and echo. This is what I have come up with, but something is messed up with the menu. How can I fix it?

Code:
menu nicklist {
  $iif(# == #mpot,A-Voice Control)
  $iif(# == #mpot,.Shitlist Nick):/write shitlist.mrc $$1 yes
  $iif(# == #mpot,.Unshitlist Nick):{ 
    elseif ($read(shitlist.mrc, s, $$1) == yes) { /write -ds $+ $$1 shitlist.mrc | /echo -a Unshitlisted Nickname. }
    elseif ($read(shitlist.mrc, s, $$1) != yes) { /echo -a Nickname is not shitlisted. }
  }
}

Last edited by Mpot; 12/11/07 03:28 AM.
Re: Nicklist Popup Menu [Re: Mpot] #189834 12/11/07 04:17 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Code:
menu nicklist {
  $iif(# == #mpot,A-Voice Control)
  .Shitlist Nick:write shitlist.mrc $$1 yes
  .Unshitlist Nick:{
    if ($read(shitlist.mrc, s, $$1) == yes) { write -dl $+ $readn shitlist.mrc | echo -a Unshitlisted Nickname. }
    else echo -a Nickname is not shitlisted.
  }
} 

Or you could use menu styles
Code:
menu nicklist {
  $iif(# == #mpot,A-Voice Control)
  .$iif($read(shitlist.mrc, s, $$1) == yes,$style(2)) Shitlist $$1:write shitlist.mrc $$1 yes
  .$iif($read(shitlist.mrc, s, $$1) == yes,$style(1),$style(2)) Unshitlist $$1:write -ds $+ $1 shitlist.mrc
}

Re: Nicklist Popup Menu [Re: deegee] #189898 12/11/07 10:26 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I have decided to add shitlisting addresses to the menu as well. I created another menu to get the separation effect of a -. THat worked fine, and the menu is appearing properly. HOwever, something is wrong with the $address. It is not picking it up and just writing "yes" to the file, instead of the address and then yes. Here is what I have, how can I fix $address?

Code:
menu nicklist {
  $iif(# == #mpot,A-Voice Control)
  .Shitlist Nick:{
    if ($read(shitlist.mrc, s, $$1) != yes) { write shitlist.mrc $$1 yes | echo -a Shitlisted Nickname. }
    else echo -a Nickname is already shitlisted. 
  }
  .Un-Shitlist Nick:{
    if ($read(shitlist.mrc, s, $$1) == yes) { write -dl $+ $readn shitlist.mrc | echo -a Unshitlisted Nickname. }
    else echo -a Nickname is not shitlisted.
  } 
}
menu nicklist {
  $iif(# == #mpot,A-Voice Control)
  .Shitlist Address:{
    if ($read(shitlist.mrc, s, $address($$1,2)) != yes) { write shitlist.mrc $address($$1,2) yes | echo -a Shitlisted address. }
    else echo -a Address is already shitlisted.
  }
  .Un-Shitlist Address:{
    if ($read(shitlist.mrc, s, $address($$1,2)) == yes) { write -dl $+ $readn shitlist.mrc | echo -a Unshitlisted address. }
    else echo -a Address is not shitlisted.
  }
}

Last edited by Mpot; 12/11/07 11:40 PM.
Re: Nicklist Popup Menu [Re: Mpot] #190067 15/11/07 05:16 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Anyone know how to get $address to work for me?

Re: Nicklist Popup Menu [Re: Mpot] #190069 15/11/07 06:10 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Furthermore, why does this work with all if's and not with elseifs?

Code:
on mpot:text:!aop:#:{
  if ($2 == $null) { msg $chan Specify a nickname. }
  elseif ($2 != $null && $3 == $null) { msg $chan Specify information parameter. }
  elseif ($$2 !ison $chan) { msg $chan $$2 is not on $chan $+ ! }
  elseif (syscon isin $level($address($$2,2))) { msg $chan $address($$2,2) is already at access level syscon! }
  else { /guser syscon $$2 2 $$3 | msg $chan Addedd  $+ $nick $+  to access list at level syscon at address $+ $address($$2,2) $+  with notes  $+ $$3 $+  }
}

Re: Nicklist Popup Menu [Re: Mpot] #190071 15/11/07 06:30 PM
Joined: Dec 2002
Posts: 2,016
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,016

Try this.

Code:

on mpot:text:!aop *:#: {
  if ($2 == $null) msg $chan Specify a nickname.
  elseif ($3 == $null) msg $chan Specify information parameter.
  elseif ($2 !ison $chan) msg $chan $2 is not on $chan $+ !
  elseif (syscon isin $level($address($2,2))) msg $chan $address($2,2) is already at access level syscon!
  else {
    guser syscon $2 2 $3
    msg $chan Addedd  $+ $nick $+  to access list at level syscon at address $+ $address($2,2) $+  with notes  $+ $3 $+ 
  }
}


Re: Nicklist Popup Menu [Re: RoCk] #190072 15/11/07 06:50 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Oh, hell! No wonder the rest of it wasn't working, I didn't put a wildcard in the on text event. -_-

Also, see the post above last, about $address. Any ideas?

Re: Nicklist Popup Menu [Re: Mpot] #190073 15/11/07 07:08 PM
Joined: Dec 2002
Posts: 2,016
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,016

$address is only availabe if the users address is in the IAL.
Make sure the IAL is on by typing /ial on
You can fill the IAL with the addresses of all the users on a channel by doing a /who on the channel when you join...

Code:

on me:*:JOIN:#:who #



All users that join after you will automatically be added as long as the IAL is on.

Re: Nicklist Popup Menu [Re: RoCk] #190093 15/11/07 08:51 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
That script works by right-clicking on the nicklist, meaning that the nickname is sharing a channel with you, meaning they should already be in the IAL.

Edit: Got it working, somehow...

Last edited by Mpot; 15/11/07 09:11 PM.
Re: Nicklist Popup Menu [Re: Mpot] #190095 15/11/07 09:03 PM
Joined: Dec 2002
Posts: 2,016
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,016

Not necessarily, if they joined the channel before you, and if they haven't typed any channel messages, private messaged you or set any channel modes, then their address won't be in the IAL unless you /who them or the channel, or whois them.

~ Edit ~

From mirc.chm

"A user's address is added to the list either when they join the channel, send a message to a channel, or make a mode change."

If they haven't done any of the above, and you didn't use a server command to get their address, ie. /who /whois /userhost .. then their address may not be in the IAL.

/help /ial