mIRC Home    About    Download    Register    News    Help

Print Thread
#16195 20/03/03 10:45 PM
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
does anyone know how to / if it is possible to reset certain variables?
ive tried % [ *won* ] ; but that only creates a new one frown


can anybodey help frown


Heh..
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
I'm not sure i understand what you want to do... If you mean reset variables literally, well just /set %Variable_Name <Value> and the old value will automatically be overwritten.


- cF
Dedicated helper for rent.
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
lemme give u an example: i have 2 vars close in name:
%123id 888
and
%323id 888

can i reset ALL variables with "id" in them, or do i have to type them all individualy?


Heh..
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
try unset %*id
that will unset the variables ... ... i think ..... i dont know if u can set %*id 00 to set all variables with id in the end to 00 but its a possible try to see if that works for u


D3m0nnet.com
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Quoted from the help file:
/unset [-s] <%var>
This unsets and removes the specified variables from the variables list. If you specify a variable with wildcard characters then all matching variables will be removed.
/unset %test*


Therefore i think you should be able to /unset %*id*. Or if it doesn't work, try this:

Code:
alias Lucres {
  var %reset = $var($2,0), %i = 0
  if (%reset &gt; 0) {
  if ($1 = unset) {
  while (%reset &lt;= %i) { .unset $var($2,%i) | inc %i 1 }
  }
  elseif ($1 == reset) {
  while (%reset &lt;= %i) { .set $var($2,%i) $3- | inc %i 1 }
}
}
}


How to use:
To clear all variables matching a specific wildcard, use /Lucres unset *id*.
If you want to change the values of all the variables matching a specific wildcard, use /Lucres reset *id* <New value>.

Note that *id* can be any wildcards/string combination you wish.

Hope it helps

Last edited by c0ldfusi0n; 21/03/03 03:22 AM.

- cF
Dedicated helper for rent.

Link Copied to Clipboard