How can i alow only notices from specify users
all nicks are stored in a file caled notice.txt
thanks!
on ^*:Notice:*:*:{ var %t = 1 | while ($read(notice.txt,%t)) { inc %t | if ($read(notice.txt,%t) == $nick) { return } | else { halt } } }
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
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 } }
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 }
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 .............
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!
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) =)
Tidy your code crashs mIRC * Break: evaluation error
on ^*:NOTICE:*:*:{
if (!$read(notice.txt,r,/^ $+ $replacex($nick,\,\\,^,\^,[,\[,],\],$chr(124),\ $+ $chr(124),{,\{,},\}) $+ $/i)) { haltdef }
}