mIRC Home    About    Download    Register    News    Help

Print Thread
#225393 01/09/10 02:25 PM
Joined: Sep 2010
Posts: 6
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 6
Hey. I don't really know much about mIRC scripting, but I was wondering if someone can help make a script which will greet a specific user (like /me says hi!) when they join a specific channel. If someone could help me make a code for that I'd really appreciate it.

Thanks.

Joined: Aug 2010
Posts: 134
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2010
Posts: 134
Fortunately, mIRC has this tab called users.

If you press Alt-R, and then go to the Users tab, you can add any number of users and give them a "level". For example, you could enter:

friend:johnny!*@*

And then everyone with the nickname "johnny" will be considered a "friend". You can also use someone's site, or part of a site:

friend:*!*@*.nl

that would make anyone who's site ends on ".nl" a "friend". You could post both lines:

friend:johnny!*@*
friend:*!*@*.nl

Which would make johnny and everyone from .nl a "friend".

Then go to the remote tab, where you can make certain scripts trigger for friends only:

Code:
on friend:join:#homies: {
  msg $chan Hey, $nick $+ . Long time no see!
}


That would run the script for everyone who is listed as a "friend" and joins the #homies channel. You could use # instead of #homies to make your script affect all channels, but not everyone will appreciate you autospamming in channels. An alternative would be:

Code:
on friend:join:#: {
  if $me isop $chan {
    msg $chan Hey, $nick $+ . Long time no see!
  }
}


The "if $me isop $chan" part would make it only execute in channels where you have operator status.

Last edited by Thels; 01/09/10 02:34 PM.

Learning something new every day.
Joined: Sep 2010
Posts: 6
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 6
Wow, thanks for the fast reply.

I tried this out and it works, but I want to make it trigger the /me command. I want to trigger a /me script like when someone joins, it does /me says hi which would translate to 'Iceyoshi says hi'.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/help /describe

Change msg $chan to describe $chan


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2010
Posts: 6
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 6
Awesome, it works great now. Thanks ^^

Joined: Sep 2010
Posts: 6
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 6
How would I check if a user is already in a specific channel? With that code my script would finally work.

Joined: Aug 2010
Posts: 134
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2010
Posts: 134
Code:
if Nickname ison #Channel {
  echo -a Nickname is on #Channel
}
else {
  echo -a Nickname is not on #Channel
}


This of course only works if you're also on #Channel, else it will always return false.


Learning something new every day.
Joined: Sep 2010
Posts: 6
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 6
It didn't seem to work. Here is what I changed it to:

if bot34 ison #botplace {
describe $chan test1
}
else {
describe $chan test2
}

bot34 is the user who joins the channel #botpalace, and I'm already there. I would expect to say 'Iceyoshi test1' if bot34 joins and 'Iceyoshi test2' if bot34 isn't there, but nothing even happens.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
You may be looking for the on JOIN event.

See /help on join

Joined: Aug 2010
Posts: 134
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2010
Posts: 134
You need to place that function somewhere for it to be triggered. In your on join script or in another script. You said the earlier script worked. What did you change to it, and what are you trying to accomplish?


Learning something new every day.

Link Copied to Clipboard