mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2024
Posts: 4
S
Srj Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: May 2024
Posts: 4
Hello,
I'm fairly new to mIRC and don't really know what I'm doing, so I'd appreciate the help if anyone can.
So what I want to do is take the name at the start of a sentence and reply with only the name.
for example:
"Jimmy has entered the chat"
reply with only:
"Jimmy"

is this possible at all? if so, I'd appreciate any help!
Thank you

Joined: Jan 2012
Posts: 310
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 310
Press the key combination "ALT+R" to open the script editor, select from the menu "File/New", then copy the code below and press "OK":
Code
on *:JOIN:#: msg $chan $nick welcome you to our channel.

In this code, the identifier "$nick" is the nickname of the user who joined to the channel.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: May 2024
Posts: 4
S
Srj Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: May 2024
Posts: 4
This works flawlessly!
Is there a way to do this on simple texts within a channel? Not only when they join, but lets say the user sends a message like
"Jimmy likes apples"
Is there a way to reply back with only the name "Jimmy" ?

Joined: May 2024
Posts: 4
S
Srj Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: May 2024
Posts: 4
Sorry, I should've clarified a little more.
I'm looking for if a user types a sentence in the chat saying "Jimmy has entered the chat" or something around those lines. (the user's nick is not Jimmy) then is there a way to grab the text of "Jimmy" and only reply with "Jimmy" afterwards?

Joined: Jan 2012
Posts: 310
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 310
There are many ways to do this, but it all depends on what exactly you need. I've created several variants for you so you can choose the one that's right for you.

Try using this script code:
Code
on *:TEXT:*:#:{
  ;React to text where the first word is always "Jimmy"  
  if (Jimmy == $1) { msg $chan $1 }
  
  ;React to text that contains the word "Jimmy" anywhere, even when the word is written together without spaces
  if (Jimmy isin $1-) { msg $chan $v1 }
  
  ;React only to the presence of a certain sentence in the text, where the first word is always "Jimmy"
  if (Jimmy has entered the chat* iswm $1-) { msg $chan $1 }
  if (Jimmy likes apples* iswm $1-) { msg $chan $1 }
}

All unnecessary conditions can be commented out by placing a ";" sign in front of the line.

You can read more about the "ON TEXT" event handler here: https://en.wikichip.org/wiki/mirc/on_events/on_text


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: May 2024
Posts: 4
S
Srj Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: May 2024
Posts: 4
This is exactly what i needed! Thank you so much, and i appreciate you giving me multiple variations of it too. I'm learning slowly, and this helps a ton!


Link Copied to Clipboard