| | 
 
| 
| 
|  |  
| 
Confuzzled
 |  
| Confuzzled | 
possible mirc based topic lock? i got this from hawkee's site forgot by who
 
 on *@:MODE:#: {
 if ( !$istok($me ChanServ ,$nick,32) ) {  {
 mode $chan $replacex($1-,+,-,-,+)
 }
 }
 }
 
 just curious if there's script like this out there that has to do with changing topics only.  for example if an op in my channel changes the topic my bot will automatically change the topic back to the previous topic
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2005 Posts: 1,052 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2005 Posts: 1,052 | 
on *:JOIN:#:{
if ($nick == $me) { 
%topic $+ chan = $chan(#).topic
}
}
on *:TOPIC:#:{
if ($nick == $me) { 
timer 1 3 /set %topic $+ chan $chan(#).topic | halt
}
else { topic # %topic $+ chan }
}
or just //mode # +t and theres your topic lock |  |  |  
| 
| 
|  |  
| 
Joined:  Feb 2004 Posts: 2,013 Hoopy frood |  
|   Hoopy frood Joined:  Feb 2004 Posts: 2,013 | 
If you want an event to only trigger if you are the reason it triggers, then you can use this construct:
 on me:*:<event>:...
 
 That avoids the check for if ($nick == $me)
 
 Examples:
 
 on me:*:join:#:{
 ;code
 }
 
 Less code, faster, and enables you to have multiple on join events in an event.
 
 Similarly, if you want the event to only trigger if you are not the person causing the even to trigger you can use this:
 
 on !*:join:#:{
 ;code
 }
 
 In contrast with doing:
 
 on *:join:#:{
 if ($nick != $me) {
 ; code
 }
 }
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2005 Posts: 1,052 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2005 Posts: 1,052 | 
Meh old ways never die force of habbit lol
 :P
 
 here also i thought you might want to unload the vars on quit or part
 
 FiberOptics im not sure if that syntax works with quit and part but here goes nothing
 
 on me:*:quit:{
 unset %topic*
 }
 
 on me:*:part:#:{
 unset %topic*
 }
 |  |  |  
| 
| 
|  |  
| 
Joined:  May 2005 Posts: 449 Fjord artisan |  
|   Fjord artisan Joined:  May 2005 Posts: 449 | 
Hey,
 I didn't know about the on me.... events.  I've noticed that my ON TEXT events don't respond to me.  For future reference, can I do something like on me:*:TEXT...?  Would this respond to my text too?  Thanks.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2005 Posts: 1,052 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2005 Posts: 1,052 | 
no.. your text = On INPUT
 example:>
 
 on *:INPUT:#:{
 if ($1 == lol) { msg $chan Laughing Out Loud $2- | /halt }
 if (badword isin $1-) { echo -a Sorry i cannot post that on the board it contains foul language }
 elseif ($left($1,1) != /) || ($ctrlenter) {
 echo -t $target < $+ $me $+ > $1-
 .raw privmsg $active : $+ $1-
 halt
 }
 }
 
 so if the first word = lol then it outputs Laughing out Loud texthere
 |  |  |  
| 
| 
|  |  
| 
Joined:  Oct 2004 Posts: 8,061 Hoopy frood |  
|   Hoopy frood Joined:  Oct 2004 Posts: 8,061 | 
Lpfix5 and FiberOPtics, you mixed up your format for using "me".    bwr30060, use: on me:quit: { } on me:part:#: { } on me:join:#: { } etc. If you want it to work only when you're opped, just put @ in front like normal: on @me:part:#: { } "me" is a special prefix referring to you.  You can use it instead of using * or 1 (or some other number/name) in that part of the event.  Saves needing to use "if ($nick == $me) { }" in your code.
Last edited by Riamus2; 31/10/05 04:17 PM.
 |  |  |  
| 
| 
|  |  
| 
Joined:  May 2005 Posts: 449 Fjord artisan |  
|   Fjord artisan Joined:  May 2005 Posts: 449 | 
Lpfix5,   I've used the on input events, but I have had a problem with them.  When I halt the default text to do things, my commands don't work, like /whois Nick.  Is there a way around this?  Thanks. PS-- if I do a statement like this, will it work? 
if ($left($1-,1) == $chr(47)) { echo }
Thanks.
Last edited by bwr30060; 31/10/05 04:52 PM.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Apr 2004 Posts: 701 Hoopy frood |  
|   Hoopy frood Joined:  Apr 2004 Posts: 701 | 
No, they got it right and you got it wrong. "me:" is a prefix, not a userlevel. 
 Saturn, QuakeNet staff
 |  |  |  
| 
| 
|  |  
| 
Joined:  Oct 2004 Posts: 8,061 Hoopy frood |  
|   Hoopy frood Joined:  Oct 2004 Posts: 8,061 | 
Yes, I know it's a prefix.
 I've never put that extra * in there and it works fine.  Right now, I can't test to see if this other method works as well.
 
 Perhaps not using the * makes it assume a *.  In either case, I can't see many reasons why you need it to check your own user level, but I can see a few cases like that.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Apr 2004 Posts: 701 Hoopy frood |  
|   Hoopy frood Joined:  Apr 2004 Posts: 701 | 
I've never put that extra * in there and it works fine.No it doesn't, not unless you have added yourself with userlevel "me" at some point. 
 Saturn, QuakeNet staff
 |  |  |  
| 
| 
|  |  
| 
Joined:  Oct 2004 Posts: 8,061 Hoopy frood |  
|   Hoopy frood Joined:  Oct 2004 Posts: 8,061 | 
Well, I'll check when I'm home.  Since I can't connect at work, I can't see if any events work since on input obviously isn't appropriate for the me prefix. |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2005 Posts: 1,052 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2005 Posts: 1,052 | 
bwr scroll up i included the / code in my on input code |  |  |  
| 
| 
|  |  
| 
Joined:  Feb 2004 Posts: 2,013 Hoopy frood |  
|   Hoopy frood Joined:  Feb 2004 Posts: 2,013 | 
You're wrong, which is ok, it's not a crime to make a mistake, though I don't like it when people say I'm wrong without investigating the matter thoroughly. I wouldn't put it like that if it weren't for a reason.
 Try this code in your script files:
 
 on me:join:#: echo -a i've joined
 
 Now do a /hop or join a channel --> nothing happens.
 
 Put it as:
 
 on me:*:join:#: echo -a i've joined
 
 Now do a /hop and it will say you've joined.
 
 The me as I've used it, and as Sat has explained is an event prefix just like +, @, ! etc., it's not a user level.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2005 Posts: 1,052 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2005 Posts: 1,052 | 
Tus why I never question FiberOptics    |  |  |  
| 
| 
|  |  
| 
Joined:  Sep 2005 Posts: 2,630 Hoopy frood |  
|   Hoopy frood Joined:  Sep 2005 Posts: 2,630 | 
Sorry if this seems pedantic and you already know, but I just thought I'd point it out... 'me' is the prefix, not 'me:', the : isn't necessary: on me*:join:#: echo -a Works.Is the same as:  on me:*:join:#: echo -a Works. |  |  |  
| 
| 
|  |  
| 
Joined:  Feb 2004 Posts: 2,013 Hoopy frood |  
|   Hoopy frood Joined:  Feb 2004 Posts: 2,013 | 
Well, I'm only a normal person, who makes mistakes as anyone, so you may always question me   Just ask if you're wondering why I do something that you think is weird or wrong in your opinion. |  |  |  
| 
| 
|  |  
| 
Joined:  Feb 2004 Posts: 2,013 Hoopy frood |  
|   Hoopy frood Joined:  Feb 2004 Posts: 2,013 | 
That's incorrect.
 on me*:join:#: echo -a $nick has joined
 
 triggers on everyone, not just yourself.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Aug 2005 Posts: 1,052 Hoopy frood |  
|   Hoopy frood Joined:  Aug 2005 Posts: 1,052 | 
Sure of course everyone makes mistakes but im sure before we get to see your post your on it ASAP to fix it if error after over looking which i do often i dont realize till its posted and i look over it |  |  |  
 | 
 |