Jump to content

Cleric xtx

Members
  • Posts

    285
  • Joined

  • Last visited

Posts posted by Cleric xtx

  1. Lil snippet for Nth character

    alias getchar {
     if (- !isin $2) { return $right($left($1,$2),1) }
     else {
       var %n = $gettok($2,1,45) + 1, %r = $right($left($1,$gettok($2,1,45)),1)
       while (%n <= $gettok($2,2,45)) { var %r = %r $+ $right($left($1,%n),1) | inc %n }
       return %r
     }
    }
    
    

    Use: $getchar(string,N)

     

    Eg:

    $getchar(abcdefghijk,4) = d

    $getchar(abcdefghijk,4-7) = defg

  2. I be working on the rail~road, all the live-long days... but this code only took 2mins to redesign tongue.gif

    on *:PART:#:{
     if ($nick($chan,0) < 100) && (!$timer(.limit)) {
       .timer.limit 1 5 mode # +l $calc($nick($chan,0) + 1)
     }
    }
    on *:JOIN:#:{
     if ($nick == $me) halt
     if ($nick($chan,0) < 100) && (!$timer(.limit)) {
       .timer.limit 1 5 mode # +l $calc($nick($chan,0) + 1)
     }
    }
    on *:KICK:#:{
     if ($nick($chan,0) < 100) && (!$timer(.limit)) {
       .timer.limit 1 5 mode # +l $calc($nick($chan,0) + 1)
     }
    }

    Notes

    1) Don't use * for these things, as it would include closing a dcc (ie: it would change the limit if someone left a dcc window).

    2) Don't bother using <= if you can use less coding - this speeds things up.

    3) Check to see whether a timer is active in this situation, otherwise you're just extending the timer.

    4) Why bother making the code look more complicated when you can use a simple # symbol?

    5) I never said this is a solution, just a few peices of advice when coding these things tongue.gif (Yes, I'm aware you didn't code it).

     

    Try this:

    on *:join:#:{
     if ($nick == $me) halt
     if ($hget(#,joins) => 3) { mode # +k # | .timerjoins. [ $+ [ # ] ] 1 5 $roomjoins(#) }
     else { hinc # joins 1 }
    }
    alias roomjoins { hadd -m $1 joins 0 | mode $1 -k $1 }

  3. You can't ban any MSNChat staff member (I class all butterfly-wearing users as staff) and I believe that gives them right to close the chatroom.

    Basically, it's generally not advised unless you want to stir up trouble.

  4. You might as well use this:

    {
     var %a = 1
     while (%a <= $nick($chan,0)) {
       if ($nick($chan,0) == $me) inc %a
       ignore -r $nick($chan,%a)
       inc %a
     }
     echo $chan $nick($chan,0) people removed from ignore list.
    }

    But using /ignore -r clears the list. Here's a simple test for it:

    menu channel {
     Ignores
     .$iif($ignore,$style(1)) On:/ignore -w *
     .$iif(!$ignore,$style(1)) Off:/ignore -r
     Ignore list:{
       window -ak0 @Ignores | clear @Ignores
       var %a = 1
       while (%a) {
         if ($ignore(%a) == $null) break
         echo @Ignores $ignore(%a)
         inc %a
       }
     }
    }

    After using /ignore -r then running that test above, it worked fine for me.

  5. Why would you want to mass kick anyway? Sounds to me like you want to be disruptive. blahblah.gif

    Either way, you can use this:

    {
     var %a = 1
     while (%a <= $nick(#,0)) {
       if ($nick(#,%a) == $me) inc %a
       var %b = $+(%b,$chr(44),$nick(#,%a))
       inc %a
     }
     kick # %b
    }

    Kicks em all in one go

×
×
  • Create New...