mIRC Homepage
Posted By: pykolas hugs sending bot - 27/09/16 11:59 PM
So I have this:

Quote:
on *:text:!vhug *:#:{
if ((%floodEVERYONE) || ($($+(%,floodEVERYONE.,$nick),2))) { return }
set -u2 %floodEVERYONE On
set -u3 %floodEVERYONE. $+ $nick On
msg $chan $nick sends virtual hug to $2- http://goo.gl/LgPNx8 GivePLZ
}


I want it to get activated, take username from person who activates command and give hug. My problem is that this bot can take nickname like "This is nickname" and it will output all 3 words. How can I make so it would only take second word instead of all after first one? (first one is !vhug)
Posted By: Fonic_Artes Re: hugs sending bot - 28/09/16 12:15 AM
Using a - after $2- makes it include everything after that.

Code:
on *:text:!vhug *:#:{
if ((%floodEVERYONE) || ($($+(%,floodEVERYONE.,$nick),2))) { return }
set -u2 %floodEVERYONE On
set -u3 %floodEVERYONE. $+ $nick On
msg $chan $nick sends virtual hug to $2 http://goo.gl/LgPNx8 GivePLZ 
}
Posted By: pykolas Re: hugs sending bot - 01/10/16 04:52 PM
Thanks
Posted By: keyeslol Re: hugs sending bot - 01/10/16 05:21 PM
Be careful with injections. You should sanitize your $2.
© mIRC Discussion Forums