mIRC Home    About    Download    Register    News    Help

Print Thread
#67071 08/01/04 06:19 AM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
I have this code:

Code:
alias stats {
  tokenize 32 $sorttok($eval($str($!rand(1,6) $+ $chr(32),4),2),32,n)
  msg # 7 $1 + $2 + $3 + $4 = 4 $calc($2 + $3 + $4)
}

on 1:TEXT:*Generate*Stats*:#greyhawk:/statbuy

alias statbuy {
  /say ===================
  /say Your Stats
  /say ===================
  /stats
  /stats
  /stats
  /stats
  /stats
  /stats
  /say ===================
}


Why doesn't this work when someone on #greyhawk says Generate Stats?

If I type /statbuy myself it works, but what I want is that when other people ask for this, when they say Generate Stats, I will give them the stats by saying /statbuy

Last edited by Gar; 08/01/04 06:23 AM.
#67072 08/01/04 06:30 AM
Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
use /msg $active, not say. /say can only be used when you, yourself, are triggering the alias. i.e. you type it in the channel window.

#67073 08/01/04 06:45 AM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
thanks


I think I will use this thread still for my next question.

In the above script, say if it generates a 1 when it gets a random number, how can I make it get a new random number each time it generates a 1? I know I could have it generate a number between 2 & 6, but that is not what I want. I still want the possibilty to get twos but not the possibility to get a 1 and when it gets a one it should get a new random number. Do yous understand what I am asking?

#67074 08/01/04 07:16 AM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
nvm, I gave in and just made it inot a 2-6 script. the code is now:

Code:
alias stats {
  tokenize 32 $sorttok($eval($str($!rand(1,6) $+ $chr(32),4),2),32,n)
  msg # 7 $1 + $2 + $3 + $4 = 4 $calc($2 + $3 + $4)
}
alias statsdrop {
  tokenize 32 $sorttok($eval($str($!rand(2,6) $+ $chr(32),4),2),32,n)
  msg # 7 $1 + $2 + $3 + $4 = 4 $calc($2 + $3 + $4)
}

on *:text:*:#: {
  if ($1 == Stat) && ($2 == Roll) && ($3 == Drop) {
    /statbuydrop
  }
  elseif ($1 == Stat) && ($2 == Roll) {
    /statbuy
  }
}

alias statbuy {
  /msg $active 12 ===================
  /msg $active 12 Your Stats $nick
  /msg $active 12 ===================
  /stats
  /stats
  /stats
  /stats
  /stats
  /stats
  /msg # 12 ===================
}
alias statbuydrop {
  /msg $active 12 ===================
  /msg $active 12 Your Stats $nick
  /msg $active 12 ===================
  /statsdrop
  /statsdrop
  /statsdrop
  /statsdrop
  /statsdrop
  /statsdrop
  /msg # 12 ===================
}


Link Copied to Clipboard