mIRC Home    About    Download    Register    News    Help

Print Thread
#259023 27/09/16 11:59 PM
Joined: Mar 2016
Posts: 21
P
pykolas Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Mar 2016
Posts: 21
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)

Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
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 
}

Joined: Mar 2016
Posts: 21
P
pykolas Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Mar 2016
Posts: 21
Thanks

Joined: May 2015
Posts: 133
K
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Be careful with injections. You should sanitize your $2.


twitter @keyeslol

Link Copied to Clipboard