About the $regex Horstl:
I wanted the bot to respond different if i added
me or
I in the command like so:
Botname give nick1 and nick 2 a beer and one for me too.
At first I started the code like so because i wanted to be a barbot:
if (Botname == $strip($1)) { bla bla bla
Now i made it more like a respondbot aswell and so some of the code starts like this as well:
if (hello isin $strip($1-)) { bla bla bla
In the original code the botname was the trigger.
I dropped that part in the new code.
With the new code if i use this command:
Give nick1 and nick 2 a beer and one for me too.
It doesnt respond with the correct respond.
But if i change the command too:
Give nick1 and nick 2 a beer Botname and one for me too.
Then it responds correctly.
It doesn't matter where i put the botname.
My guess is the $regex is doing that.
Here is the code that i use original in full:
On 1:text:*beer*:#:{
if (mIRCStats == $strip($1)) {
var %nicknum = $nick($chan,0)
var %nick1 = 1
while (%nicknum >= %nick1) {
if ($nick($chan,%nick1) isin $strip($2-)) {
var %nicklijst = $addtok(%nicklijst,$v1,32)
}
inc %nick1
}
var %nicklijst = $replace(%nicklijst,$chr(32),$+($chr(32),$chr(38),$chr(32)))
if (%nicklijst) {
if ($regex($1-,/(?<= |^)(?:i|me)(?= |$)/Si)) {
.timer 1 2 $read($scriptdir\drinken\beerme.txt,t)
}
else {
.timer 1 2 $read($scriptdir\drinken\beerlist.txt,t)
}
}
else {
.timer 1 1 $read($scriptdir\drinken\beer.txt,t)
}
}
}
Here is the code changed a bit:
On 1:text:*:#:{
if (Are you happy isin $strip($1-)) {
var %nicknum = $nick($chan,0)
var %nick1 = 1
while (%nicknum >= %nick1) {
if ($nick($chan,%nick1) isin $strip($1-)) {
var %nicklijst = var %nicklijst = $addtok(%nicklijst,$v1,32)
}
inc %nick1
}
var %nicklijst = $replace(%nicklijst,$chr(32),$+($chr(32),$chr(38),$chr(32)))
if (%nicklijst) {
if ($regex($1-,/(?<= |^)(?:i|me)(?= |$)/Si)) {
.timer 1 2 $read($scriptdir\acts\ruhappyme.txt,t)
}
else {
.timer 1 2 $read($scriptdir\acts\ruhappylist.txt,t)
}
}
else {
.timer 1 1 $read($scriptdir\acts\ruhappy.txt,t)
}
}
}
Only thing changed is the first if.
It works in the original code because the botname is the trigger.
Hope this helps you help me.