DoctorD90

ErrorReporter.tcl 1.0.0

May 6th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 2.07 KB | None | 0 0
  1. ### ErrorReporter.tcl 1.0.0 MDL5RT8X
  2.  
  3. #SUGGESTED
  4. # PBinSrc.tcl fMrtKqyq
  5. # TCLLoader.tcl smApj15u
  6.  
  7. #LICENSE
  8. # Copyright © 2013 Alberto Dietze "DoctorD90"
  9. #
  10. #    This program is free software: you can redistribute it and/or modify
  11. #    it under the terms of the GNU General Public License as published by
  12. #    the Free Software Foundation, either version 3 of the License, or
  13. #    (at your option) any later version.
  14. #
  15. #    This program is distributed in the hope that it will be useful,
  16. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. #    GNU General Public License for more details.
  19. #
  20. #    You should have received a copy of the GNU General Public License
  21. #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  22. #
  23. # Full GPLv3 Text: http://www.gnu.org/licenses/gpl.txt
  24.  
  25. #PATERNITY
  26. #Coder: DoctorD90
  27. #Network: irc.OnlineGamesNet.net
  28. #Chan: #eHito
  29. #Script's List: www.EggTcl.tk
  30. #
  31. #Thanks to guys on #egghelp on irc.freenode.net
  32. #Special thanks to Thommey and Speechles
  33.  
  34. #PURPOSE
  35. #Get error from irc instead of partyline.
  36.  
  37. #USAGE
  38. #Use commands that you set in SETTINGS section.
  39.  
  40. #SETTINGS
  41. #Set flag of people can use public command.
  42. set errrep(pflag) "n"
  43. #Set flag of people can use query command.
  44. set errrep(qflag) "n"
  45. #Set public command to get last error.
  46. set errrep(psee) ".err"
  47. #Set query command to get last error.
  48. set errrep(qsee) ".err"
  49.  
  50.  
  51. ### DON'T EDIT ANYTHING BELOW ###
  52.  
  53. bind pub $errrep(pflag) $errrep(psee) pub_errget
  54. proc pub_errget {nick uhost hand text} {
  55.   err_get $nick
  56. }
  57.  
  58. bind msg $errrep(qflag) $errrep(qsee) msg_errget
  59. proc msg_errget {nick uhost hand text} {
  60.   err_get $nick
  61. }
  62.  
  63. proc err_get {nick} {
  64.   if {![info exists ::errorInfo]} {
  65.     putserv "PRIVMSG $nick :There is not error, yet."
  66.   } else {
  67.     foreach line [split $::errorInfo \n] {
  68.       putserv "PRIVMSG $nick :$line"
  69.     }
  70.     putserv "PRIVMSG $nick :*END*"
  71.     unset ::errorInfo
  72.   }
  73. }
  74.  
  75. ###
  76. putlog "ErrorReporter.tcl LOADED"
Advertisement