mIRC Home    About    Download    Register    News    Help

Print Thread
#181780 30/07/07 11:51 PM
Joined: Jul 2007
Posts: 2
W
Wall Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
W
Joined: Jul 2007
Posts: 2
i've been trying to figure out how to create an on:JOIN script which i could configure to say something different depending on the person that joins the channel. if anyone could help me make one that would be greatly appreciated since i can't seem to figure out how to work it.

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Easy.

Code:
on *:join:#Channel: {
  if ($nick == Nick1) { /msg $chan Hello. }
  if ($nick == Nick2) { /msg $chan Different sentence. }
}


Heh, I was a bit surprised when I saw your nick. One of the forum moderators here, Cobra^, is owner of a #mIRC channel on Webnet (split from Dalnet a long time ago) and one of his ops was a guy named Wall. Mus not be you.

Joined: Jul 2007
Posts: 2
W
Wall Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
W
Joined: Jul 2007
Posts: 2
nope thats not me. thanks for the script. it helps a lot.

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
And if you want a generic message:
Code:
on *:join:#Channel: {
  if ($nick == Nick1) { /msg $chan Hello. }
  if ($nick == Nick2) { /msg $chan Different sentence. }
  else { msg $chan Generic greeting, $nick }
}


LonDart
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If you are planning to do more than just a couple of nicks, you really should use another method rather than a ton of IFs...

Code:
on *:start: {
  hmake Welcomes 100
  if ($isfile(Welcomes.hsh)) { hload Welcomes Welcomes.hsh }
}

on *:join:#: {
  if ($hget(Welcomes,$nick)) { msg $chan $v1 }
}

menu nicklist {
  Welcome Message
  .$iif(!$hget(Welcomes,$snicks),Create):WelcomeMsg Create $snicks
  .$iif($hget(Welcomes,$snicks),Change):WelcomeMsg Change $snicks
  .$iif($hget(Welcomes,$snicks),Remove):WelcomeMsg Remove $snicks
}

menu channel {
  Welcome Message
  .Create:WelcomeMsg Create $?="Enter a nick"
  .Remove:WelcomeMsg Remove $?="Enter a nick"
}

alias WelcomeMsg {
  if (!$hget(Welcomes)) {
    hmake Welcomes 100
    if ($isfile(Welcomes.hsh)) { hload Welcomes Welcomes.hsh }
  }
  if ($1 == Create) { hadd Welcomes $2 $$input(Enter Welcome Message,e,Welcome Message) | echo -a Created Welcome Message for $2 -- $hget(Welcomes,$2) }
  elseif ($1 == Change) { hadd Welcomes $2 $$input(Enter Welcome Message,e,Welcome Message,$hget(Welcomes,$2)) | echo -a Changed Welcome Message for $2 -- $hget(Welcomes,$2) }
  elseif ($1 == Remove) {
    if ($hget(Welcomes,$2) == $null) { echo -a Cannot remove message: No welcome message for $2 | return }
    hdel Welcomes $2
    echo -a Removed Welcome Message for $2
  }
  hsave Welcomes Welcomes.hsh
}


To use this, just right click on a nick to Create, Change, or Remove a welcome message for that nick. You will not see all 3 options... only the relevant one(s).

You can also right click in a channel to Create/Change or Remove a welcome message from a nick that you enter. This lets you set this up for nicks that are not online. Note that if you use "Create" when using this from the channel, it will overwrite (Change) any welcome message that may already be entered for that nick.

If you have questions, or problems, let me know.

*NOTE: Don't select multiple nicks when creating a welcome message. This isn't designed to work with multiple nicks.

Last edited by Riamus2; 01/08/07 06:31 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 34
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
is there a way to set this for only 1 specific room?

Joined: Mar 2006
Posts: 47
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Mar 2006
Posts: 47
I use ini files for mine:
Code:
/*
----------Put the following in Misc.ini in the mIRC directory----------
[wb-nicks]
irchighway_anpan = anpan
irchighway_bulbasoarr = anpan
irchighway_GGpX = GGpX

[wb-addresses]
*!*@bite.size.flower.monster = anpan
*!*@bite.size.bread.hero = anpan
*!*@Dark.Knight.or.something = GGpX
----------------------------------------------------------------------
*/

alias settings {
  if ($isid) return $readini(Misc.ini,$1,$$2)
  /writeini Misc.ini $1 $2 $$3-
}
alias addWB {
  /var %nick = $$1
  if ($settings(wb-addresses,$+($network,_,$address($1,2))) != $null) %nick = $v1
  settings wb-nicks $+($network,_,$1) %nick
  settings wb-addresses $address($1,2) %nick
  echo $chan 12*** WB added for label(4 $+ %nick $+ 12) /// nick(4 $+ $1 $+ 12) /// address(4 $+ $address($1,2) $+ 12)
}

ON 1:JOIN:*:{
  if (($settings(wb-nicks,$+($network,_,$nick))) || ($settings(wb-addresses,$address($nick,2)))) {
    /var %wb = $v1, %wb_start = .timer 1 0 /_msg $chan 1,15*WB* $nick *WB*

    if (($settings(wb-nicks,$+($network,_,$nick))) && (!$regex($address($nick,2),$replace(/@[a-f0-9]{59}\.[a-f0-9]{59}\./i,,$chr(44)))) && (!$settings(wb-addresses,$address($nick,2)))) /echo -s >>> New address: /writeini Misc.ini wb-addresses $address($nick,2) $settings(wb-nicks,$+($network,_,$nick))

    /inc -u5 %join. [ $+ [ $network ] ]
    if ((%wb.timer_ [ $+ [ $+($chan,_,%wb) ] ]) || (%join. [ $+ [ $network ] ] > 2)) goto end
    /set -u3600 %wb.timer_ [ $+ [ $+($chan,_,%wb) ] ] Unset at $asctime($calc($ctime + 3600),hh:nn)

    if (%wb == anpan) {
      if ($rand(0,1) == 0) %wb_start <12anpan1> harhar 4/1 <12anpan1> but i am above the paddle 4/1 <KaneDragon> That's what they want you to think. 4/1 <12anpan1> i don't just think that way 4/1 <12anpan1> i make it that way :D 4/1 <12anpan1> oh wait wait 4/1 <12anpan1> i roll that way :D 4/1 <KaneDragon> Yeah, you show that bitter nun who's boss. 4/1 <12anpan1> i flex my booty and the paddle shatters on impact
      else %wb_start <cherrybomber> !prize 24 4/1 <12anpan1> wheeee you win!! 4/3 * 12anpan3 sets mode: +h cherrybomber 4/3 * 12anpan3 sets mode: +b *!*Cherrybom@1959841d.1916f0b2.39c049cc.330f146X 4/3 * cherrybomber was kicked by 12anpan3 (the number was 24 (363 second ban))
    }
    else if (%wb == GGpX) %wb_start 10* anpan was kicked by KaneDragon ((0 ban)) 4/3 * anpan has joined #maximumt 4/10 * anpan was kicked by 12GGpX10 (I wanna try too! (banned) #8) 4/1 <KaneDragon> High five. o/ 4/1 <12GGpX1> o/ 4/1 <Lily> o.O 4/1 <12GGpX1> anpan didn't want to bend over again... 4/1 <12GGpX1> this is his punishment. 4/6 * KaneDragon nods.
  }
  :end
}

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Originally Posted By: dylaninfd
is there a way to set this for only 1 specific room?


Change:
Code:
on *:join:#: {


To:
Code:
on *:join:#specific_channel: {


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard