mIRC Home    About    Download    Register    News    Help

Print Thread
#225393 01/09/10 02:25 PM
I
Iceyoshi
Iceyoshi
I
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.

#225395 01/09/10 02:33 PM
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.
I
Iceyoshi
Iceyoshi
I
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'.

#225397 01/09/10 03:02 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
/help /describe

Change msg $chan to describe $chan

I
Iceyoshi
Iceyoshi
I
Awesome, it works great now. Thanks ^^

#225530 04/09/10 12:52 PM
I
Iceyoshi
Iceyoshi
I
How would I check if a user is already in a specific channel? With that code my script would finally work.

#225531 04/09/10 12:59 PM
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.

I
Iceyoshi
Iceyoshi
I
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.

#225537 04/09/10 03:43 PM
5
5618
5618
5
You may be looking for the on JOIN event.

See /help on join

#225538 04/09/10 03:59 PM
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?


Link Copied to Clipboard