mIRC Home    About    Download    Register    News    Help

Print Thread
#58190 28/10/03 11:21 PM
Joined: Sep 2003
Posts: 122
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Sep 2003
Posts: 122
Code:
on !*:JOIN:#:{
  var %watches = describe # watches as $nick makes their way into the channel.
  if (# == #Santharia) %watches 4"Welcome to the elusive channel Santharian Channel, $nick $+ ."
  elseif (# == #greyhawk) %watches 4"Welcome to the dedicated Dungeons and Dragons channel of # $+ , $nick $+ ."
  elseif (# == #GM_Repo) %watches 4"Welcome to Friday Night at Repo's which take place in # $+ , $nick $+ ."
  elseif (# == #ooc) %watches 4"Welcome to OOC: Sit down, shut up...and hold on $nick $+ !"
}
on !*:PART:#:{
  var %watches = describe # watches as $nick leaves the channel.
  if (# == #Santharia) %watches 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.
  elseif (# == #greyhawk) %watches 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.
  elseif (# == #ooc) %watches 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:#:{
  var %watches = describe # watches as someone leaves the channel.
  if (# == #Santharia) %watches 4"Ready to talk behind $nick $+ 's back?"
  elseif (# == #greyhawk) %watches 4"Ready to talk behind $nick $+ 's back?"
  elseif (# == #ooc) %watches 4"Ready to talk behind $nick $+ 's back?"
}



The join and part works, but not the quit. I get this message in my status window:

#:{ Unknown command

I know this must be a simple fix, but I can't seem to find it.

#58191 28/10/03 11:38 PM
Joined: Jan 2003
Posts: 11
E
Pikka bird
Offline
Pikka bird
E
Joined: Jan 2003
Posts: 11
The QUIT remote doesn't send the channel with it, as it is a disconnect from the network entirely, not a specific channel. There's ways to get around this, but I can't remember any easy solutions to do it.

-Ecks

#58192 28/10/03 11:46 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
/help $comchan here is a small example of how it might be used in your script

Code:
on ^*:quit:{
  var %i = 1
  while ($comchan($nick,%i)) {
    if ($comchan($nick,%i) == #Santharia) || ($comchan($nick,%i) == #greyhawk) || ($comchan($nick,%i) == #ooc) { describe $comchan($nick,%i) watches as someone leaves the channel. 4"Ready to talk behind $nick $+ 's back?"
        inc %i
  }
  halt
}



that would do what your looking to do i think pretty nicely, u may want to edit it alil, but thats the method id try.


D3m0nnet.com
#58193 29/10/03 04:46 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Edit: sorry, the last code I posted was nonsense. Follow this post instead..

As said above, you'd need $comchan() for ON QUIT (and any other events that don't fill $chan (#), i.e. ON NICK).

The code below shows the same method as _D3m0n_'s one (although my loop decreases rather than increasing), however I'd prefer using $istok() for these things:
Code:
on !*:QUIT:{
  var %i = $comchan($nick,0)
  while (%i) {
    var %chan = $comchan($nick,%i)
    if ([color:red]$istok([color:brown]#Santharia #greyhawk #ooc[/color], %chan, 32)[/color]) {
      describe %chan watches as someone leaves the channel. $&
        4"Ready to talk behind $nick $+ 's back?"
    }
    dec %i
  }
}
In this case, $istok() would look if %chan is in "#Santharia #greyhawk #ooc" (only if separated by spaces, hence the "32", which is the ASCII code for space (/help token identifiers, /help $asc, /help $chr)).
If you need more $istok() examples, feel free to ask..

Also, 2 tips:
- I noticed you use "Gararion" in some parts, I assume it would be better if you used "$me"..?
- You have some repeated parts in your ON PART code, you can avoid them if you want:
Code:
on !*:PART:[color:red]#Santharia,#greyhawk,#ooc[/color]:{
  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." [color:red]$me[/color] just doesn't understand why people can't make things simple for themselves.
}

Last edited by cold; 29/10/03 04:48 PM.

* cold edits his posts 24/7
#58194 03/11/03 05:05 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Quote:
#:{ Unknown command


Just a thought ... is there a space between : and { ??

"on !*:JOIN:#: {"


I refuse to engage in a battle of wits with an unarmed person. wink
#58195 03/11/03 09:30 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
that space being there or not it should still work properly, as either method is acceptable to mirc to read.


D3m0nnet.com

Link Copied to Clipboard