string char exactly equal
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

string char exactly equal

Started by xjr13sp, 26 November, 2003, 17:39:23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xjr13sp

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"
                             },

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

xjr13sp

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!!

plop

http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk