mIRC Home    About    Download    Register    News    Help

Print Thread
#149937 25/05/06 10:30 PM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Okay, so I want to make a script for my channel. I want the script to do the following:

Whenever a member types in !eplist I want a list of words from a text file to be shown. However, I only want this available for users that are voiced, hopped, opped, etc., meaning that if a user who uses !eplist is not voiced, hopped, etc. then they get a ban for 15 minutes.

If someone could help me make a script for this, I would be very thankful. Thank you.

#149938 25/05/06 10:38 PM
Joined: Mar 2006
Posts: 13
Z
Pikka bird
Offline
Pikka bird
Z
Joined: Mar 2006
Posts: 13
If you looked in the mIRC help, you could easily compose this script..
But since I'm feeling generous and am waiting for some help for myself, I guess I could attempt to make a script for you. I doubt it'd be the most efficient, though.

Code:
on *:TEXT:!eplist:#:{
  if ($nick isop # || $nick isvoice || $nick ishop) {
    var %line = 1
    while ($read([filenamehere].txt,%line)) {
      msg $nick $read([filenamehere].txt,%line)
      inc %line 1
    }
  }
}


Note: this is just if I'm understanding you correctly, which I'm not sure I am. Remember to change [filenamehere] to the name of the file.

Last edited by ZorgonX; 25/05/06 10:45 PM.
#149939 25/05/06 10:56 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's another suggestion
Code:
 on @*:text:!eplist:#:{
if !$nick($chan,$nick,r) {
.play $nick <filename.txt>
}
else {
.ban -ku900 $chan $nick
}
}
 

#149940 25/05/06 11:02 PM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
I assume that this is the ban code for non voiced, hopped, opped, admin users?

@ ZargonX Thanks for replying. Unfortunately, your code only works for opped users. I used a test account and voiced it, and it didn't work.

Remember that I would like it so that the !eplist works for only voice+ users, not just opped users.

#149941 25/05/06 11:06 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
My script is complete..a check to ensure that the person/bot running the script has ops (which is required for the ban command), a check to ensure that the person sending the request is voiced (or higher), and a 15 minute kick & ban if the person doesn't have the proper access level.

#149942 25/05/06 11:10 PM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
@ZargonX The code works now. I had to change something

@RusselB

Here is the code that I used:

on @*:text:!eplist:#:{if !$nick($chan,$nick,r) {.play $nick <eplist.txt>}else {.ban -ku900 $chan $nick}}

When I devoiced my testing account, the ban was not initiated. Maybe I made a mistake when editing it? I am opped in the channel.

Last edited by Sableye2; 25/05/06 11:15 PM.
#149943 26/05/06 01:35 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ensure that the code isn't all on one line. If the code is all on one line, the way it's coded, it won't work.

#149944 26/05/06 02:19 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
I didn't put the code on one line. I added it in exactly how you posted it. It still does not work. I even tried to take away the brackets <>'s from eplist.txt but the effect didn't change at all. confused

#149945 26/05/06 02:55 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is how the code should look. This has been tested and does work when everything is set correctly.
Code:
 on @*:text:!eplist:#:{
if !$nick($chan,$nick,r) {
.play $nick eplist.txt
}
else {
.ban -ku900 $chan $nick
}
}  

#149946 26/05/06 03:01 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Maybe it's not working because I am using an account with the same IP as the owner.

#149947 26/05/06 03:07 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Code:
on @*:text:!eplist:#:{
  if !$nick($chan,$nick,r) {
    .play $nick eplist.txt
  }
  else {
    .ban -ku900 $chan $nick
  }
} 


it should look just like that in the REMOTE file.

hold the ALT key, type the r key to open the remotes editor
add it to your scripts there or make a new file using File then click New

#149948 26/05/06 03:20 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
The code is copied the exaclty the same in the remotes tab. I have saved it, pressed OK, typed in !eplist with a test account and nothing happens. The message doesn't appear in the PM which is good, but I do not get banned either. I am going to have another person test it out for me. I don't know why this isn't working.

#149949 26/05/06 03:24 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you still can't get this working, send me a pm with the server and channel, and I'll come to you to get this working

#149950 26/05/06 11:48 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
It's working perfectly now. One more thing, can I have it so that a reason is stated when the user is kicked out?

#149951 27/05/06 12:39 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Sure...If you always want the same message, just put it as the LAST thing on the ban command line. If you want to be able to change it, that's a bit more complicated and I'll need to do a bit of research to ensure I get the format correct. (Unless someone else knows how to do it off hand)

#149952 27/05/06 01:06 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
I just wanted the same message. Thank you, it works perfectly.


Link Copied to Clipboard