mIRC Home    About    Download    Register    News    Help

Print Thread
#158762 09/09/06 01:26 AM
Joined: Aug 2006
Posts: 1
J
Mostly harmless
OP Offline
Mostly harmless
J
Joined: Aug 2006
Posts: 1
i made this for a script i was using to mirror stuff between channels and i didn't want to have to keep opening servers in the same order.
i remember a few people asking about something like this before so i figured i'd post it. sorry if something similar has been posted before.
what this does is it creates a $findnetwork identifier that uses the network name to find the scon # and return it's value.
example:
/scon $findnetwork(EFnet)
that will switch the script to the EFnet network. (assuming you are connected to that network.)
if you try to find a network that you are not connected to, it returns $null

Code:
/findnetwork {
  var %nextnet = 1
  scon %nextnet
  while ($network != $null) {
    if ($network == $1) { return %nextnet }
    inc %nextnet
    scon %nextnet
  }
  return $null
}


if anyone has some tips to make the script better, i would also like to hear them.

Joined: Dec 2002
Posts: 417
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
I currently use something simular in one of my scripts
[color:blue]
Code:
alias network {
  var %i = 1
  while ($scon(%i)) {
    scon %i
   < do this command >
    inc %i
  }
} [/color] 




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Here's what I use:

Code:
 alias sc {
  var %o = 1, %p = $$1
  while $scon(%o).network {
    if ( %p == $v1 ) { 
      if ( $prop ) return $($+($,scon(%o).,$prop),2)
      else return %o
    }
    inc %o
  }
}  


An identifier that is similar to $scon but instead of giving the Nth connection, you give the network name.

Syntax: $sc(Network)[.identifier]

Sample: //echo -a $sc(undernet).me -> will give your current nick in undernet.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
I use this one by FiberOPtics, which is very versatile: $findcid(),

Joined: Feb 2004
Posts: 201
J
Jae Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
i made a feature suggestion just before about being able to name connections and call them by name, surely the same for network would be an idea too? although multiple connections to a network/server would pose problems but im sure its workable.


Link Copied to Clipboard