The simplest solution would be to create such a small script. This code must be inserted into the scripts editor. To do this, press the key combination "ALT+R":

Code
on *:TEXT:*:#: if (!$hget(onegreet,$nick)) { .hadd -mu3600 onegreet $nick 1 | /msg $chan $nick $onegreet }
alias -l onegreet {
  var %og_rand $rand(1,3)
  if (%og_rand == 1) var %og_mess = Hello!
  if (%og_rand == 2) var %og_mess = Hi my friend!
  if (%og_rand == 3) var %og_mess = Nice to see you here!
  return %og_mess
}

Explanation:

The bot will check in the hash table for each user who writes any a message on the channel with help "if (!$hget(onegreet,$nick))".
If the user nickname there is not, then he will enter this nickname in the hash table ".hadd -mu3600 onegreet $nick 1". (If you disable the bot, then all hash tables will be erased).
Where the value "3600" will be the number of seconds for how long necessary to remember and keep the nickname of this user and not reply to him. After the expiration of time, table is deleted. (You can change this number).
The bot responds with the command "/msg $chan $nick $onegreet". The identifier "$onegreet" works through alias of the same name "onegreet", where you can create any number of random messages.
In this example, there are only 3 messages and, accordingly, the identifier "$rand(1,3)" randomly selects one of them in the range 1-3. If you add more messages, do not forget to change the value "$rand(1,?)".
If the random number is 1 "if (%og_rand == 1)" then, accordingly, the first sentence is entered into the value of the variable "%og_mess". And so on.
And at the end the "return" command returns a variable "%og_mess" with a message in for identifier "$onegreet".

I think everything is simple here and I hope it is clear.



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples