The clean mirc didn't crashed so far.

So I made some changes on my lagbar script, and it seems that 1 single line solved the problem

I added the line clear @lag.win

this is my lagbar script, it executes every 10 seconds to refresh @lag.win and maybe the /drawpic was eating the memory after some hours.
So I added the /clear in the cicle to keep the @lag.win with low buffer, and it seems to have worked

Code
alias lag.small {
  if ($hget(txlag,curlag) == ......) && ($1 != ✖) { var %cor.em 32764 }
  elseif ($hget(txlag,curlag) < 0.22) && ($1 != ✖) { var %lem 1 | var %cor.em 777777 }
  elseif ($hget(txlag,curlag) >= 0.22) && ($hget(txlag,curlag) < 0.5) && ($1 != ✖) { var %lem 2 | var %cor.em 65458 }
  elseif ($hget(txlag,curlag) >= 0.5) && ($hget(txlag,curlag) < 0.75) && ($1 != ✖) { var %lem 3 | var %cor.em 65535 }
  elseif ($hget(txlag,curlag) >= 0.75) && ($hget(txlag,curlag) < 1) && ($1 != ✖) { var %lem 4 | var %cor.em 32764 }
  elseif ($hget(txlag,curlag) >= 1) && ($1 != ✖) { var %lem 5 | var %cor.em 255 }
  if ($1 == ✖) || (!$server) { var %cor.em 255 | var %lem off }
  if ($1 == ✔) { var %cor.em 777777 | var %lem on }
  if ($1 == ➠) { var %cor.em 16757849 | var %lem ing }
  if ($1 == 🔵) { var %cor.em 16757849 | var %lem gre }
  var %l = $hget(txlag,curlag),%t =    Lag: $lag.isms($hget(txlag,curlag))

  clear @lag.win

  drawrect -nrf @lag.win $iif(%tema == claro,$lag.face,2631720) 1 0 0 335 26
  if ($server) {
    drawtext -nr @lag.win $color(%lagtema) %fonte $iif($dbuh == 2.5,-10,-14) $int($calc((269 - $width(    Lag: ......, %fonte, $iif($dbuh == 2.5,-17,-25))) / 2)) 0 $iif(!$2,%t,$2)
    drawpic -t @lag.win 0 0 -2 $+(lagbar\lag,%lem,.gif)
    /toolbar -pt Away "💤 Away $iif(%away.barra = on,(você está away),(você está disponível)) $+ " $iif(%away.barra = on,sistema\imagens\away2.ico,sistema\imagens\away1.ico) "/abriraway" @Away
  }
  else {
    drawtext -nr @lag.win $color(%lagtema) %fonte $iif($dbuh == 2.5,-10,-14) $int($calc((269 - $width(    Lag: ......, %fonte, $iif($dbuh == 2.5,-17,-25))) / 2)) 0 $iif(!$2,    Desconectado,$2)
    drawpic -t @lag.win 0 0 -2 $+(lagbar\lag,%lem,.gif)
    /toolbar -pt Away "💤 Away (você está desconectado)" sistema\imagens\away3.ico "/abriraway" @Away
  }
  drawrect $+(-nr,$lag.oval) @lag.win $color(%lagtema) 1 174 3 105 17
  drawrect $+(-nrf,$lag.oval) @lag.win %cor.em 1 176 5 $iif(%l > 1,$iif(%l != ......,101,0),$int($calc(%l * 100))) 13
  drawdot @lag.win
}

edit:
it just crashed a few time after my commentary lol

I made another modification on my code and will keep testing

Code
alias lag.small {
  if ($hget(txlag,curlag) == ......) && ($1 != ✖) { var %cor.em 32764 }
  elseif ($hget(txlag,curlag) < 0.22) && ($1 != ✖) { var %lem 1 | var %cor.em 777777 }
  elseif ($hget(txlag,curlag) >= 0.22) && ($hget(txlag,curlag) < 0.5) && ($1 != ✖) { var %lem 2 | var %cor.em 65458 }
  elseif ($hget(txlag,curlag) >= 0.5) && ($hget(txlag,curlag) < 0.75) && ($1 != ✖) { var %lem 3 | var %cor.em 65535 }
  elseif ($hget(txlag,curlag) >= 0.75) && ($hget(txlag,curlag) < 1) && ($1 != ✖) { var %lem 4 | var %cor.em 32764 }
  elseif ($hget(txlag,curlag) >= 1) && ($1 != ✖) { var %lem 5 | var %cor.em 255 }
  if ($1 == ✖) || (!$server) { var %cor.em 255 | var %lem off }
  if ($1 == ✔) { var %cor.em 777777 | var %lem on }
  if ($1 == ➠) { var %cor.em 16757849 | var %lem ing }
  if ($1 == 🔵) { var %cor.em 16757849 | var %lem gre }
  var %l = $hget(txlag,curlag),%t =    Lag: $lag.isms($hget(txlag,curlag))

  clear @lag.win

  drawrect -nrf @lag.win $iif(%tema == claro,$lag.face,2631720) 1 0 0 335 26
  if ($server) {
    drawtext -nr @lag.win $color(%lagtema) %fonte $iif($dbuh == 2.5,-10,-14) $int($calc((269 - $width(    Lag: ......, %fonte, $iif($dbuh == 2.5,-17,-25))) / 2)) 0 $iif(!$2,%t,$2)
    drawpic -t @lag.win 0 0 -2 $+(lagbar\lag,%lem,.gif)
    if (%away.barra = on) /toolbar -ptlo Away "💤 Away (você está away)" sistema\imagens\away2.ico "/abriraway" @Away
    if (%away.barra = off) /toolbar -ptlo Away "💤 Away (você está disponível)" sistema\imagens\away1.ico "/abriraway" @Away
  }
  else {
    drawtext -nr @lag.win $color(%lagtema) %fonte $iif($dbuh == 2.5,-10,-14) $int($calc((269 - $width(    Lag: ......, %fonte, $iif($dbuh == 2.5,-17,-25))) / 2)) 0 $iif(!$2,    Desconectado,$2)
    drawpic -t @lag.win 0 0 -2 $+(lagbar\lag,%lem,.gif)
    /toolbar -ptlo Away "💤 Away (você está desconectado)" sistema\imagens\away3.ico "/abriraway" @Away
  }
  drawrect $+(-nr,$lag.oval) @lag.win $color(%lagtema) 1 174 3 105 17
  drawrect $+(-nrf,$lag.oval) @lag.win %cor.em 1 176 5 $iif(%l > 1,$iif(%l != ......,101,0),$int($calc(%l * 100))) 13
  drawdot @lag.win
}

edit2:
I just saw this on help file
Quote
The -c switch indicates that the bitmap should be cached. This greatly speeds up subsequent references to this bitmap. If you specify -c and the bitmap is already in the cache, it is loaded and used from the cache, otherwise it is reloaded from the file. You can clear the entire cache with /drawpic -c.

so I included a -c on the drawpic, and will test now

Last edited by Piratoshi; 03/09/23 12:09 PM. Reason: testing drawpic -c