mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
special user lists #244824 31/03/14 07:40 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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!)


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244825 31/03/14 07:55 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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?



Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: special user lists [Re: Nillen] #244826 31/03/14 08:12 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244827 31/03/14 08:13 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
yes i want to ban certain users, not add them to a ban list.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244828 31/03/14 08:22 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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))


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: special user lists [Re: judge2020] #244829 31/03/14 08:25 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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.

Last edited by SladeKraven; 31/03/14 08:33 PM.
Re: special user lists [Re: Nillen] #244830 31/03/14 08:25 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: SladeKraven] #244831 31/03/14 08:27 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
This is surely a matter of preference. I keep my folders very organized.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: special user lists [Re: Nillen] #244832 31/03/14 08:35 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're very right. That was my preference.

Re: special user lists [Re: judge2020] #244833 31/03/14 08:39 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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
}



#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244834 31/03/14 08:44 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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.

Last edited by SladeKraven; 31/03/14 08:45 PM.
Re: special user lists [Re: judge2020] #244835 31/03/14 08:52 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.




Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: special user lists [Re: SladeKraven] #244836 31/03/14 08:54 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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
}


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244837 31/03/14 08:55 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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
 }
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: special user lists [Re: Nillen] #244838 31/03/14 08:57 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244839 31/03/14 08:58 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
also it says it IS a mismatch if i close off the if statement


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244840 31/03/14 09:00 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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)"


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: special user lists [Re: Nillen] #244841 31/03/14 09:07 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: special user lists [Re: judge2020] #244842 31/03/14 09:11 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Show the code you're using.

Re: special user lists [Re: SladeKraven] #244843 31/03/14 09:14 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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
}


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Page 1 of 2 1 2