mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#205778 31/10/08 07:25 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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..

sparta #205779 31/10/08 07:45 PM
T
ToRmEnTeD
ToRmEnTeD
T
ha, Works perfect! Thanks very much smile

#205780 31/10/08 07:48 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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. }
}

sparta #205781 31/10/08 07:53 PM
T
ToRmEnTeD
ToRmEnTeD
T
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!

#205796 01/11/08 06:49 AM
T
Tomao
Tomao
T
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.
#205797 01/11/08 08:05 AM
K
Kol
Kol
K
Wouldn't this be a perfect situation for user levels? o.O

#205798 01/11/08 09:48 AM
R
RusselB
RusselB
R
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.

#205809 01/11/08 04:50 PM
T
Tomao
Tomao
T
So what is your recommendation on such matter? Using a hash table perhaps?

#205815 01/11/08 06:47 PM
R
RusselB
RusselB
R
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