On text Lol. Use for a bot

By Mtn64 on Jul 23, 2011

CHANGE #CHAN TO YOUR CHANNEL, USE FOR A BOT

Im new to scripting, and i was asking a friend on "text" things. And i came up with a On text "LOL"

You can use this on many other things, Change "Lol" to a text, and the 2nd line is a command (note you want to keep $+} from my testings.

Give credit to lordgruntie on mIRC if you see him.

You might need to put this on a bot

Suggestions?

on *:TEXT:Lol:#chan:{
msg #chan $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem- $+ }

;You can take out $Nick if you want. You can change the text. keep $+. Change the #Chan to the channel,You 
;Can change the text. You can change "msg #chan" to "/kick #chan, /ban #chan, etc"

Comments

Sign in to comment.
jaytea   -  Jul 25, 2011

extremity, unfortunately since /inc -uN doesn't decrease after N seconds but rather (re)initializes a timer that unsets it after those N seconds, that bit of code doesn't check precisely for "3 commands in 2 seconds". %lol.flood will equal 4 if those 4 increments are made within just under 2 seconds of each other, ie. 4 increments in just under 6 seconds in the worst case. for more info and a solution to this problem check out this post

 Respond  
extremity   -  Jul 25, 2011

if the incremented variable is less than 3 then display the message.. code is functional

if I halted, then it works

 Respond  
Jethro   -  Jul 25, 2011

extremity, It should have been

>=

and not > <=What you have is smaller than or equal to 3, which means it'll always activate upon triggering.

A flood control shouldn't output any message, which defeats the purpose of controlling flood, unless you want to count the offense in order to warn and kick.

 Respond  
extremity   -  Jul 25, 2011

Flood control can be done several ways.. basically you halt the alias if the command has been used too many times within too many seconds..

my code is basic and I am certain that others have much more effective code that handles per channel and is shorter.

Basic Example:

  ;allows 3 commands per every 2 seconds, change numbers as you wish
  on *:TEXT:Lol:#:{

  ;increments (adds +1) a flood variable that resets after 2 seconds
  inc -u2 %lol.flood

  ;if the flood variable has not incremented 3 or more 
  if (%lol.flood <= 3) {
      msg # $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem-
   } 
}
 Respond  
PyThOn   -  Jul 24, 2011

( o Y o )

 Respond  
jaytea   -  Jul 24, 2011

regex seems to be a way of life around here .. slow or not in msl (Y)

mIRC uses the PCRE library when matching a regular expression against a string, so most of the time it only needs to perform basic operations whenever regex is involved. the only function where it may be considered suitable to discuss the efficiency of mIRC's implementation, since it performs a significant amount of additional work, is $regsubex() and yes, it is a lot slower than it needs to be. mIRC goes through a rather convoluted process when replacements are made with $regsubex() so you can say that, where it counts, mIRC's implementation of regex is slow.

 Respond  
Mtn64   -  Jul 24, 2011

Maybe not, I was messin around with aliases, and i checked the help file about something called "$?" that performs a command before. I might post it.

 Respond  
Mtn64   -  Jul 24, 2011

I feel embarresed, I don't know how to add flood control.. Any help? D=

-ATM Learning how to make random lines, That'll be my next script-

 Respond  
extremity   -  Jul 24, 2011

regex seems to be a way of life around here .. slow or not in msl (Y)

 Respond  
Mtn64   -  Jul 24, 2011

Thanks guys, you understand completely xP

 Respond  
KilllerX   -  Jul 24, 2011

I was wondering why we needed the $+ in this... Which we really don't. Yes I know what it is like with the Bracket marking... I had a couple problems with a script and I set forth to figure it out myself. Come to figure out I was missing an Identifier split the Colon ( : ) and I was missing an End Bracket. I tell ya Strive to learn the next thing if you are really looking to get into this. I should look into regex next myself.

 Respond  
Jethro   -  Jul 24, 2011

we all have to start somewhereWe all know what's like to be new at something we do in life. Don't ever forget where we come from.

 Respond  
napa182   -  Jul 23, 2011

you say leave the $+ } in there why?
you could take it out an do

on *:TEXT:Lol:#:{
  msg # $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem- 
}

or even

on *:TEXT:Lol:#:msg # $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem-

also you may want to make it so people that use color can trigger it by stripping out the color either by doing..

on $*:text:/^lol$/iS:#:msg # $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem-

or

on *:text:$($iif(lol == $strip($1),$1)):#:msg # $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem-

an maybe add some sort of flood control so people can't flood you out.
an so on....
anyways keep at it we all have to start somewhere....

 Respond  
xplo   -  Jul 23, 2011

hmm, this is not a script. its simply a modified event, you should try and do something a little more "complex" like using $read and if then else statements.

6/10 (Neat, since you tried your best, we all gotta start somewhere)

just my 7 cents.

 Respond  
Mtn64   -  Jul 23, 2011

Enjoy. Please don't be rude, I tried my best, Suggestions please?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.