mIRC Homepage
Posted By: FMJ users on file .txt - 16/11/03 02:20 PM
Hi, I'm coding a mirc script...
Anyone knows how to save users of a channel on a file .txt?
Thanks for help.
Posted By: Collective Re: users on file .txt - 16/11/03 02:22 PM
Code:
alias savenicks {
  var %i = 1
  while ( $nick(#,%i) ) {
    write nicks.txt $ifmatch
    inc %i
  }
}
Posted By: FMJ Re: users on file .txt - 16/11/03 02:29 PM
sorry, but I'm at beginning... how to recall this "alias"?
Posted By: Collective Re: users on file .txt - 16/11/03 02:33 PM
Put it in remotes and type /savenicks in a channel, then open nicks.txt from your mIRC directory.
Posted By: Tsunami Re: users on file .txt - 16/11/03 02:35 PM
go to Tools -> Scripts Editor and put it in Remotes, or remove the word "alias" in the first line and put in in Aliases.
Posted By: FMJ Re: users on file .txt - 16/11/03 02:57 PM
Thanks, it works! but is it possible to do this every time I enter the channel, without write the command "/savenicks"?
Posted By: sparta Re: users on file .txt - 16/11/03 03:07 PM
use a trigger when you join a channel: on $me:JOIN:#:{ savenick } in your remote section..
Posted By: FMJ Re: users on file .txt - 16/11/03 03:17 PM
sorry, but I don't understand... how to do this trigger?
Posted By: sparta Re: users on file .txt - 16/11/03 03:26 PM
Add this in your remote section.. ALT + R in your mirc..

on $me:JOIN:#:{ savenick }
Posted By: Collective Re: users on file .txt - 16/11/03 03:34 PM
That doesn't work.

on me:*:JOIN:#:{ savenicks }
Posted By: sparta Re: users on file .txt - 16/11/03 03:42 PM
$me not me ..
Posted By: Collective Re: users on file .txt - 16/11/03 03:45 PM
No. Try it. It doesn't work with a $, it does without.
Posted By: FMJ Re: users on file .txt - 16/11/03 03:48 PM
mmm it doesn't work... but the command "savenicks" must be placed in remote.ini or aliases.ini?
Posted By: FMJ Re: users on file .txt - 16/11/03 03:51 PM
No, it doesn't works with...
on me:*:JOIN:#:{ savenicks }
it save only my name...
Posted By: Collective Re: users on file .txt - 16/11/03 03:53 PM
I know why it doesn't work, it is because on JOIN the names list hasn't been recieved yet..

Code:
on me:*:JOIN:#:{
  set %join $+ # 1
}
raw 366:*:{
  if ( $eval(% $+ join $+ $2,2) ) {
    savenicks
    unset %join $+ $2
  }
}

It all goes in remotes.
Posted By: FMJ Re: users on file .txt - 16/11/03 03:54 PM
and if I would do enter the script in a list of channels saved in a file .txt? Exist a FOR cicle?
How can I do?
Posted By: FMJ Re: users on file .txt - 16/11/03 04:01 PM
it doesn't works...
Code:
on me:*:JOIN:#:{
  set %join $+ # 1
}
raw 366:*:{
  if ( $eval(% $+ join $+ $2,2) ) {
    savenicks    unset %join $+ $2
  }
}
 
Posted By: Collective Re: users on file .txt - 16/11/03 04:06 PM
You missed a carriage return after savenicks.
Posted By: FMJ Re: users on file .txt - 16/11/03 04:14 PM
in the text I put, but doesn't work too
Posted By: FMJ Re: users on file .txt - 16/11/03 04:21 PM
is not possible to make a pause before to execute command?
Posted By: sparta Re: users on file .txt - 16/11/03 04:39 PM
Yes. use a time.. .timer 1 1 command
Posted By: FMJ Re: users on file .txt - 16/11/03 04:49 PM
you means
.timer 1 1 savenicks
?
Posted By: sparta Re: users on file .txt - 16/11/03 04:55 PM
yes.. on the join command..
Posted By: FMJ Re: users on file .txt - 16/11/03 04:56 PM
I tried this but nothing...
on me:*:JOIN:#:{
.timer 1 1 savenicks
}
Posted By: LocutusofBorg Re: users on file .txt - 16/11/03 05:02 PM
Then your mIRC is screwed. that code is solid.
Posted By: FMJ Re: users on file .txt - 16/11/03 05:05 PM
I have Mirc 6.03... I need to insert some routine or something?
Please, help me!
Posted By: Tsunami Re: users on file .txt - 16/11/03 05:11 PM
We helped you all we could. If the code doesn't work, it's something that you did wrong. Please tell us exactly what you did...
Posted By: sparta Re: users on file .txt - 16/11/03 05:12 PM
make shure you dont have any on join events abow the one with the timer.. mirc takes the first one, then it halts.. so it wont get the one below that one..
Posted By: FMJ Re: users on file .txt - 16/11/03 05:17 PM
I put
Code:
 
on me:*:JOIN:#:{
  .timer 1 1 savenicks
}
 

on top of remote (ALT-R), then I put after
Code:
 
alias savenicks {
  var %i = 1
  while ( $nick(#,%i) ) {
    write nicks.txt $ifmatch
    inc %i
  }
}
 


is it right?
Posted By: sparta Re: users on file .txt - 16/11/03 05:19 PM
hmm..

on me:*:JOIN:#:{
.timer 1 1 savenicks
}

i think you should remove the red stuff..
Posted By: FMJ Re: users on file .txt - 16/11/03 05:20 PM
but it doesn't work the "timer"... confused confused confused

I cancel the red but nothing... crazy

timer requires some code?
Posted By: Iori Re: users on file .txt - 16/11/03 05:38 PM
Try typing /!remote on and see if it works.
Posted By: FMJ Re: users on file .txt - 16/11/03 05:48 PM
it say "remote active (events...)" but nothing... shocked
I download Mirc 6.12 from this site, I insert the code in script.ini (remote) but nothing...
It's my pc that is crush? or is the code?
Posted By: Iori Re: users on file .txt - 16/11/03 05:55 PM
You NEED that red code sparta told you to remove..
Posted By: theRat Re: users on file .txt - 16/11/03 05:57 PM
Code:
on me:*:JOIN:#:{
  set %join $+ # 1
}
raw 366:*:{
  if ( $eval(% $+ join $+ $2,2) ) {
    savenicks $2
    unset %join $+ $2
  }
}
alias savenicks {
  var %i = 1
  while ( $nick($1,%i) ) {
    write nicks.txt $ifmatch
    inc %i
  }
}
  


add these to a new script file...
Posted By: FMJ Re: users on file .txt - 16/11/03 07:10 PM
finally, it works!! Unbelievable!! GREAT!! laugh
Posted By: FMJ Re: users on file .txt - 17/11/03 07:49 PM
only a problem, it saves my name too... each time...
is possible not to save?
Posted By: cold Re: users on file .txt - 01/12/03 10:30 AM
I'm late, but yes.
Code:
alias savenicks {
  var %i = 1
  while ( $nick($1,%i) ) {
    if ($ifmatch != $me) { write nicks.txt $ifmatch }
    inc %i
  }
}

or..
Code:
alias savenicks {
  var %i = 1
  while ( $nick($1,%i) ) {
    write nicks.txt $ifmatch
    inc %i
  }
  write -ds $+ $me nicks.txt
}


You can choose any of both, but be sure to read the help file for both regardless of the one you choose.
© mIRC Discussion Forums