|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
I'm pretty sure i know how to make a on:text command read a file of names, but i want to clarify and get help on adding names to that list. If i want to ban someone here is my code (just includes my name) on *:TEXT:!ban*:#: {
if ($nick == TheYoungerGamer ) {
msg $chan banning $$2. He's been naughty
msg $chan .ban $$2
}
}
But if i want that to read a list it should be this? on *:TEXT:!ban*:#: {
if ($nick == C:\Users\(me)\Desktop\reglist.txt ) {
msg $chan banning $$2. He's been naughty
msg $chan .ban $$2
}
}
that probably won't work because i don't have a read command. (please include finalized code if you help. It would be great!) Also what would be the command to add names to the text document? on *:TEXT:!reg add*:#: {
??? $$3
}
(please include finalized code if you help. It would be great!)
|
|
|
|
Joined: Dec 2013
Posts: 771
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 771 |
Let me clarify that I understood what you want first.
You want to ban a certain user, AND put his name in a list of banned people. But you only want the command to trigger IF the $nick writing the command is in a text file "reglist.txt" on your desktop?
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
actually i got the adding regulars thing down, but need help for certain commands to read that list and see if the nick on it.
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
yes i want to ban certain users, not add them to a ban list.
|
|
|
|
Joined: Dec 2013
Posts: 771
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 771 |
If you want to read file for a certain user name, I suggest you either read /help $read in the mIRC application or you read other forum thread. Like this very recent one. What you're looking for is if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick))
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
On *:TEXT:!ban*:#: {
if ($read(reglist.txt,nw,$nick)) {
msg # banning $+($$2,.) He's been naughty
msg # .ban $$2
}
else { msg # Sorry $nick you don't have the correct privileges. }
}
On *:Text:!reg add*:#: {
if ($read(reglist.txt,nw,$nick)) { write reglist.txt $$3 }
else { msg # Sorry $nick you don't have the correct privileges. }
}
Instead of putting your filename path, just put reglist.txt in your mircdir. Unless its mandatory that you need to use that long fname.
Last edited by SladeKraven; 31/03/14 08:33 PM.
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
If you want to read file for a certain user name, I suggest you either read /help $read in the mIRC application or you read other forum thread. Like this very recent one. What you're looking for is if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick)) thanks that works 
|
|
|
|
Joined: Dec 2013
Posts: 771
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 771 |
This is surely a matter of preference. I keep my folders very organized.
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
You're very right. That was my preference.
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
If you want to read file for a certain user name, I suggest you either read /help $read in the mIRC application or you read other forum thread. Like this very recent one. What you're looking for is if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick)) thanks that works It isn't working. just does nothing. on *:TEXT:!to*:#: {
if ($read(filepath\reglist.txt,nw,$nick))
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
That's because filepath is there. If you have the file (reglist.txt) in your mIRC directory have that as:
on *:TEXT:!to*:#: {
if ($read(reglist.txt,nw,$nick))
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
Otherwise, change the if statement to:
if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick))
As Nillen said it's down to preference, I never type in the long file name. It just looks hideous.
Last edited by SladeKraven; 31/03/14 08:45 PM.
|
|
|
|
Joined: Dec 2013
Posts: 771
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 771 |
To clarify what Slade is saying: You have 2 choices as to where you want to have your text files. If you want the simple way and have them all gathered in the default mirc directory, you only need to type if ($read(reglist.txt,nw,$nick)) You can find this mircdir here: C:\Users\Username\AppData\Roaming\mIRC From what you described in your original post, your text file is posted on your desktop, making the filepath if ($read(C:\Users\Username\Desktop\reglist.txt,nw,$nick)) You can have the file wherever you want it. As long as you mention in the script exactly where the text file is placed.
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
still not working  put it in both mIRC directories (roaming and program files) on *:TEXT:!timeout*:#: {
if ($read(reglist.txt,nw,$nick))
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
|
|
|
|
Joined: Dec 2013
Posts: 771
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 771 |
If you're wondering about your own code on *:TEXT:!to*:#: {
if ($read(reglist.txt,nw,$nick))
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
You don't have an opening bracket from the if. You need it to be like this:
on *:TEXT:!to*:#: {
if ($read(reglist.txt,nw,$nick)) {
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
}
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
If you're wondering about your own code on *:TEXT:!to*:#: {
if ($read(reglist.txt,nw,$nick))
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
You don't have an opening bracket from the if. You need it to be like this:
on *:TEXT:!to*:#: {
if ($read(reglist.txt,nw,$nick)) {
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
}
ok, i get that. But why didn't mIRC say that was a bracket mismatch?
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
also it says it IS a mismatch if i close off the if statement
|
|
|
|
Joined: Dec 2013
Posts: 771
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 771 |
You didn't have a bracket mismatch. You only opened one bracket, and you only closed one bracket. Had you opened without closing one, it had registered a bracket mismatch.
However, in mIRC you should have a status window. When you wrote "!to...." it should display in there something like this: "* /msg: insufficient parameters (line 1680, remote.ini)"
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
You didn't have a bracket mismatch. You only opened one bracket, and you only closed one bracket. Had you opened without closing one, it had registered a bracket mismatch.
However, in mIRC you should have a status window. When you wrote "!to...." it should display in there something like this: "* /msg: insufficient parameters (line 1680, remote.ini)" yes it does show insufficient parameters. How would i fix that?
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
Show the code you're using.
|
|
|
|
Joined: Mar 2014
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 214 |
Show the code you're using. full script: http://pastebin.com/iQxvGrQQbut the code i'm using for this: on *:TEXT:!to*:#: {
if ($read(sreglist.txt,nw,$nick))
msg $chan timing out $$2 for $$3 seconds
msg $chan .timeout $$2 $$3
}
|
|
|
|
|