mIRC Homepage
Posted By: r_alien Flooding Problem - 06/09/05 09:13 AM
I'm having a problem with a script i have! :tongue: It's part of a bot i have modded a bit! :P There is a function that searches for the status of some features and says if they are on or off, however some users have been exploiting this and keep asking !status OR !status on

Here is the code:

Code:
on 1:text:*status*:#:{
  if ($1 == %c $+ status) {
    .msg $nick The Sabotage Recording mode is on. This currently only records WHO you and others sab and how many weapons they have lost when you submit the details of a sabotage where i am.
    .msg $nick The Sabotage Details mode is on. To see the details on a user that has been sabbed type !sabdetails username
    .msg $nick More KOC related fatures coming soon! xD
    if (%st.hl == $2) { .msg $nick The Higher/Lower game is on, to play type  $+ %c $+ guess <number>. The object is to guess the correct number [1- $+ %high.n $+ ]. }
    if (%st.gb == $2) { .msg $nick The Guestbook is on, to leave a message type %c $+ guestbook. }
    if (%st.df == $2) { .msg $nick The Definition mode is on, for example, when someone types brb, the bot will give the definition. }
    if (%st.mb == $2) { .msg $nick The Message Board Center is on, for help commands type %c $+ mbhelp. }
    if (%st.sk == $2) { .msg $nick The Swearkick is on. }
    if (%st.lk == $2) { .msg $nick The Add Your Own Link section is on, for help, type %c $+ links. }
    if (%st.sn == $2) { .msg $nick The Seen Mode is on. To see if someone that you know has been seen by me, type %c $+ seen <nickname>. }
    if (%st.stb == $2) { .msg $nick The Spin The Bottle is on. To spin the bottle, type %c $+ spin. }
    if (%st.f == $2) { .msg $nick The Eightball is on. To ask the eightball a question, type %c $+ eightball <question>. }
    if (%st.ck == $2) { .msg $nick The Command Kick is on. Do not use more than 3 commands in 30 seconds unless you're a bot operator. }
    if (%st.hp == $2) { .msg $nick The Hot Potato game is on. Please type %c $+ toss to play. }
    if (%st.ps == $2) { .msg $nick The Personality mode is on. Type %c $+ whatis <nick> to find out what someone is. }
    if (%st.bd == $2) { .msg $nick The Birthday Mode is on, to record your birth day, type %c $+ bday <day/month/year> (don't put the year you were born, put the year in which your next birthday falls). To find out how long it is until someone's birthday, type %c $+ cday <nick>. }
    if (%st.vend == $2) { .msg $nick The Vending Machine is on, to see whats for sell, type %c $+ vendmenu. }
    if (%st.pg == $2) { .msg $nick The Ping Mode is on, to see your ping reply, type %c $+ ping. }
    if (%st.bt == $2) { .msg $nick The Bot Talk mode is on, feel free to start a conversation with me. }
    if (%st.triv == $2) { .msg $nick The Trivia Game is on, commands are as follows: %c $+ trivia <answer> (lets you guess the answer) --- %c $+ hint (gives you a hint) --- %c $+ repeat (repeats the question) --- %c $+ next (skips to the next question) --- %c $+ tscore <nickname> (lets you see how many times someone has won) }
    if (%st.faq == $2) { .msg $nick The FAQ Mode is on, to ask a question, please type %c $+ faq <question>. Operators only: Type %c %+ mnav for help. }
    if (%st.off == $2) { .msg $nick No more modes are on. | halt }
  }
  else { halt }
}


I keep getting kicked from the IRC server when a user(s) do that, so i was wondering how would i be able to get flood protection in that script? Preferably flood protection per user, so that say they can only call it once every 5 minutes or so?
Posted By: SladeKraven Re: Flooding Problem - 06/09/05 11:00 AM
Code:
on 1:text:*status*:#:{
if ($1 == $+(%c,status)) {
    if (!$hget(sabotage,$nick)) {
      .msg $nick The Sabotage Recording mode is on. This currently only records WHO you and others sab and how many weapons they have lost when you submit the details of a sabotage where i am.
      .msg $nick The Sabotage Details mode is on. To see the details on a user that has been sabbed type !sabdetails username
      .msg $nick More KOC related fatures coming soon! xD
      if (%st.hl == $2) { .msg $nick The Higher/Lower game is on, to play type ­ $+ %c $+ guess <number>­. The object is to guess the correct number [1- $+ %high.n $+ ]. }
      if (%st.gb == $2) { .msg $nick The Guestbook is on, to leave a message type %c $+ guestbook. }
      if (%st.df == $2) { .msg $nick The Definition mode is on, for example, when someone types brb, the bot will give the definition. }
      if (%st.mb == $2) { .msg $nick The Message Board Center is on, for help commands type %c $+ mbhelp. }
      if (%st.sk == $2) { .msg $nick The Swearkick is on. }
      if (%st.lk == $2) { .msg $nick The Add Your Own Link section is on, for help, type %c $+ links. }
      if (%st.sn == $2) { .msg $nick The Seen Mode is on. To see if someone that you know has been seen by me, type %c $+ seen <nickname>. }
      if (%st.stb == $2) { .msg $nick The Spin The Bottle is on. To spin the bottle, type %c $+ spin. }
      if (%st.f == $2) { .msg $nick The Eightball is on. To ask the eightball a question, type %c $+ eightball <question>. }
      if (%st.ck == $2) { .msg $nick The Command Kick is on. Do not use more than 3 commands in 30 seconds unless you're a bot operator. }
      if (%st.hp == $2) { .msg $nick The Hot Potato game is on. Please type %c $+ toss to play. }
      if (%st.ps == $2) { .msg $nick The Personality mode is on. Type %c $+ whatis <nick> to find out what someone is. }
      if (%st.bd == $2) { .msg $nick The Birthday Mode is on, to record your birth day, type %c $+ bday <day/month/year> (don't put the year you were born, put the year in which your next birthday falls). To find out how long it is until someone's birthday, type %c $+ cday <nick>. }
      if (%st.vend == $2) { .msg $nick The Vending Machine is on, to see whats for sell, type %c $+ vendmenu. }
      if (%st.pg == $2) { .msg $nick The Ping Mode is on, to see your ping reply, type %c $+ ping. }
      if (%st.bt == $2) { .msg $nick The Bot Talk mode is on, feel free to start a conversation with me. }
      if (%st.triv == $2) { .msg $nick The Trivia Game is on, commands are as follows: %c $+ trivia <answer> (lets you guess the answer) --- %c $+ hint (gives you a hint) --- %c $+ repeat (repeats the question) --- %c $+ next (skips to the next question) --- %c $+ tscore <nickname> (lets you see how many times someone has won) }
      if (%st.faq == $2) { .msg $nick The FAQ Mode is on, to ask a question, please type %c $+ faq <question>. Operators only: Type %c %+ mnav for help. }
      if (%st.off == $2) { .msg $nick No more modes are on. | halt }
      hadd -mz sabotage $nick 300
    }
  }
  else { halt }
}


-Andy
© mIRC Discussion Forums