mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
A friend of mine asked a strange request for a script earlier... he wanted to open a browser on the clicking on a string that looked like #123456 instead of opening the channel.

I came up with this:
Code:
join {
  if ($right($1,-1) isnum) {
    if ($?!="This will open a webbrowser, continue?" == $true ) {
      url http://www.imdb.com/title/tt $+ $right($1,-1)
      halt
    }
  }
  join $$1
}


Now the minute i typed that code I figured it would create an infinite loop on the join alias... but for some reason it didn't,
can anyone explain this to me please?
laugh

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
mIRC scripting doesn't allow direct recursion, so when you call join within that alias it's actually performing the built-in join command.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
i see...

Thanks ;-) explains alot!

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You can use a 0-second timer to get around the problem:

Code:
join {
  if ($right($1,-1) isnum) {
    if ($?!="This will open a webbrowser, continue?" == $true ) {
      url http://www.imdb.com/title/tt $+ $right($1,-1)
      halt
    }
  }
  .timer 1 0 join $$1
}

Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
LOL

you mean to actually make it loop :tongue:

hahaha ;-)

I never wanted it to loop in the fisrt place, I was just expecting it to loop.


Link Copied to Clipboard