Jump to content

mIRC Bot Test


Spyder_X

Recommended Posts

moo here is how the script is setted up

on :*:TEXT:*:#bottest:{

 if ( $nick isop $chan || $me isop $chan ) {

   if ( $1 == !kick ) { /kick $chan $2 $3- | /notice $nick $2 has been kicked! }

   if ( $1 == !ban )  { //mode $chan +b $address($2,2) | /notice $nick $2 has been banned  } 



   if ( $1 == !moderate ) { /mode $chan +m | /msg $chan This Channel is now under moderation, only voice + users can talk! } 

   if ( $1 == !unmod ) { /mode $chan -m | /msg $chan The moderation has now ended, Please Follow the Rules }
 }

 if ( $1 == !rules ) { 
   /notice $nick Rule 1: No flooding the chat!
   /notice $nick Rule 2: Follow the rules!

 }
}

Link to comment
Share on other sites

Ok, seeing as the bot doesn't respond at all, make sure the script is active first. You are opped in #bottest so it *should* work.


Merged post follows:

Consecutive posts merged

oh, I almost missed it, I think you have an extra :

 

Here:

 

on :*:TEXT:*:#bottest:{

 

should be

on *:TEXT:*:#bottest:{

Link to comment
Share on other sites

like this

on *:TEXT:*:#bottest:{

on *:TEXT:* ( $nick isop $chan || $me isop $chan ) {

on *:TEXT:* ( $1 == !kick ) { /kick $chan $2 $3- | /notice $nick $2 has been kicked! }

on *:TEXT:* ( $1 == !ban )  { //mode $chan +b $address($2,2) | /notice $nick $2 has been banned  } 



on *:TEXT:* ( $1 == !moderate ) { /mode $chan +m | /msg $chan This Channel is now under moderation, only voice + users can talk! } 

on *:TEXT:* ( $1 == !unmod ) { /mode $chan -m | /msg $chan The moderation has now ended, Please Follow the Rules }
 }

on *:TEXT:* ( $1 == !rules ) { 
   /notice $nick Rule 1: No flooding the chat!
   /notice $nick Rule 2: Follow the rules!

 }
}

Link to comment
Share on other sites

Okay now it's working.

 

Now the bot essentially reacts EVERY time someone speaks in the channel. You should change that, it's also simpler to read and operate. Something like this:

 

on *:TEXT:!kick *:#bottest:{
  if ( $nick isop $chan || $me isop $chan ) {
       /kick $chan $2 $3- | /notice $nick $2 has been kicked!
  } else {
       /msg $nick You're unauthorized.
  }
}

on *:TEXT:!ban *:#bottest:{
  if ( $nick isop $chan || $me isop $chan ) {
      /mode $chan +b $address($2,2) | /notice $nick $2 has been banned
  } else {
       /msg $nick You're unauthorized.
  }
}

 

BTW, you should probably do "&&" in the 'isop' condition. What you have at the moment is a condition that EITHER the bot is op *or* the user is op. That means that if the bot is op but someone NON op is requesting !kick, the bot will comply. That might not be what you want. We could add more access codes later for permissions and user ranks, etc... but for starters, I'd change the "if isop" to && instead of "or".


Merged post follows:

Consecutive posts merged
like this

on *:TEXT:*:#bottest:{

on *:TEXT:* ( $nick isop $chan || $me isop $chan ) {

on *:TEXT:* ( $1 == !kick ) { /kick $chan $2 $3- | /notice $nick $2 has been kicked! }

on *:TEXT:* ( $1 == !ban )  { //mode $chan +b $address($2,2) | /notice $nick $2 has been banned  } 



on *:TEXT:* ( $1 == !moderate ) { /mode $chan +m | /msg $chan This Channel is now under moderation, only voice + users can talk! } 

on *:TEXT:* ( $1 == !unmod ) { /mode $chan -m | /msg $chan The moderation has now ended, Please Follow the Rules }
 }

on *:TEXT:* ( $1 == !rules ) { 
   /notice $nick Rule 1: No flooding the chat!
   /notice $nick Rule 2: Follow the rules!

 }
}

Your syntax is all screwed up. Look at my example above.

Edited by mooeypoo
Consecutive posts merged.
Link to comment
Share on other sites

this is so far

on *:TEXT:!kick *:#bottest:{
 if ( $nick isop $chan || $me isop $chan ) {
   !kick $chan $2 $3- | /notice $nick $2 has been kicked!
   } else {
   /msg $nick You're unauthorized.
   if ( $nick isop $chan || $me isop $chan ) {
     !ban $chan +b $address($2,2) | /notice $nick $2 has been banned!
   } else {
   /msg $nick You're banned from this channel.

   }
 }

Link to comment
Share on other sites

Spyder, the syntax is:

ON [level]:[type of input]:[text inputted]:[where?]: { routine to run }

 

So your script is saying, essentially, that no matter what user level (first *), if the script sees a TEXT that equals "!kick" in the channel #bottest, it will run the routine.

 

Your syntax for "ban" should be DIFFERENT condition than the syntax for "Kick".. what you did in the above snippet is tell your script to react to someone saying "kick" and then check if they wrote !ban... that's not the way it works.

 

you either tell your script to react on *EVERY* text input and then test what the input is (and react accordingly) *or* you set it up to react to specific text inputs.

 

Don't mix the two up. go over my example above again.. see how I separated the two commands.

Link to comment
Share on other sites

Your syntax is again screwed up. The bot doesn't know what to do with "!ban" since it's not a mirc command.. perhaps you meant "/ban" ?


Merged post follows:

Consecutive posts merged
on *:TEXT: !ban :#bottest: {
   !ban $chan +b $address($2,2) | /notice $nick $2 has been banned!
   } else {
   /msg $nick You're banned from this channel.
 }
}  

Also, my friend, where did the "if" statement go? you can't have "ELSE" without the "IF".. if you decide to get rid of the "if a user is op" statement, then you need to get rid of the followup "ELSE", and if you want to keep it, you need to keep the if statement.

 

I think you should go over syntax. And rules of conditionals.

Link to comment
Share on other sites

Spyder... seriously, mah man... you need to go over if statements, yous statement is not even in the right place. The "if" should OBVIOUSLY be BEFORE the "else"..

 

Like so:

 

on *:TEXT: !ban *:#bottest: {
   [b]if ( $nick isop $chan || $me isop $chan ) {[/b]
           /ban $chan +b $address($2,2) | /notice $nick $2 has been banned!
   } else {
          /msg $nick You're banned from this channel.
   }
 }

Link to comment
Share on other sites

If you want a bot that kicks and bans people, you can download a pre-made script for that. If you want to program it yourself, you have to learn the basics. You seem to need to read up about conditionals (if/else statements) and whiles and all that, and about how to keep things in { } proper brackets.

 

And the general gist of a programming language -- IE, have the theoretical idea in your head and how to translate it into the script, etc. Read up, come back when you can at least build theoretical ideas for the code.. as it goes now, we're going in circles because you lack the very basics of the language.

 

I can't help with that, you need to read about it.

Link to comment
Share on other sites

OK here's the final script and it works very good in my server.

It has 64 lines.

on *:TEXT:hey:#US-RP: msg # Glad to have you back here! $nick
on *:TEXT:bye:#US-RP: msg # Thanks for visiting and hope you join again! $nick
on *:JOIN:#US-RP: msg #Welcome to bottest the home for testing your bots $nick
on *:TEXT:!website:#US-RP: msg # http://us-rp.tk .... $nick Thanks for asking!
on *:TEXT:!op*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan +o $2
 }
}    
on *:TEXT:!deop*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan -o $2
 }
}    
on *:TEXT:!hop*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan +h $2
 }
}    
on *:TEXT:!dehop*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan -h $2
 }
}    
on *:TEXT:!voice*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan +v $2
 }
}    
on *:TEXT:!devoice*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan -v $2
 }
}    
on *:TEXT:!ban*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan +b $2
 }
}    
on *:TEXT:!unban*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan -b $2
 }
}    
on *:TEXT:!kick*:#US-RP: {
 if ($nick isop $chan) {
   mode $chan +k $2
 }
}    

#
on *:TEXT:*:#US-RP:{

 #
 if ( $1 == !moderate ) { /mode $chan +m | /msg $chan This Channel is now under moderation, only voice + users can talk! }
 #

 #
 if ( $1 == !unmod ) { /mode $chan -m | /msg $chan The moderation has now ended, Please Follow the Rules }
 #
}
#

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.