mIRC Homepage
Posted By: judge2020 special user lists - 31/03/14 07:40 PM
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)
Code:
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?
Code:
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?

Code:
on *:TEXT:!reg add*:#: {
??? $$3
}

(please include finalized code if you help. It would be great!)
Posted By: Nillen Re: special user lists - 31/03/14 07:55 PM
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?

Posted By: judge2020 Re: special user lists - 31/03/14 08:12 PM
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.
Posted By: judge2020 Re: special user lists - 31/03/14 08:13 PM
yes i want to ban certain users, not add them to a ban list.
Posted By: Nillen Re: special user lists - 31/03/14 08:22 PM
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
Code:
if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick))
Posted By: SladeKraven Re: special user lists - 31/03/14 08:25 PM
Code:
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.
Posted By: judge2020 Re: special user lists - 31/03/14 08:25 PM
Originally Posted By: Nillen
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
Code:
if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick))

thanks that works smile
Posted By: Nillen Re: special user lists - 31/03/14 08:27 PM
This is surely a matter of preference. I keep my folders very organized.
Posted By: SladeKraven Re: special user lists - 31/03/14 08:35 PM
You're very right. That was my preference.
Posted By: judge2020 Re: special user lists - 31/03/14 08:39 PM
Originally Posted By: judge2020
Originally Posted By: Nillen
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
Code:
if ($read(C:\Users\(me)\Desktop\reglist.txt,nw,$nick))

thanks that works smile


It isn't working. just does nothing.
Code:
on *:TEXT:!to*:#: {
  if ($read(filepath\reglist.txt,nw,$nick))
  msg $chan timing out $$2 for $$3 seconds
  msg $chan .timeout $$2 $$3
}

Posted By: SladeKraven Re: special user lists - 31/03/14 08:44 PM
That's because filepath is there. If you have the file (reglist.txt) in your mIRC directory have that as:

Code:
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:

Code:
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.
Posted By: Nillen Re: special user lists - 31/03/14 08:52 PM
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
Code:
 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
Code:
 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.


Posted By: judge2020 Re: special user lists - 31/03/14 08:54 PM
still not working frown put it in both mIRC directories (roaming and program files)
Code:
on *:TEXT:!timeout*:#: {
  if ($read(reglist.txt,nw,$nick))
  msg $chan timing out $$2 for $$3 seconds
  msg $chan .timeout $$2 $$3
}
Posted By: Nillen Re: special user lists - 31/03/14 08:55 PM
If you're wondering about your own code
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:
Code:
on *:TEXT:!to*:#: {
  if ($read(reglist.txt,nw,$nick)) {
  msg $chan timing out $$2 for $$3 seconds
  msg $chan .timeout $$2 $$3
 }
}
Posted By: judge2020 Re: special user lists - 31/03/14 08:57 PM
Originally Posted By: Nillen
If you're wondering about your own code
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:
Code:
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?
Posted By: judge2020 Re: special user lists - 31/03/14 08:58 PM
also it says it IS a mismatch if i close off the if statement
Posted By: Nillen Re: special user lists - 31/03/14 09:00 PM
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)"
Posted By: judge2020 Re: special user lists - 31/03/14 09:07 PM
Originally Posted By: Nillen
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?
Posted By: SladeKraven Re: special user lists - 31/03/14 09:11 PM
Show the code you're using.
Posted By: judge2020 Re: special user lists - 31/03/14 09:14 PM
Originally Posted By: SladeKraven
Show the code you're using.

full script: http://pastebin.com/iQxvGrQQ
but the code i'm using for this:
Code:
on *:TEXT:!to*:#: {
  if ($read(sreglist.txt,nw,$nick))
  msg $chan timing out $$2 for $$3 seconds
  msg $chan .timeout $$2 $$3
}
Posted By: SladeKraven Re: special user lists - 31/03/14 09:16 PM
Are you aware that the filename you chose isn't like the other filenames in the other script?

Shouldnt:

sreglist.txt

Be:

reglist.txt
Posted By: judge2020 Re: special user lists - 31/03/14 09:18 PM
Originally Posted By: SladeKraven
Are you aware that the filename you chose isn't like the other filenames in the other script?

Shouldnt:

sreglist.txt

Be:

reglist.txt

it is reglist sorry copied wrong code.
anyways that still doesn't work with all filenames being correct and all that
Posted By: SladeKraven Re: special user lists - 31/03/14 09:24 PM
According to your pastebin script link you provided on line 263 its sreglist.txt.

Nevertheless, what happens when you type:

//echo -a $exists(reglist.txt)
Posted By: judge2020 Re: special user lists - 31/03/14 09:26 PM
Originally Posted By: SladeKraven
According to your pastebin script link you provided on line 263 its sreglist.txt.

Nevertheless, what happens when you type:

//echo -a $exists(reglist.txt)

it is
Code:
$true

also i was using reglist at first but while i was waiting for replies i made a special reglist (sreglist) since i don't want normal regs timing people out
Posted By: Nillen Re: special user lists - 31/03/14 09:45 PM

As you can clearly see, the IF statements in the 2 top scripts have not been opened with a bracket. Whereas the bottom 2 have been scripted properly.

Syntax is: IF (CONDITION) { DO STUFF }
What you have is: IF (CONDITION)
And nothing else.
Posted By: judge2020 Re: special user lists - 31/03/14 10:00 PM
Originally Posted By: Nillen

As you can clearly see, the IF statements in the 2 top scripts have not been opened with a bracket. Whereas the bottom 2 have been scripted properly.

Syntax is: IF (CONDITION) { DO STUFF }
What you have is: IF (CONDITION)
And nothing else.

ok i see, that worked smile thanks and now i will never mess up on something like that again!

Code:
on *:TEXT:!timeout*:#: {
  if ($read(reglist.txt,nw,$nick)) {
    msg $chan timing out $$2 for $$3 seconds
    msg $chan .timeout $$2 $$3
  }
}
on *:TEXT:!to*:#: {
  if ($read(sreglist.txt,nw,$nick)) {
    msg $chan timing out $$2 for $$3 seconds
    msg $chan .timeout $$2 $$3
  }
}
© mIRC Discussion Forums