mIRC Home    About    Download    Register    News    Help

Print Thread
#171519 25/02/07 09:04 AM
Joined: Feb 2007
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Feb 2007
Posts: 4
Okay this is what I'm trying to do

I want it to check if the nick is registered or in a txt file
but i dont quite get how to do it or if its even possible

What i tried (kinda sad)

Quote:
if ( [LC] isin $nick) && ( $nick isreg ) {

And
Quote:
if ( [LC] isin $nick) && ( $nick isin $read(clanmembers.txt)) {


this is what I have

Quote:
on *:JOIN:#mol: {
if ( [LC] isin $nick) && ( $nick isreg ) {
inc %clanjoins 1
describe $chan Welcome back to the clan room $nick you are member %clanjoins to return
mode $chan +h $nick
}
else {
inc %joins 1
describe $chan Welcome to $chan hope you enjoy your stay here smile btw your number %joins to happen in here.
mode $chan +v $nick
}


If anyone could plz help with this i would be really grateful
it has me stumped frown

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107

As for the [LC] , I'd suggest a case-sensitive match, although what you have should work fine.

Code:
( [LC] isincs $nick )


isreg is short for 'is regular' , not 'is registered'
It refers to ppl with no special modes; they're not opped or voiced or anything.

If that is what you are wanting to check, the syntax is
Code:
( $nick isreg $chan )

To keep track of known nicks, I personally use the User list. I have about 150 entries in mine.
You can assign levels, and add them by nick only, or by any wildcarded mask that suits your purpose.
You can even include other info.

/help Access Levels
/help /auser
/help /guser

Since you already have the users you want to keep track of in a text file, you may prefer to just use that.
Just how you access it really depends on how it is laid out. one nick per line? nick!user@host?

You can't use $read like you tried and get the results you want.
You have to search the whole file, and how you do that will depend on how the file is laid out.

I almost never use $read myself. I would opt for loading the file in a hidden window and referencing that.
Or if your list is very large, hash tables are the way to go.

So anyway, the if line is the only problem I can see with what you have.
Tell us about the text file layout, and we'll go from there.
[Except that "...your number %joins ..." really ought to be "you're number %joins" but that's just me, and doesn't affect the working of the script.]


LonDart
Joined: Feb 2007
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Feb 2007
Posts: 4
Ty with help!

The layout of the text file I want to is.
Nick
Nick2
and so on

P.S. thanks with any and all help

Last edited by Drag00nSlayer; 25/02/07 04:21 PM.
Joined: Feb 2007
Posts: 27
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
Just do a simple /write
ON *:JOIN:*:#mol: {
/write -ds $nick c:\nicks.txt
/write c:\nicks.txt $nick
}

Explanation:
Searchs for nick in text file, if found deletes it, then write the nick again.

/help /write

Joined: Feb 2007
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Feb 2007
Posts: 4
I'm gonna take londarks advice and use user levels

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I'm curious why you'd delete it in the first place? Why not just search for it?

Code:
if ([LC] isincs $nick && $read(nicks.txt,w,$nick)) { do this }


Yes, I'm using w instead of s. This guarantees (without wildcards) that the match is exact and you don't get Nickname when searching for Nick.

Still, the user list would be preferably for this particular script.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2007
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Feb 2007
Posts: 4
I got this so far but minor technical proplem it wont do a second sub menu frown

Quote:

menu Nicklist {
Greet Script
.Add To Greets Auto List:echo -m dont click here frown
..Add user level:auser -a $?="Enter there level here(lvl 5-10 +h. 10-15 +o.) $1
..View User level 1-5:ulist <5
..View User level 1-10:ulist <10
..View User level 1-15:ulist <15
..View all users:ulist <20
.Remove Users:echo -m dont click here frown
..Complete remove:ruser $nick
..Remove users level:ruser $?="Enter level to remove 1-20" $nick
}
}
on 8:JOIN:#lc: {
if ( [LC] isin $nick) {
inc %clanjoins 1
describe $chan Welcome back to the clan room $nick you are member %clanjoins to return
mode $chan +h $nick
}
else {
inc %joins 1
describe $chan Welcome to $chan $nick hope you enjoy you're stay here smile btw your number %joins to happen in here.
mode $chan +v $nick
}

Last edited by Drag00nSlayer; 25/02/07 05:17 PM.
Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
You have mismatched brackets.
The second closing bracket before on 8:JOIN should be moved to the very end of the on JOIN section.

Also, you do realize that you've only scripted for users level 8 and above, with and without the [LC] in their nick?

This responds to everyone who joins #lc who has a User Level of 8 or higher
Code:
on 8:JOIN:#lc: { 
This section deals with those who also have [LC] in their nick
Code:
  if ( [LC] isin $nick) {
  inc %clanjoins 1
  describe $chan Welcome back to the clan room $nick you are member %clanjoins to return
  mode $chan +h $nick
  }
This section reacts to those who don't have [LC] in their nick, but only if they are still level 8 or higher
Code:
  else {
  inc %joins 1
  describe $chan Welcome to $chan $nick hope you enjoy you're stay here  btw your number %joins to happen in here.
  mode $chan +v $nick
  }
}


To respond to ppl who join who have a level lower than 8, or who are not in your User List at all, you need a separate on JOIN event:

Code:
on *:JOIN:#whatever: { 
  do stuff
}

You switched from #mol to #lc, so YOU figure it out wink

You can have as many on Join events as you have levels, plus one (to catch all the non-listed users). The trick is to keep track of which level gets what,
and what level do you want to assign to whom. For example, for reasons I can no longer remember, I assigned users to one of eight levels.
So far I have only coded events for 4 of those levels, and for the * level (everyone else).

Having just re-read for the umpteenth time the paragraph 'Order of Definitions' in the help file, at the bottom of the 'Access Levels' page,
I finally get what he is saying. The suggested order is for the scripter to keep track.
I thought he was referring to the order that the events should appear in a script, and personally found it more logical to place them higher to lower.
It seems that the order of on JOIN events in a script does not matter to mIRC, whereas the order of on TEXT events in a script is crucial.
If anyone knows different, please disabuse me of this notion ASAP.


LonDart
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I'm guess "8" was a typo as it's the same key as "*".

Anyhow, to your question about order...

Order of almost all events matters. Stuff like aliases don't. On JOIN does matter, though. It matters because only the first matching one will trigger in a single script file.

For example, if you put on *:JOIN:*: { } before on *:JOIN:#chan1: { }, then the second one will not trigger because the first one matched.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Thnx Riasmus. I was only thinking of the levels regarding the ordering. Dumb, that.

Also, I've never been on a network that has NickServ, but it FINALLY dawns on me that the [LC] being checked for
is added to the nick by NickServ. So, given the 8 vs *, OP probably does have just what he/she wants.


LonDart
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I doubt it's anything to do with NickServ as that usually doesn't change your nick. Most likely, that's something that people in a particular channel use to identify themselves as being regular members (or in some cases, servers for that channel).


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard