mIRC Homepage
Posted By: Raccoon On UNSETVAR and On UNSETHASHTABLE events - 10/02/17 04:39 AM
Hey, Mr. Khaled,

Do me a solid and allow me to capture an event or signal when a variable and when a hashtable entry unsets due to -u or -z switches. This would make it a WHOLE lot easier to write bots that have expiring bans or quiets or re-voice other throttles that don't necessarily need a million redundant /timers to be set when the VAR or HASHITEM already knows when it has expired.

mIRC already fires an internal event whenever these objects unset themselves, and I would like to hook into that myself. (Full disclosure: Status window will show these items being unset if the -s switch is used when they were set.)

Thanks.
Posted By: Sat Re: On UNSETVAR and On UNSETHASHTABLE events - 10/02/17 01:47 PM
Uhm, mIRC is already slow enough as it is.. I think that if anything here, it should be possible to specify a callback alias with /set and /hadd that gets called whenever the thing expires.
As long as it does not disrupt mIRC performance.

However I believe it is unnecessary because it is possible to get satisfactory results with /timer.

Exemple: /haddz HASH ITEM N

Code:
alias haddz {
  hadd -z $1-
  .timerhaddz $+ $ticks $+ $rand(111,999) 1 $3 unsethash $1-2
}
alias unsethash {
  if ($hget($1,$2)) .timerhaddz $+ $ticks $+ $rand(111,999) 1 $v1 unsethash $1-2
  else {
    ; Unseted hash item
    echo -s unset item $2 on hash $1
  }
}
© mIRC Discussion Forums