mIRC Home    About    Download    Register    News    Help

Print Thread
#188475 24/10/07 06:33 AM
Joined: Jun 2006
Posts: 79
B
Babel fish
OP Offline
Babel fish
B
Joined: Jun 2006
Posts: 79
Code:
 
if ($signal == d) { 
  if ($2 ison $1) {
    .hinc -u45m e g
    if ($hget(e,g) < 5) !kick $1 $2 $3
    if ($hget(e,g) == 10) {
      .timerdk 1 25 $delaykick
      .echo -s Delay kick started
    }
  }
}


timer dk not run. this type of kick means if victim < 5 == kick, and 10th victim my delay kick will started

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Remove the . in front of the timer line to make sure that the timer is starting. While the . is there you won't see the timer start even though it is.
If the timer is starting (and I can't see any reason from the code you provided that it wouldn't), then post your delaykick alias.

Also make sure that your delay kick alias doesn't require any information to be passed to it, as, currently, you aren't passing any information to the alias.

RusselB #188497 25/10/07 12:07 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
timers hate $ to be the first call. use...

.timer 1 1 /$command

or

.timer 1 1 command

or

.timer 1 1 /command

not

.timer 1 1 $command


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #188520 25/10/07 05:42 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
hmm.. something for me to add to my knowledge base.

Now that I think of it, I don't think I've ever used a timer to call an identifier directly.

Lpfix5 #188534 25/10/07 12:34 PM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
but $delaykick isn't being called by the timer. it's being evaluated before the timer is initiated, what you're thinking of would've been if he used $!delaykick

btw, there doesn't appear to be a problem calling identifiers on their own as a timer's command, where'd you get that from? :P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
jaytea #188541 25/10/07 03:13 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
jaytea its a specific test you can perform

alias jaytea { echo -a hi }

.timer 1 1 $jaytea will not initiate properly

.timer 1 1 /jaytea will


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #188542 25/10/07 03:22 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Originally Posted By: Lpfix5
alias jaytea { echo -a hi }

.timer 1 1 $jaytea will not initiate properly

.timer 1 1 /jaytea will

In the first timer (assuming the command is in a script or executed with // from the editbox) $jaytea is evaluated before the timer starts. During this evaluation it /echo's "hi" and returns nothing, leaving /timer with no command to execute and behaving as such.

You can delay the evaluation of $jaytea using the $!identifier syntax: //.timer 1 5 $[color:red]!jaytea[/color]

With the second timer /jaytea is executed as expected.

Both of these are entirely proper behaviours.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
lol I know, but if you notice the original post the OP is not escaping the command therefore its treated as an eval. Im not arguing that escaping the command will execute the alias properly I know thats one method as well but the OP is missin ! / or remove $


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #188550 25/10/07 06:05 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Isn't it more likely that $delaykick is designed to return a command (to be executed when the timer finishes)? Anyway, timers don't "hate $ in the call", period... smile
Personally I regard custom identifiers executing commands as inadequate/delusive syntax.

Horstl #188554 25/10/07 06:29 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Well it does if $ is alone calling the alias and the beginning.

Im not sure if im explaining well but .timer 1 1 /$delaykick would allow $delaykick to be inside the box of the alias. Then again if using / with $ why not just use / or even ignore the whole fact and do .timer 1 1 delaykick

if you call $ immediately after the timer has its call command it will return the alias "outside the box"

A) Totally ignoring the timer

So, why use a timer if your gonna call $ immediately why not just

/delaykick and be done with it.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #188577 25/10/07 11:43 PM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
Originally Posted By: Lpfix5

So, why use a timer if your gonna call $ immediately why not just

/delaykick and be done with it.


$delaykick might /return a command (or series of commands) to be used in the timer. we're not saying his way is anywhere near the best to go about it, knowing him it most certainly ISNT, just that you have the wrong idea about what's happening here ;P

Code:
//timer 1 1 $ident


$ident evaluates immediately and its value is used as the timer's command

Code:
//timer 1 1 /$ident


/$ident is not evaluated immediately, it's considered plaintext. 1 second later, it's evaluated and performed as a command

the two are different, play around with this by using /timers if you need to and hopefully you'll understand wink like Collective said, $!ident is the same as /$ident here, both delay its evaluation until the timer performs its command


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
jaytea #188587 26/10/07 03:24 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I c sorry guys I miss took things


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard