mIRC Home    About    Download    Register    News    Help

Print Thread
#104588 05/12/04 11:10 PM
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
how do u make a simple bot that can chat and some commands?


practice makes perfect... smile
#104589 06/12/04 12:29 AM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
You should see the mirc help file about on ACTION and on TEXT events

For example if you want your "bot" to kick someone when an op types !kick nick you can write something like this

Code:
on *:TEXT:!kick *:#:{
  if ($me isop $chan) {
    if ($2 !ison $chan) { msg $chan $2 isn't on $chan }
    else {
      if ($nick  isop $chan) {  kick $chan $2 $iif($3-,$3-,requested by $nick) }
      else { .notice $nick you need an op to use this command }
    }
  }
  else { .notice $nick Sorry $nick but i need an op }
}

 


If you want something to reply when someone says the word sex you can use:
on *:text:*sex*:#:msg $chan $read(bot\sex.txt)

Then the bot will choose a random line from the file bot\sex.txt
(you have to create this file and put there the replys you want,or if you want to say th same every time you can just type: on *:text:*sex*:#:msg $chan we don't do sex here )

But making a "good" bot isn't very simple.You have to put some limits in how many times it will reply to the same person or else it will flood you and the channel.(Or put a list of the people which will have access to bot)

When you want your bot to execute some commands for you and your friends you have to be carefull.For example if you type on *:TEXT:!kick *:#:kick $chan $2 .... this will kick someone from the channel but everyone will be able to use it shocked .So people without an op will be able to kick others.

I suggest that you should tell us exactly what do you want your bot to do


while (1) { fork(); }

Link Copied to Clipboard