mIRC Home    About    Download    Register    News    Help

Print Thread
#189798 12/11/07 12:47 AM
M
Mpot
Mpot
M
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.
#189813 12/11/07 02:02 AM
Joined: Jun 2006
Posts: 506
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 506
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)

M
Mpot
Mpot
M
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?

#189817 12/11/07 02:27 AM
Joined: Dec 2002
Posts: 503
B
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].

#189818 12/11/07 02:29 AM
Joined: Jun 2006
Posts: 506
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 506
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

M
Mpot
Mpot
M
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.
#189822 12/11/07 02:37 AM
Joined: Jun 2006
Posts: 506
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 506
if ($true) { execute true command }
else { execute false command }

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

#189824 12/11/07 02:40 AM
Joined: Jun 2006
Posts: 506
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 506
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...

M
Mpot
Mpot
M
Post deleted by Mpot

Last edited by Mpot; 12/11/07 02:46 AM.
#189828 12/11/07 03:00 AM
M
Mpot
Mpot
M
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.
#189834 12/11/07 04:17 AM
Joined: Jun 2006
Posts: 506
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 506
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
}

M
Mpot
Mpot
M
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.
#190067 15/11/07 05:16 PM
M
Mpot
Mpot
M
Anyone know how to get $address to work for me?

#190069 15/11/07 06:10 PM
M
Mpot
Mpot
M
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 $+  }
}

#190071 15/11/07 06:30 PM
Joined: Dec 2002
Posts: 1,995
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,995

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 $+ 
  }
}


M
Mpot
Mpot
M
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?

#190073 15/11/07 07:08 PM
Joined: Dec 2002
Posts: 1,995
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,995

$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.

M
Mpot
Mpot
M
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.
#190095 15/11/07 09:03 PM
Joined: Dec 2002
Posts: 1,995
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,995

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




Link Copied to Clipboard