mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2005
Posts: 17
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jun 2005
Posts: 17
Hi,

Similar to local variables, or variable that automatically unset when mIRC exits (via /set -e), I would like to see variables to are tied to a specific connection. This would include only being seen by scripts associated with that specific connection, and possibly automatically un-set if the connection is lost, or possibly an option to keep/discard, similar to the /set -e option.

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
It's a good idea but why not use dynamic variables:
Code:
set $+(somevar,$network)
;or
set $+(somevar,$scid)

And then..
Code:
ON *:DISCONNECT: {
unset $+(*,$network)
;or
unset $+(*,$scid)

Don't think i'm trying to diss your suggestion i just thought of proposing something smile

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Code:
on *:CONNECT:{
  ;; network specific
  set $+(%, $network, ., somevar) example

  ;; connection specific
  set $+(%, $cid, ., somvar) example2
}
on *:DISCONNECT:{
  ;; unset network specific variables
  unset $+(%, $network, ., *)

  ;; unset connection specific variables
  unset $+(%, $cid, ., *)
}


to access the value of said variables
Code:
;; network specific
$($+(%, $network, ., somevar), 2)

;; connection specific
$($+(%, $network, ., somvar), 2)


I am SReject
My Stuff

Link Copied to Clipboard