mIRC Home    About    Download    Register    News    Help

Print Thread
#121337 26/05/05 10:30 AM
Joined: May 2005
Posts: 106
S
Vogon poet
OP Offline
Vogon poet
S
Joined: May 2005
Posts: 106
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


and thats the way the scout leader burns
Joined: Dec 2004
Posts: 11
D
Pikka bird
Offline
Pikka bird
D
Joined: Dec 2004
Posts: 11
Post deleted by DanielC

#121339 26/05/05 11:12 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

#121340 26/05/05 11:14 AM
Joined: May 2005
Posts: 106
S
Vogon poet
OP Offline
Vogon poet
S
Joined: May 2005
Posts: 106
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


and thats the way the scout leader burns
#121341 26/05/05 11:23 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

#121342 26/05/05 11:24 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
alias friendsnick { run notepad freinds_nicks.txt }

#121343 26/05/05 11:26 AM
Joined: May 2005
Posts: 106
S
Vogon poet
OP Offline
Vogon poet
S
Joined: May 2005
Posts: 106
thanks worked like a charm


and thats the way the scout leader burns

Link Copied to Clipboard