mIRC Home    About    Download    Register    News    Help

Print Thread
#112660 25/02/05 11:12 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I just thought of a $var addition to be able to get the duration before the time is unset with the .unset property.

I used the search feature and it turns out 2 other people suggested it, but I thought I'd contribute, to see what others think.

I think it'd be a good addition because, because most of my scripts need to know when they are being unset which brings me to my final idea which may look and sound stupid but maybe something like..

Code:
On *:VAR:Set: {
   echo -a $1 was set.
}

On *:VAR:Unset: {
  echo -a $1 has been unset.
}

#112661 26/02/05 12:10 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
edit: nevermind, I guess I didn't read your entire post (or did you edit it perhaps?)

Last edited by qwerty; 26/02/05 12:12 AM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#112662 26/02/05 12:13 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
:P lol. I did, I used a data range to 2 years. Which is where the 2 people came in Hrung and Nimue. smile

#112663 26/02/05 12:24 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Regarding your suggestion, I'd like to have the ability to execute code when a var is unset (I have reservations about var:set though because I don't know how much it'll slow mirc down). And while we're at it, why not something like on-auto-unban (/ban -uN) or on-hash-table-item-unset (/hadd -uN).

It might be a good idea to make this feature toggle-able, if it turns out that even on var:unset slows things down in some cases.

edit: an alternative (easier) way to implement this is the existing signal system: each time a variable/hash table item/ban expires mirc could execute an internal /signal _unset or something, filling $1- with the type, name and value of the expired item. This would also address the toggle issue more elegantly; there would be an option "Send signal on unset" that could be checked/unchecked somewhere.

Last edited by qwerty; 26/02/05 12:39 AM.
#112664 26/02/05 12:35 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Nice to hear your positive view on VAR:Unset, I do like your auto unban idea, that'd be nice for mIRC to handle bans without -u and non -u bans seperately. And the hash table item expire I do like that too. As you said earlier..

Code:
On *:Var:Unset:*: {
  do some commands
}


Maybe something like..

Code:
On *:hashtable:table_name:item: {
   if ($hevent == expire) {
    do some commands
  }
}


I added :*: for unset just for the off chance of specifying which %var you want it to check thats being unset, just like $1 would do.

Last edited by SladeKraven; 26/02/05 12:36 AM.
#112665 26/02/05 12:35 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Yeah if it doesn't slow things down too much they would all be excellent additions. :[/b])


Link Copied to Clipboard