mIRC Homepage
Posted By: Matt_Toeltl Help with Enterance Code - 28/03/10 01:30 AM
Good evening everybody, This is my first post so take it easy on me.

Anyways,


I am making a bot for my chat (Last time i did something like this was around 1998 so I am rusty at it) and every-time somebody enter he sends them a message with the rules of the chat. Problem is i only want him to do such a thing on their first visit only

Code:
on 1:JOIN:#:{

  /msg $nick Welcome we use a "Three Strikes You Out" policy when it comes to rule breaking first 2 "strikes" are warning kicks and the third "strike" is a kick/ban, Rule 1: ----------   Rule 2: ----------  Rule 3: ---------- Rule 4: ----------
}


Me and a few friends of mine have been trying to work on this with no luck. All three of us pretty much have made our chat bots from scratch and share code for with each other.

we have tried if statements, adding the new users to the guser list and so on with no luck.

Any help would be greatly appreciated!

Thanks Matt
Posted By: XperTeeZ Re: Help with Enterance Code - 28/03/10 01:47 AM
There are several ways you can accomplish this.
The easiest would probably be with text file containing nicknames that already visited the channel:
Code:
on 1:JOIN:#: if ($nick !isin $read(nicks.txt,s,$nick)) { msg $nick Welcome we use a "Three Strikes You Out" policy when it comes to rule breaking first 2 "strikes" are warning kicks and the third "strike" is a kick/ban, Rule 1: ----------   Rule 2: ----------  Rule 3: ---------- Rule 4: ---------- | write nicks.txt $nick }
}

Posted By: Matt_Toeltl Re: Help with Enterance Code - 28/03/10 02:04 AM
Tried it and it did not work

keeps giving a /if is invalid command
Posted By: RusselB Re: Help with Enterance Code - 28/03/10 04:46 AM
If you are using a copy of mIRC obtained from anywhere but here then you may have a cracked copy of mIRC, in which case whoever cracked it broke (at minimum) part of the MSL.

If you aren't sure, then get a copy from the above link and it should work fine.
Posted By: Horstl Re: Help with Enterance Code - 28/03/10 11:36 AM
Besides an odd }-bracket, $read(file,s,word) will return all the text following word of the first line starting with word. If only the nickname is written to the file, the $read will return nothing (even if $readn will return a line number and could be used for the check (but only if there is any line following that line)).
Suggestion:
Code:
on *!:join:#YOURCHAN: { 
  if (!$read(firstjoins.txt,s,$nick)) {
    write firstjoins.txt $nick done
    msg $nick Welcome we use a "Three Strikes You Out" policy when it comes to rule breaking first 2 "strikes" are warning kicks and the third "strike" is a kick/ban, $&
      Rule 1: ----------   Rule 2: ----------  Rule 3: ---------- Rule 4: ----------
  }
}
Posted By: Matt_Toeltl Re: Help with Enterance Code - 28/03/10 02:41 PM
Now this worked thank you very much
© mIRC Discussion Forums