mIRC Homepage
Posted By: Sleepyfreak Nick friends - 26/05/05 10:30 AM
i have the following script but it doesn't work can someone please help me with it

Code:
 
on *:TEXT:*!friendsnick*:*:echo -a too add your nickname too my friends list just say this !addnick <yournickname> <realname>

on *:TEXT:!addnick *:#:{
  if ($2) && ($read(friends_nicks.txt,s,$2)) { 
    /notice $nick This name is already on my nickname list.
    halt
  } 
  if ($2 != $read(friends_nicks.txt,s,$2)) && ($2) { 
    write bday.txt $2,$3-
    /msg $chan Your nickname has been recorded under the name $2 $+ . 
    halt  
  } 
}  

on *:JOIN:#:{
  if ($joinnick == Hazza){
  echo -a you have been selected to add your nickname to my friends list
  echo -a add your nick by typing !friendsnick hopefully it all works :P
}
 


well if you can't help thanks for the time of reading a little 14 year old kids script
Posted By: DanielC Re: Nick friends *DELETED* *DELETED* - 26/05/05 10:59 AM
Post deleted by DanielC
Posted By: DaveC Re: Nick friends - 26/05/05 11:12 AM
On first pass i changed it to this...
Code:
 
on *:TEXT:!friendsnick:*:msg $chan $nick Too add your nick and realname too my friends list just say this !addnick <realname>
;
on *:TEXT:!addnick & *:#:{
  if ($read(friends_nicks.txt,ntw,$2 *)) { 
    notice $nick You have already entered your realname on my nickname list as $gettok($v1,2-,32) $+ .
  } 
  else { 
    write friends_nicks.txt $2 $3-
    msg $chan $nick Your realname has been recorded under the $nick $+ . 
  } 
}  
;
on *:JOIN:#:{
  if ($nick == Hazza) {
    msg $nick you have been selected to add your nickname to my friends list
    msg $nick add your nick by typing !friendsnick hopefully it all works :P
  }
}

* code is untested

But without knowing what exactly its ment to do, i dont even know if its going to do what you expected.
Posted By: Sleepyfreak Re: Nick friends - 26/05/05 11:14 AM
thanks that works but now its going a bit more complex can you make it where i type /friendsnick and it opens all the peoples nicknames and there real name in like a hash table or something
Posted By: DaveC Re: Nick friends - 26/05/05 11:23 AM
Quote:
i'm not sure if this is a problem but ($2) isn't checking against anything.


$2 doesnt need to be checked against anything he can just check if it exists with ($2), however it HAD to exist as he was using :!addnick *: as his matchtext so it must have existed for the event to trip.

Quote:
Code:
on *:TEXT:*!friendsnick*:*:echo -a too add your nickname too my friends list just say this !addnick <yournickname> <realname>
  ...
  if ($2 != $null) && ($read(friends_nicks.txt,s,$2)) { 
  elseif ($2 != $null) $read(friends_nicks.txt,s,$2)) && ($2) { 
  ...


Still echoing on first event.
these are the big problem "$read(friends_nicks.txt,s,$2)" the help file isnt really clear but lets assume you have a file as follows
--- file.txt ----
first line is this
middle line is here
last line of the file
--- file.txt ----

//echo -a ' $+ $read(file.txt,nts,middle) $+ '
'line is here'

//echo -a ' $+ $read(file.txt,ntw,middle *) $+ '
'middle line is here'

When using the ,s, option it locates a matching line and displays the REMAINING text of that line, sometimes this is nothing and gives a false $null for not found, not good frown
Posted By: DaveC Re: Nick friends - 26/05/05 11:24 AM
alias friendsnick { run notepad freinds_nicks.txt }
Posted By: Sleepyfreak Re: Nick friends - 26/05/05 11:26 AM
thanks worked like a charm
© mIRC Discussion Forums