uh talking thingy

By jankins on Jul 28, 2009

idk its my first thingy if it dont work im sorry lol

on *:TEXT:!talk:#:{ msg $chan Pfft im not your slave i dont listen to you i only take commands from jankins. }
on *:TEXT:!talk2:#:{ msg $chan you love me dont you $nick ! }
on *:TEXT:!talk3:#:{ msg $chan Hey imma sexy bot. }
on *:TEXT:!talk4:#:{ msg $chan Well well its jankins. . }
on *:TEXT:!talk5:#:{ msg $chan You all love jankins. }
on *:TEXT:!talk6:#:{ msg $chan $nick you want beer. }
on *:TEXT:!talk7:#:{ describe $chan passes $nick a beer. }
on *:TEXT:!talk8:#:{ msg $chan Cool. }
on *:TEXT:!talk9:#:{ msg $chan Are you that bored $nick ! }
on *:TEXT:!talk0:#:{ msg $chan :O omfg you horny lil bugger $nick ! }
on *:TEXT:!talkk:#:{ describe $chan punches $nick in the face. }

Comments

Sign in to comment.
Jethro   -  Aug 03, 2010

With regex and goto, jankins' snippet gets cut down to a few bytes:

on $*:text:/^[.!](talk{1,2})$|talk([0]|[2-9])$/iS:#:{
  if !%c { inc -u5 %c
    var %msg msg # | goto $regml(1)
    :0 | %msg :O omfg you horny lil bugger $nick $+ ! | halt
    :2 | %msg you love me dont you $nick $+ ! | halt
    :3 | %msg Hey imma sexy bot. | halt
    :4 | %msg Well well its jankins. | halt
    :5 | %msg You all love jankins. | halt
    :6 | %msg $nick you want beer. | halt
    :7 | describe # passes $nick a beer. | halt
    :8 | %msg Cool. | halt
    :9 | %msg Are you that bored $nick $+ ! | halt
    :talkk | describe # punches $nick in the face. | halt
    :talk | %msg Pfft im not your slave i dont listen to you $&
      i only take commands from jankins. | halt
  }
}

Aurora801, your regex can be shortened to:

on $*:TEXT:/^[.!]text([1-5])$/Si:#:{

And you need to place a dollar sign to make sure the number ends as is. Or else it will match 51 5blah or anything that follows it.

As you can see, jankins' code doesn't match for the number 1 but it matches 0 and the rest of numbers up to 9. Also it matches for the word talk with a single or double letter k at the end.

Lastly, a little trigger control is needed because this sort of script is prone to being flooded or spammed.

 Respond  
Aurora801   -  Aug 03, 2010

Heh. Go you, dude. My very first script was something like

on *:TEXT:**:#: { msg $chan someone needs to spell correctly!! }

which sucked, because it triggered on everything. I think after this try some regex. I'm not to heed with th whole $reg* shit but here's an example of the event trigger

on $*:TEXT:/^[.!]text(1|2|3|4|5)/Si:#:

this will check for either ".text" or "!text" followed by a number from one to five. This probably isn't the best way to do regex with numbers like that, but I'm just starting regex now. What you could do after it is "set %text $right(&1,1)" then have something check for what %text is, and send the appropriate.

 Respond  
Kirbeh_Pr0nz   -  Aug 02, 2009

btw, see how u have

 you love me dont u $nick ! }

You can use the $+ tool to bring the $nick and the "!" together instead of spaced.

 $nick $+ !
 Respond  
sk68   -  Aug 01, 2009

my first script was only 1 line and said hi on join =p

 Respond  
jankins   -  Aug 01, 2009

i know its shit lol

 Respond  
Kirbeh_Pr0nz   -  Jul 31, 2009

I never posted a snippet that i knew would embarrass me, so i wait until i actually gained some exp using msl. but yea, i remember my 1st script resembled this a lot. ^^ dont worry Jankins, you'll learn as u keep doing wut ur doing.

 Respond  
Jonesy44   -  Jul 30, 2009

Yeaah.. like, what's the point in posting this? it's not helping anyone.. like, im glad you're learning it! but errr, rather have a script which is helpful :/

 Respond  
knoeki   -  Jul 30, 2009

wtf ? calm down didnt you hear when he said IT WAS HIS FIRST give the kid some credit >:\
good job but yea i agree with the text file, a 1 liner is the best kind of liner :) good job and good luck in teh future :P

I don't care if it was his first or not, it's still crap. My first scripting efforts were rather crappy as well, and people critisized me, which made me want to become better.

If someone can't handle getting some critique, sucks to be him. I'm not going to stop doing it, and again, I don't care if he's new or not.

 Respond  
Ghost-writer   -  Jul 29, 2009

wtf ? calm down didnt you hear when he said IT WAS HIS FIRST give the kid some credit >:\
good job but yea i agree with the text file, a 1 liner is the best kind of liner :) good job and good luck in teh future :P

 Respond  
sk68   -  Jul 29, 2009

yea I figured it out last night, Im a lot less of a moron when its quiet :S

 Respond  
Jonesy44   -  Jul 29, 2009

No, what i mean is, the return has no relevance to the next part of the script (msg or describe)

I would understand if the first 2 in the %say were describes only so it would only describe them & msg the rest, but your second set of randoms (1-9 and 1-2) cover the same messages... there's no logic! it's just at random describe/msg

In the original script there are some that need msgin & some describing.. Just saying :)

 Respond  
knoeki   -  Jul 28, 2009

Indeed, even though you don't need a .txt, it makes it a lot more convenient to quickly add another reply, rather than modifying your code.

 Respond  
sk68   -  Jul 28, 2009

why not? it returns either 1 or 2, which is what I was trying to do

 Respond  
Jonesy44   -  Jul 28, 2009

That "$r(1,2)" has NO logic lol

 Respond  
sk68   -  Jul 28, 2009

you dont need a txt

var %say = Pfft im not your slave i dont listen to you i only take commands from jankins.,you love me dont you $nick $+ !,Hey imma sexy bot.,Well well its jankins. .,You all love jankins.,$nick you want beer.,Cool.,Are you that bored $nick $+ !,:O omfg you horny lil bugger $nick $+ !
var %act = punches $nick in the face.,passes $nick a beer.

on *:TEXT:!talk*:{ var %x = $r(1,2)
if (%x == 1) msg $chan $gettok(%say,$r(1,9),44)
elseif (%x == 2) describe $chan $gettok(%act,$r(1,2),44)
} 
 Respond  
Reaper09   -  Jul 28, 2009

Errm knoeki Do you know how i can make it in to like a quote script so it will read from Like.A .txt file please Tell me if you do but i think you told the person who made it and i Quote "on *:TEXT:!text:#: { msg # $read(text.txt) }" <== would work would it Bro? Oh and to the coder nice go i would rate it 4 outta 10 :)

 Respond  
knoeki   -  Jul 28, 2009

I second the above comment.

Now, I'm normally not someone to correct someone, but seeing as I'm not in a good mood, I'm going to say that this can be done so much better...:

on *:TEXT:!text:#: { msg # $read(text.txt) }

put all the different lines in text.txt

 Respond  
Atr   -  Jul 28, 2009

...

Great tag.. it completely sums up this snippet tbh..

 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.