PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: xjr13sp on 26 November, 2003, 17:39:23

Title: string char exactly equal
Post by: xjr13sp on 26 November, 2003, 17:39:23
Hi,

I'm trying do get a string character but I have some troubles.... Let me explain:

I have a TiggerBot, and I have declared the string "lol".
Problem I have is that there is a user in my hub which have "lolo" as username.... and each time someone says "lolo" in the main chat, my bot sends a reply!!

My question is: is it possible to declare an exact string char (then if I say "lolo", it will not be interpreted as "lol")?

Here is a part of the script:
Quotebotname = "-=MonBot=-"

trigs = {
           
 ["lol"]={
 "Yeah, [CURUSER] that was funny,  Hahahaha.",
 "Hmm, ok that was funny, I think :)",
 "what! [CURUSER]  why are you laughing?",
 "You shake when you laugh, like a bowl full of jelly",
 "hilarious!",
 "hehehehe",
 "hohohohoh"  
                             },

 hehe={
 "Yeah, [CURUSER] that was funny,  Hahahaha.",
 "Hmm, ok that was funny, I think :)",
 "what! [CURUSER]  why are you laughing?",
 "You shake when you laugh, like a bowl full of jelly",
 "hilarious!",
 "hehehehe",
 "hohohohoh"
                             },
Title:
Post by: plop on 26 November, 2003, 21:32:06
try this.
"lol%A"
%A means anything but a letter.
this can cause a next problem because many ppl say it @ the end of a line.
in this case you can try the next 1.
"lol$"
this 1 only matches when lol is @ the end of the line.
i see lol and hehe are both the same so in your case the best/easyest would be 2 copy it again and use both of the triggers.

plop
Title: Yessssssss !!!!!!
Post by: xjr13sp on 27 November, 2003, 00:20:36
Thank you very very much plop!!!
It works well with the first solution : "lol%A"

Quotei see lol and hehe are both the same so in your case the best/easyest would be 2 copy it again and use both of the triggers.
In fact I copied a part of the original script I found here. But I modified it... I'm french, so I translated it and I have added/removed some of trigs....

Thanks a lot again!!
Title:
Post by: plop on 27 November, 2003, 01:58:50
yw.

plop