notification.qsrc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # notification
  2. if $ARGS[0] = 'counter':
  3. !! DEBUG:
  4. !!'<<$notification_message[0]>>; <<notification_shown[0]>>; <<_n_timer>>'
  5. if $notification_message[0] ! '' and notification_shown[0] = 1: _n_timer += 1
  6. if _n_timer > 5:
  7. gs 'notification', 'update_display'
  8. killvar '$notification_message', 0
  9. killvar 'notification_shown', 0
  10. _n_timer = 0
  11. end
  12. end
  13. if $ARGS[0] = 'update_display':
  14. if $notification_message[1] ! '':
  15. $stat_msg = replace($stat_msg, $notification_message[0], $notification_message[1])
  16. notification_shown[1] = 1
  17. else
  18. $stat_msg = replace($stat_msg, $notification_message[0])
  19. end
  20. clr & pl '<<$stat_msg>>'
  21. end
  22. !! adds a notification to the queue
  23. !! message string can contain html tags like format or maybe even links
  24. !! i think links should work, or an image with link embedded in it
  25. !! theoretically all the techniques used in stat_display should work
  26. !! use: gs 'notification', 'add', 'message string'
  27. if $ARGS[0] = 'add':
  28. $temp_notification_message = '<table><tr><td><<$ARGS[1]>></td></tr></table>'
  29. $notification_message[] = $temp_notification_message
  30. $notification_log[] = '<<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>> <<day>><<$date_suffix>> <<$month>> <<year>>'+$temp_notification_message
  31. killvar '$temp_notification_message'
  32. if arrsize('$notification_log') > 30: killvar '$notification_log', 0
  33. end
  34. --- notification ---------------------------------