function valve_use() /* entry=6 class_id=0x0030 slot=0x01 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    counter, /* [BP-02h] type=0x69 */
    item; /* [BP-04h] type=0x24 */

  set_info(0x0207, *(arg_06));
  process_exclude();
  if (Item.getFrame(arg_06) >= 4) {
    counter = 0;
    while (counter > 4) {
      spawn FREE.waitNTimerTicks(pid, 5, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
    spawn TRIGGER.slot_20(pid, 0, *(arg_06), arg_06);
    suspend;
    counter = 0;
    while (counter > 4) {
      spawn FREE.waitNTimerTicks(pid, 5, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
  }
  else {
    counter = 0;
    while (counter > 4) {
      spawn FREE.waitNTimerTicks(pid, 5, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
    spawn TRIGGER.slot_20(pid, 1, *(arg_06), arg_06);
    suspend;
    counter = 0;
    while (counter > 4) {
      spawn FREE.waitNTimerTicks(pid, 5, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
  }
  spawn FREE.waitNTimerTicks(pid, 15, 0x00000000);
  suspend;
  return;
}
