|
Apollo26
|
Apollo26
|
How can i alow only notices from specify users
all nicks are stored in a file caled notice.txt
thanks!
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
on ^*:notice:*:*:{
if (!$read(notice.txt,r,/^ $+ $nick $+ $/i)) { haltdef }
}
|
|
|
|
Joined: Mar 2004
Posts: 130
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 130 |
on ^*:Notice:*:*:{ var %t = 1 | while ($read(notice.txt,%t)) { inc %t | if ($read(notice.txt,%t) == $nick) { return } | else { halt } } }
Last edited by tsoglanos; 25/06/04 04:45 PM.
|
|
|
|
Joined: Mar 2004
Posts: 130
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 130 |
stop showing this code here to other users:
if (!$read(test.txt,r,/^ $+ $nick $+ $/i))
becuse it is not equal to the nicknames may stored in notice.txt
|
|
|
|
Joined: Apr 2004
Posts: 700
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 700 |
tidy_trax: nicknames can contain characters that regex interprets as control characters, so you'd have to escape those first... tsoglanos: that doesn't actually work, your script will always either return or halt after having tested the second line of notice.txt. My solution would be, on ^*:notice:*:*:{ if (!$read(notice.txt,w,$nick)) { haltdef } }
Last edited by Sat; 25/06/04 05:02 PM.
Saturn, QuakeNet staff
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
Yep, you're right.
if (!$read(notice.txt,r,/^ $+ $replacex($nick,\,\\,^,\^,[,\[,],\],$chr(124),\ $+ $chr(124),{,\{,},\}) $+ $/i)) { haltdef }
|
|
|
|
Joined: Jan 2003
Posts: 2,125
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,125 |
I'd use something like this, to prevent frequent file reads in the event of flood: on ^*:notice:*:*: if !$read(notice.txt,w,$nick) { .ignore -nu20 $nick | halt }
|
|
|
|
Joined: Mar 2004
Posts: 130
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 130 |
Ah so now he have right ?
I am tring to tell you this 4 hours ago with result you caled you friend cris /Mentality and he blocks my form post .............
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
Hey tsoglanos,
I was reading The_Game's thread a few minutes ago, and I noticed that you pasted my $isinfile alias, when replying to Mentality. The last line of what you pasted was this:
.echo -q $read($1,s,$2) return $readn
Do you realise that you did not copy my code properly from the Msg Board to the mIRC Scripts Editor?
What I posted was this:
.echo -q $read($1,s,$2) return $readn
Notice how they are on different lines?
Now despite of what you may be thinking, I'm not going to attack you or criticise you. I'll just let you in on a useful trick, known by many on this board:
When code is posted between the "code" tags, you can copy the code to Wordpad first, and then copy from WordPad to mIRC. (Start --> wordpad.exe --> paste code --> copy code to mIRC Scripts Editor).
That way the newlines will be respected, and scripts will function the way they were made to be.
When I came to this forum, I did not know about this trick. Since I've known, it has proved to be very valuable. I hope that, despite our incident, you can value this tip as well, since it may prevent a lot of confusion in the future.
Best to you,
FiberOPtics
PS: My apologies for interfering with this thread. Though I'm fairly positive that tsoglanos will ignore my PM that I sent him. And perhaps now, more people will know about the WordPad trick. I'm out, bye!
|
|
|
|
Joined: Mar 2004
Posts: 130
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 130 |
Actuali you right your solution would be the best
I post the $read(test.txt,w,$nick) some hours ago in an other post in the on open but i was tring to var %m = $read(test.txt,$nick) this would be not inposibel in nick stores since the are only one word per line also it is wery smart to use if !$read(bla.txt,w,$nick) =)
|
|
|
|
Joined: Mar 2004
Posts: 130
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 130 |
Tidy your code crashs mIRC * Break: evaluation error
on ^*:NOTICE:*:*:{ if (!$read(notice.txt,r,/^ $+ $replacex($nick,\,\\,^,\^,[,\[,],\],$chr(124),\ $+ $chr(124),{,\{,},\}) $+ $/i)) { haltdef } }
|
|
|
|
|