mIRC Home    About    Download    Register    News    Help

Print Thread
Channel Slap Script #223672 31/07/10 10:47 AM
Joined: Jul 2010
Posts: 5
K
Kanegasi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jul 2010
Posts: 5
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.

Code:
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
}

Last edited by Kanegasi; 31/07/10 10:48 AM.
Re: Channel Slap Script [Re: Kanegasi] #223687 31/07/10 12:08 PM
Joined: Feb 2009
Posts: 133
C
chacha Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
use $iif or an alias for the timer


WorldDMT
Re: Channel Slap Script [Re: chacha] #223688 31/07/10 12:13 PM
Joined: Jul 2010
Posts: 5
K
Kanegasi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jul 2010
Posts: 5
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...

Re: Channel Slap Script [Re: Kanegasi] #223689 31/07/10 12:22 PM
Joined: Feb 2009
Posts: 133
C
chacha Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
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

Code:
alias the_alias {
  if ($1 == $2) <= if $2 == $me  
  elseif ($1 == $3) <= if $2 == $nick
}


WorldDMT
Re: Channel Slap Script [Re: chacha] #223690 31/07/10 12:28 PM
Joined: Jul 2010
Posts: 5
K
Kanegasi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jul 2010
Posts: 5
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.

Re: Channel Slap Script [Re: Kanegasi] #223704 31/07/10 04:28 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes. Anything following the alias name will be treated in the alias as $1 to $X (however many things you put there).


Invision Support
#Invision on irc.irchighway.net