| View previous topic :: View next topic |
| Author |
Message |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Sat Nov 07, 2009 3:47 pm Post subject: mIRC script help |
|
|
I don't know how to script in mIRC at all, but can anyone tell me how to add a check if a user is +R before they can use the command .qadd and .qdel? Here's part of the script:
| Code: | if ($1 == .qadd) {
if ($nick isin %qo) {
write quotes.txt $2-
msg $chan 2Your quote was succesfully added as quote $chr(35) $+ $lines(Quotes.txt) $+ .
t Quote $chr(35) $+ $lines(Quotes.txt) - $2-
}
else msg $chan 2Only %qo can add a quote.
}
if ($1 = .qdel) {
if ($nick isin %qo) {
write -dl $2 quotes.txt
msg $chan 2Quote $chr(35) $+ $2 has been deleted.
}
else msg $chan 2Only %qo can delete a quote.
} |
Now that I think about it, can someone move it to General Programming? Thanks.
_________________
|
|
| Back to top |
|
 |
SFP+ Comp. talk moderator
Reputation: 26
Joined: 02 May 2007 Posts: 1228 Location: Sweden
|
Posted: Sat Nov 07, 2009 4:08 pm Post subject: |
|
|
Now to check +r you could do one of these two things:
1. Whois nick
2. /msg nickserv status nick
You would also need to use raw 307 for nr 1.
In the first way, something along these lines would suffice.
| Code: |
if ($1 == .qadd) {
if ($nick isin %qo) { whois $nick | set %qadder on }
else { msg $chan 20nly %qo can add a quote }
}
elseif ($1 == .qdel) {
if ($nick isin %qo) { whois $nick }
else { msg $chan 20nly %qo can delete a quote }
}
raw 307:*: {
if (%qadder) {
write quotes.txt $2-
msg $chan 2Your quote was succesfully added as quote $chr(35) $+ $lines(Quotes.txt) $+ .t Quote $chr(35) $+ $lines(Quotes.txt) - $2-
}
elseif (%qdeler) {
write -dl $2 quotes.txt
msg $chan 2Quote $chr(35) $+ $2 has been deleted.
}
}
|
| Code: |
if ($1 == .qadd) {
if ($nick isin %qo) { ns status $nick | set %qadder on }
else { msg $chan 20nly %qo can add a quote }
}
elseif ($1 == .qdel) {
if ($nick isin %qo) { ns status $nick | set %qdeler on }
else { msg $chan 20nly %qo can delete a quote }
}
on *:NOTICE:STATUS*:?: {
if (($nick == nickserv) && ($3 == 3)) {
if (%qadder) {
write quotes.txt $2-
msg $chan 2Your quote was succesfully added as quote $chr(35) $+ $lines(Quotes.txt) $+ .t Quote $chr(35) $+ $lines(Quotes.txt) -
}
elseif (%qdeler) {
write -dl $2 quotes.txt
msg $chan 2Quote $chr(35) $+ $2 has been deleted.
}
}
}
|
|
|
| Back to top |
|
 |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Sat Nov 07, 2009 4:24 pm Post subject: |
|
|
I'm really lost. This is the entire script. There are multiple commands, how can I integrate what you put up there into just two of those commands?
| Code: | if ($1 = .qdel) {
if ($nick isin %qo) {
write -dl $2 quotes.txt
msg $chan 2Quote $chr(35) $+ $2 has been deleted.
}
else msg $chan 2Only %qo can delete a quote.
} |
Also, what is raw 307?
_________________
|
|
| Back to top |
|
 |
SFP+ Comp. talk moderator
Reputation: 26
Joined: 02 May 2007 Posts: 1228 Location: Sweden
|
Posted: Sat Nov 07, 2009 4:30 pm Post subject: |
|
|
| xV wrote: | I'm really lost. This is the entire script. There are multiple commands, how can I integrate what you put up there into just two of those commands?
| Code: | if ($1 = .qdel) {
if ($nick isin %qo) {
write -dl $2 quotes.txt
msg $chan 2Quote $chr(35) $+ $2 has been deleted.
}
else msg $chan 2Only %qo can delete a quote.
} |
Also, what is raw 307? |
which one would you like to integrate, ns status or whois
http://pastebin.com/m44b0868a
that's ns status
|
|
| Back to top |
|
 |
|