mIRC Homepage

Channel Slap Script

Posted By: Kanegasi

Channel Slap Script - 31/07/10 10:47 AM

This script has slowly grown over time from the simple rightclick slap command. Right now, I use a simpler version of the below as the right click. Before you read into the script, I would like to list the problems I'm having that I would like help on.

- For some reason, the whole thing isn't processing $me. When someone calls it using !slap (my current nick), the script ignores it completely. The second comparison in the first ifthen was one of my attempts to get the script to carry my nick through.

- The timer doesn't process. Instead, it gives me "/timer: timer slap not active" in the status window. I think it's because timer can't be used to process more than one line. I used to have it call the script through an alias, but then I had problems carrying variables and the target through to the script.

- In some of the lines in the txt files, I have " $nick($chan,$rand(1,$nick($chan,0)),a,r) " which is supposed to retrieve a random nick, voiced and above, in the channel the !slap was called from, but it returns nothing.

Thank you for your help for anyone who responds.

on *:TEXT:!slap *:*:{
  if ($2 ison $chan) || ($2 isin $me) {
    set %slap $2
    .timerslap 1 1 {
      if ($rand(0,1) == 1) { $read(scripts\txt\slaps.txt) ( $+ from $iif(%slap == $nick,theirself,$nick) $+ ) }
      else { describe $chan $read(scripts\txt\randomslap-slaps.txt) $iif(%slap == $me,himself,%slap) with $read(scripts\txt\randomslap-objects.txt) ( $+ from $iif(%slap == $nick,theirself,$nick) $+ ) }
    echo 8 -egi10tslbf $nick used your slap on $iif(%slap == $me,yourself,%slap) in $chan
    unset %slap
  else halt
Posted By: chacha

Re: Channel Slap Script - 31/07/10 12:08 PM

use $iif or an alias for the timer
Posted By: Kanegasi

Re: Channel Slap Script - 31/07/10 12:13 PM

Like I said, the problem I ran into using an alias was carrying over the variables. I'm not sure how to do that. If I use an alias, I get the timer, but the variables don't carry over. If I keep it as it is, the variables carry through, but the timer doesn't work. I really wish there was a straight-forward wait command rather than timers...
Posted By: chacha

Re: Channel Slap Script - 31/07/10 12:22 PM

when u have alias u don't need to your a variable here
just do /timerX 1 1 the_alias $2 $me $nick

here instead of %var u'll use $1

alias the_alias {
  if ($1 == $2) <= if $2 == $me  
  elseif ($1 == $3) <= if $2 == $nick
Posted By: Kanegasi

Re: Channel Slap Script - 31/07/10 12:28 PM

OH... so if you name your variables after the alias call, they'll correspond with $1, $2, $3, $N in the alias depending on the order they're named after the alias call in the originating line? I think you helped me more than just the timer problem. Thank you.
Posted By: Riamus2

Re: Channel Slap Script - 31/07/10 04:28 PM

Yes. Anything following the alias name will be treated in the alias as $1 to $X (however many things you put there).
© 2020 mIRC Discussion Forums