mIRC Homepage
Posted By: McOwnage on join send message and log user ??? - 07/04/07 09:33 AM
I know there is a way to make an on join message but is there a way after sending the message that it logs the name so it will NOT send them that message next time they join?

Example
bob joins #chan1
<mybot> hello bob if you need help with bots type !help and I will private message you the bots commands ***This is a one time message but you can use !help at any time***
jane joins #chan1
<mybot> hello jane if you need help with bots type !help and I will private message you the bots commands ***This is a one time message but you can use !help at any time***
Bob left #chan1
2 days later bob joins but the bot knows he was sent the message already so does not send the message.

any idea? also I would like to manually add people that already know the commands and do not need to get this message
Posted By: Variable Re: on join send message and log user ??? - 07/04/07 10:44 AM
Just a thought, why not write the join nicks to text and use a halt if nick isin
Code:
on *:JOIN:#: {
  if ($nick isin $read(nicks.txt,w,$+(*,$nick))) { halt }
  else /write nicks.txt $nick
  /msg # your text
}

Posted By: Kardafol Re: on join send message and log user ??? - 07/04/07 11:26 AM
This has been done before. Use the search feature.
Code:
on !1:join:#chan1,#chan2:{
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $wildsite
  .notice $nick Welcome to $+($chan,!)
}

That will send a message once every 30 minutes, and match their hostmask instead of nickname. Of course, you'll need to change #chan1,#chan2 to your channel, and add it to your remotes (ALT + R).
You can change the "hadd -mu1800 ..." to "hadd -mu86400 ..." for 24 hours, etc. The number is in seconds, so you'll have to calculate it a bit to find the value.
Posted By: McOwnage Re: on join send message and log user ??? - 07/04/07 04:46 PM
1. Their hostmask is not shown that is why I said name.
2. I did use search.
3. Just because you THINK someone did not use search does not mean they did not use it.


Originally Posted By: Kardafol
This has been done before. Use the search feature.
Code:
on !1:join:#chan1,#chan2:{
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $wildsite
  .notice $nick Welcome to $+($chan,!)
}

That will send a message once every 30 minutes, and match their hostmask instead of nickname. Of course, you'll need to change #chan1,#chan2 to your channel, and add it to your remotes (ALT + R).
You can change the "hadd -mu1800 ..." to "hadd -mu86400 ..." for 24 hours, etc. The number is in seconds, so you'll have to calculate it a bit to find the value.
Posted By: Kardafol Re: on join send message and log user ??? - 07/04/07 04:52 PM
1. You did not use search.
2. Explain to me how their hostmask is not shown.
3. Just because you're too lazy to change a few lines of code and/or you're not intelligent enough to understand a simple scripting language does not mean you should be rude to people for attempting to help you.
Originally Posted By: McOwnage
1. Their hostmask is not shown that is why I said name.
2. I did use search.
3. Just because you THINK someone did not use search does not mean they did not use it.


Originally Posted By: Kardafol
This has been done before. Use the search feature.
Code:
on !1:join:#chan1,#chan2:{
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $wildsite
  .notice $nick Welcome to $+($chan,!)
}

That will send a message once every 30 minutes, and match their hostmask instead of nickname. Of course, you'll need to change #chan1,#chan2 to your channel, and add it to your remotes (ALT + R).
You can change the "hadd -mu1800 ..." to "hadd -mu86400 ..." for 24 hours, etc. The number is in seconds, so you'll have to calculate it a bit to find the value.


Edit: Forgot to add your quote for added effect.
Posted By: McOwnage Re: on join send message and log user ??? - 07/04/07 05:09 PM
I was trying to be rude you came across as rude with your comment

It has been a long times since I scripted in Mirc I have forgotten allot and allot has been added.

as for search I looked thru all 201 search results (some are on the same thread)

on this server you see your own host mask for everyone

example
my hostmask is say mcownage@200.200.200.200
when I do a whois or they join i see bob(mcownage@200.200.200.200)
/whois bob
bob is mcownage@200.200.200.200 * McOwnage (this is always the person that does the whois info the rest is the person ya did whois to
bob on #chan1 #chan2 .#chan3
bob using random.fakeserver.net fakename Chat Service
bob is a registered nick
bob has been idle 1hr 43mins 36secs, signed on Fri Apr 06 19:22:27
bob End of /WHOIS list

don't ask how they set that up but they did
Posted By: Kardafol Re: on join send message and log user ??? - 07/04/07 05:46 PM
See? Isn't it easier to communicate to other people when we're polite?
You can simply change:
Code:
on !1:join:#chan1,#chan2:{
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $wildsite
  .notice $nick Welcome to $+($chan,!)
}

to:
Code:
on !1:join:#chan1,#chan2:{
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $gettok($address($nick,0),1,64) $+ @*
  .notice $nick Welcome to $+($chan,!)
}

Then, if you want to save the data, you can use (will keep data intact after you restart the bot):
Code:
on !1:join:#chan1,#chan2:{
  if (($hget(welcomed. $+ $chan) == $null) && ($isfile($scriptdirjoinsg.hsh)) {
    hload -bi welcomed. $+ $chan $qt($scriptdirjoinmsg.hsh) $chan
  }
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $gettok($address($nick,0),1,64) $+ @*
  hsave -bi welcomed. $+ $chan $qt($scriptdirjoinmsg.hsh) $chan
  .notice $nick Welcome to $+($chan,!)
}

You can remove the "u1800" (1800 seconds until the join message can be sent again), if you want the message to be sent only once.
Posted By: McOwnage Re: on join send message and log user ??? - 08/04/07 05:31 AM
First Thank you I took your statement wrong after I re-reading it i see it was not rude I am SORRY
just got home from work put script in and get this when someone joins
* /if: invalid format (line 12, script.ini)
line 12 is
Code:
  if (($hget(welcomed. $+ $chan) == $null) && ($isfile($scriptdirjoinsg.hsh)) {


been a while but may be missing a ) I count 14 ( and 13 ) between the first { and last } but no clue where to put the 14th )

I tried adding one here on this line
Code:
  if (($hget(welcomed. $+ $chan) == $null) && ($isfile($scriptdirjoinsg.hsh))) {

but nothing happens (no error no message)
Posted By: Kardafol Re: on join send message and log user ??? - 08/04/07 09:32 AM
Code:
on !1:join:#channel1,#chan2:{
  if (($hget(welcomed. $+ $chan) == $null) && ($isfile($scriptdirjoinsg.hsh))) {
    hload -bi welcomed. $+ $chan $qt($scriptdirjoinmsg.hsh) $chan
  }
  var %x = $hget(welcomed. $+ $chan,0).item
  while (%x) {
    if ($hget(welcomed. $+ $chan,%x).item iswm $fulladdress) {
      return
    }
    dec %x
  }
  hadd -mu1800 welcomed. $+ $chan $gettok($address($nick,0),1,64) $+ @*
  hsave -bi welcomed. $+ $chan $qt($scriptdirjoinmsg.hsh) $chan
  .notice $nick Welcome to $+($chan,!)
}

This is working for me, and you can do:
/hadd welcomed.#channel nickname!*@*/*!ident@*
then /hop to have it never send a message to anyone matching that mask. If you removed the u1800, then you should remove joinmsg.hsh, and type [/b]/hfree -w welcomed.*[/b], to clear all the lists, incase something was added. Alternatively, you can put your bot in a new channel, and join there to see if it works or not.
Posted By: McOwnage Re: on join send message and log user ??? - 08/04/07 01:57 PM
That worked Thank you allot
© mIRC Discussion Forums