mIRC Home    About    Download    Register    News    Help

Topic Options
#88147 - 25/06/04 05:28 PM reading nicknames from txt file
Apollo26 Offline
Self-satisified door

Registered: 19/06/04
Posts: 3
How can i alow only notices from specify users

all nicks are stored in a file caled notice.txt

thanks!

Top
#88148 - 25/06/04 05:32 PM Re: reading nicknames from txt file
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Code:
on ^*:notice:*:*:{
  if (!$read(notice.txt,r,/^ $+ $nick $+ $/i)) { haltdef }
}
_________________________
New username: hixxy

Top
#88149 - 25/06/04 05:37 PM Re: reading nicknames from txt file
tsoglanos Offline
Vogon poet

Registered: 30/03/04
Posts: 130
Loc: Greece
on ^*:Notice:*:*:{ var %t = 1 | while ($read(notice.txt,%t)) { inc %t | if ($read(notice.txt,%t) == $nick) { return } | else { halt } } }


Edited by tsoglanos (25/06/04 05:45 PM)
_________________________
http://Ircp.tripod.com

Top
#88150 - 25/06/04 05:42 PM Re: reading nicknames from txt file
Apollo26 Offline
Self-satisified door

Registered: 19/06/04
Posts: 3
Thank you tsoglanos !

Top
#88151 - 25/06/04 05:54 PM Re: reading nicknames from txt file
tsoglanos Offline
Vogon poet

Registered: 30/03/04
Posts: 130
Loc: Greece
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
_________________________
http://Ircp.tripod.com

Top
#88152 - 25/06/04 05:54 PM Re: reading nicknames from txt file
Sat Offline
Hoopy frood

Registered: 19/04/04
Posts: 832
Loc: The Netherlands
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,
Code:
on ^*:notice:*:*:{ if (!$read(notice.txt,w,$nick)) { haltdef } }


Edited by Sat (25/06/04 06:02 PM)
_________________________
Saturn, QuakeNet staff

Top
#88153 - 25/06/04 05:59 PM Re: reading nicknames from txt file
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Yep, you're right.

Code:
if (!$read(notice.txt,r,/^ $+ $replacex($nick,\,\\,^,\^,[,\[,],\],$chr(124),\ $+ $chr(124),{,\{,},\}) $+ $/i)) { haltdef }
_________________________
New username: hixxy

Top
#88154 - 25/06/04 06:03 PM Re: reading nicknames from txt file
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
I'd use something like this, to prevent frequent file reads in the event of flood:
Code:
on ^*:notice:*:*: if !$read(notice.txt,w,$nick) { .ignore -nu20 $nick | halt }
_________________________
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Top
#88155 - 25/06/04 06:13 PM Re: reading nicknames from txt file
tsoglanos Offline
Vogon poet

Registered: 30/03/04
Posts: 130
Loc: Greece
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 .............
_________________________
http://Ircp.tripod.com

Top
#88156 - 25/06/04 06:54 PM Re: reading nicknames from txt file
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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!
_________________________
Gone.

Top
#88157 - 25/06/04 09:23 PM Re: reading nicknames from txt file
tsoglanos Offline
Vogon poet

Registered: 30/03/04
Posts: 130
Loc: Greece
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) =)
_________________________
http://Ircp.tripod.com

Top
#88158 - 25/06/04 09:26 PM Re: reading nicknames from txt file
tsoglanos Offline
Vogon poet

Registered: 30/03/04
Posts: 130
Loc: Greece
Tidy your code crashs mIRC * Break: evaluation error

on ^*:NOTICE:*:*:{
if (!$read(notice.txt,r,/^ $+ $replacex($nick,\,\\,^,\^,[,\[,],\],$chr(124),\ $+ $chr(124),{,\{,},\}) $+ $/i)) { haltdef }
}

_________________________
http://Ircp.tripod.com

Top