mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
ToRmEnTeD #205778 31/10/08 07:25 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
on *:join:#: {
  if ($nick != $me) && ($chan == #chat18+) {
    if (!$isfile($+(join.txt))) { write join.txt }
    if ($nick isin $read(join.txt, w, $+(*,$nick,*))) { describe $Chan Hey $nick $+ , Welcome Back. :)    }
    else {
      describe $chan Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ?
      ;write join.txt $nick
    }
  }
}
menu nicklist {
  Add user:{ write join.txt $1 }
}

Just copy and paste, don't change anything and see if it working as you want it to smile

right click in the nick list and you should see the menu there, the nick you have highlighted will be the one you add to the list..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #205779 31/10/08 07:45 PM
Joined: Nov 2003
Posts: 102
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
ha, Works perfect! Thanks very much smile


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
ToRmEnTeD #205780 31/10/08 07:48 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
If you want it to auto add in the future, just remove the ; in the end of the code: ;write join.txt $nick

and you can edit the adding thing too.
Code:
menu nicklist {
  Add user:{ write join.txt $1 | echo -a Added $1 to the list. }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #205781 31/10/08 07:53 PM
Joined: Nov 2003
Posts: 102
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
wow man i was just messing with it and you even fixed my first problem...your code works with my PNP so i dont need to run it on my chat script anymore laugh Very nice man . Greatly apprecate your services!


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
ToRmEnTeD #205796 01/11/08 06:49 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
This one uses variables for nick storage and does the same thing instead of the text file:

Code:
on *:JOIN:#: {
  if ($nick != $me) && ($chan == #chat18+) { 
    if ($istok(%Users,$nick,44)) { describe # Hey $nick $+ , welcome back. :) }
    else { describe # Hello $nick $+ , welcome to $chan $+ . May we have your age please? }
  }
}
menu nicklist {
  Add user: {
    if ($1 isin %Users) { echo 4 -a * User $1 has already been added. } 
    else { set %Users $addtok(%Users,$1,44) | echo 2 -a * $1 added to the list. }
  }
  Delete user: { 
    if ($1 !isin %Users) { echo 4 -a * User $1 does not exist. } 
    else { 
      set %Users $remtok(%Users,$1,1,44) | echo 2 -a * User $1 has been removed from the list. 
    }
  }
}


Also a delete feature is added so you can remove nicknames stored that you don't want anymore.

Last edited by Tomao; 01/11/08 07:13 AM.
Tomao #205797 01/11/08 08:05 AM
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
Wouldn't this be a perfect situation for user levels? o.O

Tomao #205798 01/11/08 09:48 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
One problem that I can foresee using variables for this, is if you are running the code on multiple channels and/or multiple networks, especially if there is a large number of users per channel and/or a network that allows very long nicks.

Eg: 5 networks @ 10 channels/network, 100 nicks/channel & 50 characters/nick. Some quick math gives me a total of 255,000 characters, which, if all stored in the one variable, would exceed (or at least push) the current limits for the number of characters allowed in a variable.

RusselB #205809 01/11/08 04:50 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
So what is your recommendation on such matter? Using a hash table perhaps?

Tomao #205815 01/11/08 06:47 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
While hash tables are one way of handling this, Kol's suggestion makes a lot of sense.

Page 2 of 2 1 2

Link Copied to Clipboard