mIRC Home    About    Download    Register    News    Help

Print Thread
#55676 18/10/03 01:55 AM
Joined: Sep 2003
Posts: 122
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Sep 2003
Posts: 122
Is there a way of combining these scripts so they are shorter?

on !*:JOIN:#Santharia:{
describe # watches as $nick makes their way into the channel. 4"Welcome to the elusive channel # $+ , $nick $+ ."
}

on !*:PART:#Santharia:{
describe # watches as $nick leaves the channel. 7"Why they leave? If they wanted to quit why didn't they just quit instead of leaving the channel first then quiting." Gararion just doesn't understand why people can't make things simple for themselves.
}

on *:QUIT:{
if ( $nick ison #Santharia ) {
describe #Santharia watches as someone leaves the channel. 4"Ready to talk behind $nick $+ 's back?"
}
}

on !*:JOIN:#greyhawk:{
describe # watches as someone makes their way into the channel. 4"Welcome to the dedicated Dungeons and Dragons channel of # $+ , $nick $+ ."
}

on !*:JOIN:#GM_Repo:{
describe # watches as someone makes their way into the channel. 4"Welcome to Friday Night at Repo's which take place in # $+ , $nick $+ ."
}

on !*:JOIN:#ooc:{
describe # watches as someone makes their way into the channel. 4"Welcome to OOC: Sit down, shut up...and hold on $nick $+ !"
}

on !*:PART:#ooc:{
describe # watches as $nick leaves the channel. 7"Why they leave? If they wanted to quit why didn't they just quit instead of leaving the channel first then quiting." Gararion just doesn't understand why people can't make things simple for themselves.
}

on *:QUIT:{
if ( $nick ison #ooc ) {
describe #ooc watches as someone leaves the channel. 4"Ready to talk behind $nick $+ 's back?"
}
}

on !*:JOIN:#klintorth:{
describe # watches as someone makes their way into the channel. 1"Welcome to the friendly and welcoming channel of # $nick $+ ."
}

#55677 18/10/03 04:28 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
*Deleted my last reply*
Hrm sorry I had totally missed the point.
You can use general targets for your events and use /if to check which channel they're referring to, like this:
Edit: since "watches as $nick makes their way into the channel" is always used, there is a better way.
Code:
[color:green]; Supposing you have only 2 ON JOIN events.
; Instead of...[/color][color:#888888]

on !*:JOIN:#Santharia:{
  describe # watches as $nick makes their way into the channel. $&
    4"Welcome to the elusive channel # $+ , $nick $+ ."
}
on !*:JOIN:#greyhawk:{
  describe # watches as someone makes their way into the channel. $&
    4"Welcome to the dedicated Dungeons and Dragons channel of # $+ , $nick $+ ."
}
[/color]
[color:green]; ...You'd use only one event:[/color]

on !*:JOIN:[color:brown]#[/color]:{

  [color:red]var %watches = describe # watches as $nick makes their way into the channel.[/color]

  [color:brown]if (# == #Santharia) [color:red]%watches[/color][/color] 4"Welcome to the elusive channel # $+ , $nick $+ ."
  [color:brown]elseif (# == #greyhawk) [color:red]%watches [/color]$&[/color]
    4"Welcome to the dedicated Dungeons and Dragons channel of # $+ , $nick $+ ."

}

[color:green]; Note: actually you don't need to use $&, I just used it so I could break the line,
; otherwise the webboard width would be messed up.[/color]
Try to do this with all your available channels and events, it's the same method for all of them.

Last edited by cold; 18/10/03 04:36 AM.

* cold edits his posts 24/7
#55678 20/10/03 10:52 AM
Joined: Sep 2003
Posts: 58
S
Babel fish
Offline
Babel fish
S
Joined: Sep 2003
Posts: 58
Try this one :

Code:
 [color:red] 
on !*:join:*: {
  if ($chan == #santharia) { 
    describe # watches as $nick makes their way into the channel. $&
    4"Welcome to the elusive channel # $+ , $nick $+ ."
  }
  elseif ($chan == #grayhawk) { 
    describe # watches as someone makes their way into the channel. $& 
    4"Welcome to the dedicated Dungeons and Dragons channel of # $+ , $nick $+ ."
  }
  elseif ($chan == #GM_Repo) { 
    describe # watches as someone makes their way into the channel. $&
    4"Welcome to Friday Night at Repo's which take place in # $+ , $nick $+ ."
  }
  elseif ($chan == #ooc) { 
    describe # watches as someone makes their way into the channel. $&
    4"Welcome to OOC: Sit down, shut up...and hold on $nick $+ !"
  }
  elseif ($chan == #klintorth) { 
    describe # watches as someone makes their way into the channel. $&
    1"Welcome to the friendly and welcoming channel of # $nick $+ ."
  }
} [/color] 


Also do this for the "PART" events

Grtzzz


***************************
To chat, or not to chat.
That's the question
#55679 20/10/03 11:18 AM
Joined: Dec 2002
Posts: 1,544
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,544
Then of course there's always this (yes I realize the greetings arent 100% identical):

Code:
on !*:join:*: {
 describe # watches as $nick makes their way into the channel.
 if ($chan == #santharia) { //msg # 4"Welcome to the elusive channel # $+ , $nick $+ ." }
 elseif ($chan == #grayhawk) { //msg # 4"Welcome to the dedicated Dungeons and Dragons channel of # $+ , $nick $+ ." }
 elseif ($chan == #GM_Repo) { //msg # 4"Welcome to Friday Night at Repo's which take place in # $+ , $nick $+ ." }
 elseif ($chan == #ooc) { //msg # 4"Welcome to OOC: Sit down, shut up...and hold on $nick $+ !" }
 elseif ($chan == #klintorth) { //msg # 1"Welcome to the friendly and welcoming channel of # $nick $+ ." }
}


Those who fail history are doomed to repeat it
#55680 20/10/03 11:25 AM
Joined: Sep 2003
Posts: 58
S
Babel fish
Offline
Babel fish
S
Joined: Sep 2003
Posts: 58
But if you do it like that, than the first part of the message wil be shown in any channel that someone joins...
And i think he means only the channels he mentioned..

That's why i didn't do it like you did...
I thought about it do...

Grtzzz


***************************
To chat, or not to chat.
That's the question
#55681 20/10/03 11:46 AM
Joined: Dec 2002
Posts: 1,544
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,544
very true - however a simple change to get around that would be to put the channel names they wanted it to fire in on the eventline so instaed of * it would read #chan1,#chan2, etc


Those who fail history are doomed to repeat it
#55682 20/10/03 03:05 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
That's exactly what the solution I posted does, anyway.

Edit: Actually $nick is only used in the first one (I've missed that), which would easily be solved being replaced (in %watches) by $iif(# == #santharia,$nick,someone)

Last edited by cold; 20/10/03 03:08 PM.

* cold edits his posts 24/7

Link Copied to Clipboard