mIRC Home    About    Download    Register    News    Help

Print Thread
#219757 28/03/10 01:30 AM
Joined: Mar 2010
Posts: 5
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2010
Posts: 5
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

Joined: Nov 2009
Posts: 20
X
Ameglian cow
Offline
Ameglian cow
X
Joined: Nov 2009
Posts: 20
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 }
}


Joined: Mar 2010
Posts: 5
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2010
Posts: 5
Tried it and it did not work

keeps giving a /if is invalid command

Last edited by Matt_Toeltl; 28/03/10 02:07 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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: ----------
  }
}

Last edited by Horstl; 28/03/10 11:41 AM.
Joined: Mar 2010
Posts: 5
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2010
Posts: 5
Now this worked thank you very much


Link Copied to Clipboard