mIRC Home    About    Download    Register    News    Help

Print Thread
#4341 01/01/03 01:47 PM
Joined: Dec 2002
Posts: 28
B
bibadi Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 28
Í want: when i say "lol" my script will automatically change it to "laughing out loud"
how?


I'm.... LETHAL
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
on *:INPUT:#:{
if ( $1 == lol ) {
say Laughing Out Loud
halt
}
}

#4343 01/01/03 01:52 PM
Joined: Dec 2002
Posts: 28
B
bibadi Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 28
well i try


I'm.... LETHAL
Joined: Dec 2002
Posts: 28
B
bibadi Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 28
do i have to specify channel


I'm.... LETHAL
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
It should work in all channels, btw, I changed it since you first read it, so you might have the first one which didn't work very well.

Joined: Dec 2002
Posts: 28
B
bibadi Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 28
it worked:D, but if i want more to say like lol and rofl,
must i make the command whole again or can i put it somewhere


I'm.... LETHAL
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You mean like this or what?
on *:INPUT:#:{
if ( $1 == lol ) {
say Laughing Out Loud $2-
halt
}
if ( $1 == rofl ) {
say Rolling on the floor laughing $2-
halt
}
}

The $2- are optionaly but will make it say "Laughing out loud" and whatever you put after it..

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I think he means the lol should be translated no matter where it is in the sentance.

on *:INPUT:#:{
if ($left($1,1) == $chr(47)) {
return
}
var %totallols = $findtok($1-,lol,0,32)
var %i = 0
var %text = $1-
while (%i < %totallols) {
inc %i
set %text $reptok(%text,lol,laughing out loud,1,32)
}
say %text
halt
}

That should do what you want.

Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
or you could do both.
Code:

on *:INPUT:#:{
if ($left($1,1) == /) &amp;&amp; (!$ctrlenter) { return }
var %text = $1-
while ($findtok(%text,lol,0,32)) || ($findtok(%text,rofl,0,32)) {
%text = $reptok($reptok(%text,lol,laughing out loud,1,32),rofl,rolling on floor laughing,1,32)
}
say %text
halt
}
 


this should do both.

Joined: Dec 2002
Posts: 7
T
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
T
Joined: Dec 2002
Posts: 7
I believe this way works as well, and would be less complicated.
Code:
  
 on *:INPUT:#:{ 
 if ($left($1,1) != $chr(47)) {
 msg $chan $replace($1-,lol,laughing out loud,rofl,rolling $&amp; 
                    on the floor laughing)
  halt
 } 
}

smile

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
With that method if i wanted to say lollipop it would come out "laughing out loudlipop".


Link Copied to Clipboard