Paste Search Dynamic
Recent pastes
hltv
  1. #This program is free software; you can redistribute it and/or modify
  2. #it under the terms of the GNU General Public License as published by
  3. #the Free Software Foundation; either version 2 of the License, or
  4. #(at your option) any later version.
  5. #This program is distributed in the hope that it will be useful,
  6. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  8. #GNU General Public License for more details.
  9. #http://www.gnu.org/licenses/gpl.txt
  10.  
  11. ####################################################################
  12. ####                                                                                                                    ####
  13. ####                                                                                                                    ####
  14. ####            HLTV SCRIPT FOR #CS.GATHER.PT by tega (tYPe-R-)         ####
  15. ####               (based on the original hltv.tcl by Arie)                     ####
  16. ####                                                                                                                    ####
  17. ####                                                                                                                    ####
  18. ####################################################################
  19.  
  20. #Variables
  21.  
  22. #HLTV channel, ops in that channel are allowed to control the bot
  23. set hltv_channel "#cs.gather.uk.admin"
  24. #Text that has to prefix all commands
  25. set hltv_command "!hltv"
  26. #Space seperated list of available HLTV screens
  27. #(Screens not used at the moment .57 .58 .59 .60 .3)
  28.  
  29. set hltv_screens {.vg1 .vg2 .vg3 .gd1 .gd2 .gd3}
  30.  
  31. #DON'T EDIT BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING
  32.  
  33. #Bind !hltv command
  34. bind pub - $hltv_command hltv_main
  35.  
  36. #Define method that does all the exciting stuff
  37. proc hltv_main { nick uhost hand chan args } {
  38.         global hltv_channel hltv_command hltv_screens
  39.         set args [join $args]
  40.        
  41.         #Check if user is opped in $hltv_channel
  42.         set hltv_hasaccess 0
  43.         if {[isop $nick $hltv_channel]} {
  44.                 #if opped, set access variable to one
  45.                 set hltv_hasaccess 1   
  46.         }
  47. #Exceptions for other eggdrops that use the same tcl with the same bind 
  48.        
  49.         #If you want allow another channel's ops to control the bot, uncomment the following bit:
  50.        
  51.        
  52.        
  53.        
  54.         if {[isop $nick #gather.support]} {
  55.                 set hltv_hasaccess 1
  56.         }
  57.  
  58.         #exit if user doesn't have ops in correct channel
  59.         if {$hltv_hasaccess!=1} { return 0 }
  60.  
  61.         #If user hasn't given any arguments, send notice with info
  62.         if {[lindex $args 0]==""} {
  63.                 putquick "NOTICE $nick :�02�0314,01[�0307«�02�0300 To check the commands list: �02$hltv_command commands �0307»�0314]"
  64.                 return 0
  65.         }
  66.  
  67.                 if {[lindex $args 0]==".ext1"} {
  68. return 0
  69. }       
  70.        
  71.  
  72.         if {[lindex $args 0]=="commands"} {
  73.         #Show user possible commands if he asks for it
  74.                                 putquick "NOTICE $nick :�02�0314,01[�0307«�02�0300 Command list: �0307»�0314]"
  75.                                 putquick "NOTICE $nick :�02�0301$hltv_command stat�02  Show the basic status for all HLTV's. e.g.: �37�0307!hltv stat�37�03"
  76.                                 putquick "NOTICE $nick :�02�0301$hltv_command status�02 Show the full status for all HLTV's. e.g.: �37�0307!hltv status�37�03"
  77.                                 putquick "NOTICE $nick :�02�0301$hltv_command <.servernumber> status�02 Show the status for the specified proxy. e.g.: �37�0307!hltv .vg1 status�37�03"
  78.                                 putquick "NOTICE $nick :�02�0301$hltv_command <.servernumber> connect <password> <matchid> �02 Connect the HLTV to the specified proxy and start's recording (use the matchid without the "#" symbol JUST THE NUMBER). e.g.: �37�0307!hltv .vg1 connect pass123 1012345�37�03"
  79.                                 putquick "NOTICE $nick :�02�0301$hltv_command <.servernumber> stop�02 (�0304NOT NEEDED, only if it needs a manual stop�0301) Stops recording and disconnects the hltv from the server. e.g.: �37�0307!hltv .vg1 stop�37�03"
  80.                                 putquick "NOTICE $nick :�02�0301$hltv_command <.servernumber> free�02 Forces HLTV exit. Use only if hltv didn't exit the server, e.g.: �37�0307!hltv .vg1 free�37�03"
  81.                return 0       
  82.         }
  83.  
  84.         if {[lindex $args 0]=="stat"} {
  85.                 set hltv_next 0
  86.                 set hltv_lastline ""
  87.                 set hltv_usedlist ""
  88.                 set hltv_freelist ""
  89.                 #Tell channel were command was used what we're doing.
  90.                 putquick "PRIVMSG $chan :�02�0314,01[�0307«�02�0300 Processing HLTV's status... �02�0307»�0314]"
  91.  
  92.                 while {[lindex $hltv_screens $hltv_next]!=""} {
  93.                         set hltv_statusname [lindex $hltv_screens $hltv_next]
  94.                         set hltv_next [expr $hltv_next + 1]
  95.                         #Send status check command
  96.                         if {[file exists /tmp/$hltv_statusname]} { exec rm /tmp/$hltv_statusname }
  97.                         #Ask HLTV for its status
  98.                         exec screen -S $hltv_statusname -X stuff "status
  99. "
  100.                         #Delete old file
  101.                         #Write the info in the screen to a temp file
  102.                         sleep 500
  103.                         exec screen -S $hltv_statusname -X hardcopy /tmp/$hltv_statusname
  104.                         sleep 500
  105.                         #Reading tmp file into eggdrop
  106.                         set fs [open /tmp/$hltv_statusname r]
  107.                         while {![eof $fs]} {
  108.                         gets $fs line
  109.                         if {[string match *Connected* $line]} { set hltv_lastline $hltv_statusname }
  110.                         if {[string match *Not*connected* $line]} { set hltv_lastline ""}
  111.                         if {[string match *,*Players* $line]} { set hltv_players [string rang $line [expr [string length $line] - 2] [expr [string length $line] - 1]] }
  112.                         }
  113.                         close $fs
  114.                         if {$hltv_lastline!=""} {
  115.                         if {$hltv_players!=""} { set hltv_usedlist "$hltv_usedlist�0300 $hltv_statusname (�0304BUSY: [expr $hltv_players - 1] players�0300)�0300" }
  116.                         if {$hltv_players==""} { set hltv_usedlist "hltv_usedlist $hltv_statusname (0)" }
  117.                         }                              
  118.                         if {$hltv_lastline==""} { set hltv_freelist "$hltv_freelist�0300 $hltv_statusname (�0303FREE�0300)�0300" }
  119.                         set hltv_lastline ""
  120.                         }
  121.                         putquick "PRIVMSG $chan :�02�0314,01[�0307«�0300 Channel HLTV's:�02 $hltv_usedlist $hltv_freelist  �02�0307»�0314]"
  122.                         return 0
  123.         }
  124.         if {[lindex $args 0]=="status"} {
  125.                 set hltv_next 0
  126.                 set hltv_lastline ""
  127.                 while {[lindex $hltv_screens $hltv_next]!=""} {
  128.                         set hltv_statusname [lindex $hltv_screens $hltv_next]
  129.                         set hltv_next [expr $hltv_next + 1]
  130.                         #Send status check command
  131.                         if {[file exists /tmp/$hltv_statusname]} { exec rm /tmp/$hltv_statusname }
  132.                         #Ask HLTV for its status
  133.                         exec screen -S $hltv_statusname -X stuff "status
  134. "
  135.                         #Delete old file
  136.                         #Write the info in the screen to a temp file
  137.                         sleep 500
  138.                         exec screen -S $hltv_statusname -X hardcopy /tmp/$hltv_statusname
  139.                         sleep 500
  140.                         #Reading tmp file into eggdrop
  141.                         set fs [open /tmp/$hltv_statusname r]
  142.                         while {![eof $fs]} {
  143.                                 gets $fs line
  144.                                 if {[string match *Connected* $line]} { set hltv_lastline $line }
  145.                                 if {[string match *Name* $line]} { set hltv_lastname $line }
  146.                                 if {[string match *Not*connected* $line]} { set hltv_lastline ""}
  147.                                 if {[string match *,*Players* $line]} { set hltv_players [string rang $line [expr [string length $line] - 2] [expr [string length $line] - 1]] }}
  148.                         close $fs
  149.                         if {$hltv_lastline!=""} {
  150.                         if {$hltv_players!=""} { putquick "PRIVMSG $chan :�02�0314,01[�0307«�0300�02 HLTV status:�02 $hltv_statusname �02 $hltv_lastline, $hltv_lastname, players: [expr $hltv_players - 1] �02�0307»�0314]" }
  151.                         if {$hltv_players==""} { putquick "PRIVMSG $chan :�02�0314,01[�0307«�0300�02 HLTV status:�02 $hltv_statusname �02 $hltv_lastline, $hltv_lastname �02�0307»�0314]" }
  152.                         }
  153.                         if {$hltv_lastline==""} { putquick "PRIVMSG $chan :�02�0314,01[�0307«�0300�02 HLTV status: �02 $hltv_statusname �02 is not connected to any server. �02�0307»�0314]" }
  154.                         set hltv_lastline ""
  155.                 }
  156.                 return 0
  157.         }
  158.        
  159.         set hltv_name ""
  160.         set hltv_next 0
  161.         while {[lindex $hltv_screens $hltv_next]!=""} {
  162.                 set hltv_tempname [lindex $hltv_screens $hltv_next]
  163.                 set hltv_next [expr $hltv_next + 1]
  164.                 if {$hltv_tempname==[lindex $args 0]} { set hltv_name $hltv_tempname }
  165.         }
  166.  
  167.                 if {[lindex $args 0]=="demos"} {
  168.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 $nick tens agora acesso à pagina de admin das demos, usa o login e a password que te deram aqui:�02�0307 http://gather.tegarte.com/hltv »�0314]"
  169.                         sleep 500
  170.                         exec chmod -R 7777 /home/gather/www/demos/
  171.                         sleep 500
  172.                 return 0
  173.         }
  174.  
  175.  
  176. #####################################################################
  177. #                                                                                                                                       #
  178. #       Old way of showing score from a gather on the gather channel    #
  179. #               Not used anymore after !live was implemented                            #
  180. #                                                                                                                                       #
  181. #####################################################################
  182.         # if {[lindex $args 0]=="score"} {
  183.                 # set hltv_next 0
  184.                 # set hltv_lastline ""
  185.                 # set hltv_usedlist ""
  186.                 # set hltv_freelist ""
  187.                 # Tell channel were command was used what we're doing.
  188.                 # while {[lindex $hltv_screens $hltv_next]!=""} {
  189.                         # set hltv_statusname [lindex $hltv_screens $hltv_next]
  190.                         # set hltv_next [expr $hltv_next + 1]
  191.                         # Send status check command
  192.                         # if {[file exists /tmp/$hltv_statusname]} { exec rm /tmp/$hltv_statusname }
  193.                         # Ask HLTV for its status
  194.                         # exec screen -S $hltv_statusname -X stuff "status
  195. # "
  196.                         # sleep 500
  197.                         # exec screen -S $hltv_statusname -X stuff "say .score
  198. # "
  199.                         # Delete old file
  200.                         # Write the info in the screen to a temp file
  201.                         # sleep 500
  202.                         # exec screen -S $hltv_statusname -X hardcopy /tmp/$hltv_statusname
  203.                         # sleep 500
  204.                         # Reading tmp file into eggdrop
  205.                         # set fs [open /tmp/$hltv_statusname r]
  206.                         # while {![eof $fs]} {
  207.                         # gets $fs line
  208.                         # if {[string match *Connected* $line]} { set hltv_lastline $hltv_statusname }
  209.                         # if {[string match *Not*connected* $line]} { set hltv_lastline ""}
  210.                         # if {[string match *,*Players* $line]} { set hltv_players [string rang $line [expr [string length $line] - 2] [expr [string length $line] - 1]] }
  211.                         # }
  212.                         # close $fs
  213.                         # if {$hltv_lastline!=""} {
  214.                         # if {$hltv_players!=""} { set hltv_usedlist "$hltv_usedlist $hltv_statusname (TESTE RESULTADO)" }
  215.                         # if {$hltv_players==""} { set hltv_usedlist "hltv_usedlist $hltv_statusname (NOT LIVE)" }
  216.                         # }                            
  217.                         # if {$hltv_lastline==""} { set hltv_freelist "$hltv_freelist $hltv_statusname (FREE)" }
  218.                         # set hltv_lastline ""
  219.                         # }
  220.                         # putquick "PRIVMSG $chan :�02�0314,01[�0307«�0300 Servidores do canal: �02�0304 $hltv_usedlist  $hltv_freelist �02�0307»�0314]"
  221.                         # return 0
  222.         # }
  223.                        
  224.                
  225.         #If hltv_name is not specified, return this error message
  226.         if {$hltv_name==""} {
  227.                 putquick "PRIVMSG $chan :�02�0314,01[�0307«�0304 ERROR�02�0300: There is no HLTV command: '[lindex $args 0]'. If you need, please do �0307�02!hltv commands �02�0300 to check the commands list. �02�0307»�0314]"
  228.                 return 0
  229.         }
  230.  
  231.         if {[lindex $args 1]=="connect"} {
  232.                 if {[lindex $args 2]==""} {
  233.                         #User forgot PASSWORD
  234.                         putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 ERROR�02�0300: You forgot to put the password! The command is �0307�02!hltv <.servernumber> connect <password> <matchid> »�0314]"
  235.                         return 0
  236.                 }
  237.                                 if {[lindex $args 3]==""} {
  238.                         #User forgot IP:PORT PASSW
  239.                         putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 ERROR�02�0300: You forgot to put the matchid! The command is �02!hltv <.servernumber> connect <password> <matchid> �0307»�0314]"
  240.                         return 0
  241.                 }
  242.                 if {![isnumber [lindex $args 3]]} {
  243.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 ERROR�02�0300: You should use only the numbers for the matchid, use the matchid provided by CS-Gather-UK without the �02#�02 symbol �02�0307»�0314]"
  244.                 return 0
  245.                 }
  246.       if {[lindex $args 3] < 1000000} {
  247.                  putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 ERROR�02�0300: The matchid is not in the correct format. MATCHID, is a �02 7�02 digits number �02�0307»�0314]"
  248.                  return 0
  249.                  }
  250.                  
  251.                 if {[lindex $args 3] > 9999999} {
  252.                  putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 ERROR�02�0300: The matchid is not in the correct format. MATCHID, is a �02 7�02 digits number �02�0307»�0314]"
  253.                  return 0
  254.                  }
  255.                                 if {$hltv_name==".vg1"} {
  256.                 set hltv_lastline ""
  257.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  258.                 #Ask HLTV for its status
  259.                 exec screen -S $hltv_name -X stuff "status
  260. "
  261.                 #Write the info in the screen to a temp file
  262.                 sleep 500
  263.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  264.                 sleep 500
  265.                 #Reading tmp file into eggdrop
  266.                 set fs [open /tmp/$hltv_name r]
  267.                 while {![eof $fs]} {
  268.                         gets $fs line
  269.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  270.                         if {[string match *Recording* $line]} {set hltv_lastline $line}
  271.                 }
  272.                 close $fs
  273.                 if {$hltv_lastline!=""} {
  274.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV �02 $hltv_name �02 already had received order to go to the server, please make sure you got the server number, password and/or matchid correct. �02�0307»�0314]"
  275.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 If you are sure that all data is correct, you can use �02!hltv $hltv_name free�02 to free the HLTV from the server."
  276.                 return 0
  277.                 }
  278.                 if {$hltv_lastline==""} {
  279.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Connecting HLTV to the server with the ip�02 77.111.217.17:27015 �02and password�02 [lindex $args 2] �02Wait a moment for the recording to start �0307»�0314]"
  280.                 exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  281. "
  282. sleep 500
  283.                 exec screen -S $hltv_name -X stuff "connect 77.111.217.17:27015
  284. "
  285. sleep 5000
  286.  
  287.                 set hltv_lastline ""
  288.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  289.                 #Ask HLTV for its status
  290.                 exec screen -S $hltv_name -X stuff "status
  291. "
  292.                 #Write the info in the screen to a temp file
  293.                 sleep 500
  294.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  295.                 sleep 500
  296.                 #Reading tmp file into eggdrop
  297.                 set fs [open /tmp/$hltv_name r]
  298.                 while {![eof $fs]} {
  299.                         gets $fs line
  300.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  301.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  302.                 }
  303.                 if {$hltv_lastline==""} {
  304.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV�02 '$hltv_name' �02didn't join the server, please make sure the password is correct. �02�0307»�0314]"
  305.                 }
  306.                 if {$hltv_lastline!=""} {
  307. sleep 500
  308.                 exec screen -S $hltv_name -X stuff "stoprecording
  309. "
  310. sleep 500
  311.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Connected!�02�0300 Recording for the matchid:�02 [lindex $args 3] �02was initiated on the HLTV:�02 '$hltv_name' �0307»�0314]"
  312.                 exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  313. "
  314. sleep 500
  315. }
  316.         }
  317.         }
  318.                                 if {$hltv_name==".vg2"} {
  319.                 set hltv_lastline ""
  320.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  321.                 #Ask HLTV for its status
  322.                 exec screen -S $hltv_name -X stuff "status
  323. "
  324.                 #Write the info in the screen to a temp file
  325.                 sleep 500
  326.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  327.                 sleep 500
  328.                 #Reading tmp file into eggdrop
  329.                 set fs [open /tmp/$hltv_name r]
  330.                 while {![eof $fs]} {
  331.                         gets $fs line
  332.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  333.                         if {[string match *Recording* $line]} {set hltv_lastline $line}
  334.                 }
  335.                 close $fs
  336.                 if {$hltv_lastline!=""} {
  337.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV �02 $hltv_name �02 already had received order to go to the server, please make sure you got the server number, password and/or matchid correct. �02�0307»�0314]"
  338.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 If you are sure that all data is correct, you can use �02!hltv $hltv_name free�02 to free the HLTV from the server."
  339.                 return 0
  340.                 }
  341.                 if {$hltv_lastline==""} {
  342.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Connecting HLTV to the server with the ip�02 77.111.217.18:27015 �02and password�02 [lindex $args 2] �02Wait a moment for the recording to start �0307»�0314]"
  343.                 exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  344. "
  345. sleep 500
  346.                 exec screen -S $hltv_name -X stuff "connect 77.111.217.18:27015
  347. "
  348. sleep 5000
  349.  
  350.                 set hltv_lastline ""
  351.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  352.                 #Ask HLTV for its status
  353.                 exec screen -S $hltv_name -X stuff "status
  354. "
  355.                 #Write the info in the screen to a temp file
  356.                 sleep 500
  357.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  358.                 sleep 500
  359.                 #Reading tmp file into eggdrop
  360.                 set fs [open /tmp/$hltv_name r]
  361.                 while {![eof $fs]} {
  362.                         gets $fs line
  363.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  364.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  365.                 }
  366.                 if {$hltv_lastline==""} {
  367.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV�02 '$hltv_name' �02didn't join the server, please make sure the password is correct. �02�0307»�0314]"
  368.                 }
  369.                 if {$hltv_lastline!=""} {
  370. sleep 500
  371.                 exec screen -S $hltv_name -X stuff "stoprecording
  372. "
  373. sleep 500
  374.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Connected!�02�0300 Recording for the matchid:�02 [lindex $args 3] �02was initiated on the HLTV:�02 '$hltv_name' �0307»�0314]"
  375.                 exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  376. "
  377. sleep 500
  378. }
  379.         }
  380.         }
  381.                                         if {$hltv_name==".vg3"} {
  382.                 set hltv_lastline ""
  383.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  384.                 #Ask HLTV for its status
  385.                 exec screen -S $hltv_name -X stuff "status
  386. "
  387.                 #Write the info in the screen to a temp file
  388.                 sleep 500
  389.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  390.                 sleep 500
  391.                 #Reading tmp file into eggdrop
  392.                 set fs [open /tmp/$hltv_name r]
  393.                 while {![eof $fs]} {
  394.                         gets $fs line
  395.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  396.                         if {[string match *Recording* $line]} {set hltv_lastline $line}
  397.                 }
  398.                 close $fs
  399.                 if {$hltv_lastline!=""} {
  400.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV �02 $hltv_name �02 already had received order to go to the server, please make sure you got the server number, password and/or matchid correct. �02�0307»�0314]"
  401.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 If you are sure that all data is correct, you can use �02!hltv $hltv_name free�02 to free the HLTV from the server."
  402.                 return 0
  403.                 }
  404.                 if {$hltv_lastline==""} {
  405.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Connecting HLTV to the server with the ip�02 77.111.217.19:27015 �02and password�02 [lindex $args 2] �02Wait a moment for the recording to start �0307»�0314]"
  406.                 exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  407. "
  408. sleep 500
  409.                 exec screen -S $hltv_name -X stuff "connect 77.111.217.19:27015
  410. "
  411. sleep 5000
  412.  
  413.                 set hltv_lastline ""
  414.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  415.                 #Ask HLTV for its status
  416.                 exec screen -S $hltv_name -X stuff "status
  417. "
  418.                 #Write the info in the screen to a temp file
  419.                 sleep 500
  420.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  421.                 sleep 500
  422.                 #Reading tmp file into eggdrop
  423.                 set fs [open /tmp/$hltv_name r]
  424.                 while {![eof $fs]} {
  425.                         gets $fs line
  426.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  427.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  428.                 }
  429.                 if {$hltv_lastline==""} {
  430.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV�02 '$hltv_name' �02didn't join the server, please make sure the password is correct. �02�0307»�0314]"
  431.                 }
  432.                 if {$hltv_lastline!=""} {
  433. sleep 500
  434.                 exec screen -S $hltv_name -X stuff "stoprecording
  435. "
  436. sleep 500
  437.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Connected!�02�0300 Recording for the matchid:�02 [lindex $args 3] �02was initiated on the HLTV:�02 '$hltv_name' �0307»�0314]"
  438.                 exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  439. "
  440. sleep 500
  441. }
  442.         }
  443.         }
  444.                                                 if {$hltv_name==".gd1"} {
  445.                 set hltv_lastline ""
  446.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  447.                 #Ask HLTV for its status
  448.                 exec screen -S $hltv_name -X stuff "status
  449. "
  450.                 #Write the info in the screen to a temp file
  451.                 sleep 500
  452.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  453.                 sleep 500
  454.                 #Reading tmp file into eggdrop
  455.                 set fs [open /tmp/$hltv_name r]
  456.                 while {![eof $fs]} {
  457.                         gets $fs line
  458.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  459.                         if {[string match *Recording* $line]} {set hltv_lastline $line}
  460.                 }
  461.                 close $fs
  462.                 if {$hltv_lastline!=""} {
  463.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV �02 $hltv_name �02 already had received order to go to the server, please make sure you got the server number, password and/or matchid correct. �02�0307»�0314]"
  464.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 If you are sure that all data is correct, you can use �02!hltv $hltv_name free�02 to free the HLTV from the server."
  465.                 return 0
  466.                 }
  467.                 if {$hltv_lastline==""} {
  468.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Connecting HLTV to the server with the ip�02 81.19.210.22:27015 �02and password�02 [lindex $args 2] �02Wait a moment for the recording to start �0307»�0314]"
  469.                 exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  470. "
  471. sleep 500
  472.                 exec screen -S $hltv_name -X stuff "connect 81.19.210.22:27015
  473. "
  474. sleep 5000
  475.  
  476.                 set hltv_lastline ""
  477.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  478.                 #Ask HLTV for its status
  479.                 exec screen -S $hltv_name -X stuff "status
  480. "
  481.                 #Write the info in the screen to a temp file
  482.                 sleep 500
  483.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  484.                 sleep 500
  485.                 #Reading tmp file into eggdrop
  486.                 set fs [open /tmp/$hltv_name r]
  487.                 while {![eof $fs]} {
  488.                         gets $fs line
  489.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  490.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  491.                 }
  492.                 if {$hltv_lastline==""} {
  493.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV�02 '$hltv_name' �02didn't join the server, please make sure the password is correct. �02�0307»�0314]"
  494.                 }
  495.                 if {$hltv_lastline!=""} {
  496. sleep 500
  497.                 exec screen -S $hltv_name -X stuff "stoprecording
  498. "
  499. sleep 500
  500.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Connected!�02�0300 Recording for the matchid:�02 [lindex $args 3] �02was initiated on the HLTV:�02 '$hltv_name' �0307»�0314]"
  501.                 exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  502. "
  503. sleep 500
  504. }
  505.         }
  506.         }
  507.                                                 if {$hltv_name==".gd2"} {
  508.                 set hltv_lastline ""
  509.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  510.                 #Ask HLTV for its status
  511.                 exec screen -S $hltv_name -X stuff "status
  512. "
  513.                 #Write the info in the screen to a temp file
  514.                 sleep 500
  515.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  516.                 sleep 500
  517.                 #Reading tmp file into eggdrop
  518.                 set fs [open /tmp/$hltv_name r]
  519.                 while {![eof $fs]} {
  520.                         gets $fs line
  521.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  522.                         if {[string match *Recording* $line]} {set hltv_lastline $line}
  523.                 }
  524.                 close $fs
  525.                 if {$hltv_lastline!=""} {
  526.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV �02 $hltv_name �02 already had received order to go to the server, please make sure you got the server number, password and/or matchid correct. �02�0307»�0314]"
  527.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 If you are sure that all data is correct, you can use �02!hltv $hltv_name free�02 to free the HLTV from the server."
  528.                 return 0
  529.                 }
  530.                 if {$hltv_lastline==""} {
  531.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Connecting HLTV to the server with the ip�02 81.19.210.22:27025 �02and password�02 [lindex $args 2] �02Wait a moment for the recording to start �0307»�0314]"
  532.                 exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  533. "
  534. sleep 500
  535.                 exec screen -S $hltv_name -X stuff "connect 81.19.210.22:27025
  536. "
  537. sleep 5000
  538.  
  539.                 set hltv_lastline ""
  540.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  541.                 #Ask HLTV for its status
  542.                 exec screen -S $hltv_name -X stuff "status
  543. "
  544.                 #Write the info in the screen to a temp file
  545.                 sleep 500
  546.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  547.                 sleep 500
  548.                 #Reading tmp file into eggdrop
  549.                 set fs [open /tmp/$hltv_name r]
  550.                 while {![eof $fs]} {
  551.                         gets $fs line
  552.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  553.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  554.                 }
  555.                 if {$hltv_lastline==""} {
  556.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV�02 '$hltv_name' �02didn't join the server, please make sure the password is correct. �02�0307»�0314]"
  557.                 }
  558.                 if {$hltv_lastline!=""} {
  559. sleep 500
  560.                 exec screen -S $hltv_name -X stuff "stoprecording
  561. "
  562. sleep 500
  563.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Connected!�02�0300 Recording for the matchid:�02 [lindex $args 3] �02was initiated on the HLTV:�02 '$hltv_name' �0307»�0314]"
  564.                 exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  565. "
  566. sleep 500
  567. }
  568.         }
  569.         }
  570.                                                 if {$hltv_name==".gd3"} {
  571.                 set hltv_lastline ""
  572.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  573.                 #Ask HLTV for its status
  574.                 exec screen -S $hltv_name -X stuff "status
  575. "
  576.                 #Write the info in the screen to a temp file
  577.                 sleep 500
  578.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  579.                 sleep 500
  580.                 #Reading tmp file into eggdrop
  581.                 set fs [open /tmp/$hltv_name r]
  582.                 while {![eof $fs]} {
  583.                         gets $fs line
  584.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  585.                         if {[string match *Recording* $line]} {set hltv_lastline $line}
  586.                 }
  587.                 close $fs
  588.                 if {$hltv_lastline!=""} {
  589.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV �02 $hltv_name �02 already had received order to go to the server, please make sure you got the server number, password and/or matchid correct. �02�0307»�0314]"
  590.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 If you are sure that all data is correct, you can use �02!hltv $hltv_name free�02 to free the HLTV from the server."
  591.                 return 0
  592.                 }
  593.                 if {$hltv_lastline==""} {
  594.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Connecting HLTV to the server with the ip�02 81.19.210.22:27035 �02and password�02 [lindex $args 2] �02Wait a moment for the recording to start �0307»�0314]"
  595.                 exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  596. "
  597. sleep 500
  598.                 exec screen -S $hltv_name -X stuff "connect 81.19.210.22:27035
  599. "
  600. sleep 5000
  601.  
  602.                 set hltv_lastline ""
  603.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  604.                 #Ask HLTV for its status
  605.                 exec screen -S $hltv_name -X stuff "status
  606. "
  607.                 #Write the info in the screen to a temp file
  608.                 sleep 500
  609.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  610.                 sleep 500
  611.                 #Reading tmp file into eggdrop
  612.                 set fs [open /tmp/$hltv_name r]
  613.                 while {![eof $fs]} {
  614.                         gets $fs line
  615.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  616.                         if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  617.                 }
  618.                 if {$hltv_lastline==""} {
  619.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NOT CONNECTED�02�0300: HLTV�02 '$hltv_name' �02didn't join the server, please make sure the password is correct. �02�0307»�0314]"
  620.                 }
  621.                 if {$hltv_lastline!=""} {
  622. sleep 500
  623.                 exec screen -S $hltv_name -X stuff "stoprecording
  624. "
  625. sleep 500
  626.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Connected!�02�0300 Recording for the matchid:�02 [lindex $args 3] �02was initiated on the HLTV:�02 '$hltv_name' �0307»�0314]"
  627.                 exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  628. "
  629. sleep 500
  630. }
  631.         }
  632.         }
  633.                 # if {$hltv_name==".57"} {
  634.                 # set hltv_lastline ""
  635.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  636.                 # # Ask HLTV for its status
  637.                 # exec screen -S $hltv_name -X stuff "status
  638. # "
  639.                 # # Write the info in the screen to a temp file
  640.                 # sleep 500
  641.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  642.                 # sleep 500
  643.                 # # Reading tmp file into eggdrop
  644.                 # set fs [open /tmp/$hltv_name r]
  645.                 # while {![eof $fs]} {
  646.                         # gets $fs line
  647.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  648.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  649.                 # }
  650.                 # close $fs
  651.                 # if {$hltv_lastline!=""} {
  652.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  653.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  654.                 # return 0
  655.                 # }
  656.                 # if {$hltv_lastline==""} {
  657.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.33:38157 �02e a password�02 [lindex $args 2] �02Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  658.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  659. # "
  660. # sleep 500
  661.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.33:38157
  662. # "
  663. # sleep 5000
  664.  
  665.                 # set hltv_lastline ""
  666.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  667.                 # # Ask HLTV for its status
  668.                 # exec screen -S $hltv_name -X stuff "status
  669. # "
  670.                 # # Write the info in the screen to a temp file
  671.                 # sleep 500
  672.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  673.                 # sleep 500
  674.                 # # Reading tmp file into eggdrop
  675.                 # set fs [open /tmp/$hltv_name r]
  676.                 # while {![eof $fs]} {
  677.                         # gets $fs line
  678.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  679.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  680.                 # }
  681.                 # if {$hltv_lastline==""} {
  682.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV�02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  683.                 # }
  684.                 # if {$hltv_lastline!=""} {
  685. # sleep 500
  686.                 # exec screen -S $hltv_name -X stuff "stoprecording
  687. # "
  688. # sleep 500
  689.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  690.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  691. # "
  692. # sleep 500
  693. # }
  694.         # }
  695.         # }
  696.                 # if {$hltv_name==".58"} {
  697.                 # set hltv_lastline ""
  698.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  699.                 # # Ask HLTV for its status
  700.                 # exec screen -S $hltv_name -X stuff "status
  701. # "
  702.                 # # Write the info in the screen to a temp file
  703.                 # sleep 500
  704.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  705.                 # sleep 500
  706.                 # # Reading tmp file into eggdrop
  707.                 # set fs [open /tmp/$hltv_name r]
  708.                 # while {![eof $fs]} {
  709.                         # gets $fs line
  710.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  711.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  712.                 # }
  713.                 # close $fs
  714.                 # if {$hltv_lastline!=""} {
  715.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  716.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  717.                 # return 0
  718.                 # }
  719.                 # if {$hltv_lastline==""} {
  720.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.33:38158 �02e a password�02 [lindex $args 2] �02Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  721.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  722. # "
  723. # sleep 500
  724.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.33:38158
  725. # "
  726. # sleep 5000
  727.  
  728.                 # set hltv_lastline ""
  729.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  730.                 # # Ask HLTV for its status
  731.                 # exec screen -S $hltv_name -X stuff "status
  732. # "
  733.                 # # Write the info in the screen to a temp file
  734.                 # sleep 500
  735.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  736.                 # sleep 500
  737.                 # # Reading tmp file into eggdrop
  738.                 # set fs [open /tmp/$hltv_name r]
  739.                 # while {![eof $fs]} {
  740.                         # gets $fs line
  741.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  742.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  743.                 # }
  744.                 # if {$hltv_lastline==""} {
  745.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV�02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  746.                 # }
  747.                 # if {$hltv_lastline!=""} {
  748. # sleep 500
  749.                 # exec screen -S $hltv_name -X stuff "stoprecording
  750. # "
  751. # sleep 500
  752.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  753.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  754. # "
  755. # sleep 500
  756. # }
  757.         # }
  758.         # }
  759.                 # if {$hltv_name==".59"} {
  760.                 # set hltv_lastline ""
  761.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  762.                 # # Ask HLTV for its status
  763.                 # exec screen -S $hltv_name -X stuff "status
  764. # "
  765.                 # # Write the info in the screen to a temp file
  766.                 # sleep 500
  767.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  768.                 # sleep 500
  769.                 # # Reading tmp file into eggdrop
  770.                 # set fs [open /tmp/$hltv_name r]
  771.                 # while {![eof $fs]} {
  772.                         # gets $fs line
  773.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  774.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  775.                 # }
  776.                 # close $fs
  777.                 # if {$hltv_lastline!=""} {
  778.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  779.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  780.                 # return 0
  781.                 # }
  782.                 # if {$hltv_lastline==""} {
  783.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.65:38159 �02e a password�02 [lindex $args 2] �02Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  784.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  785. # "
  786. # sleep 500
  787.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.65:38159
  788. # "
  789. # sleep 5000
  790.  
  791.                 # set hltv_lastline ""
  792.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  793.                 # # Ask HLTV for its status
  794.                 # exec screen -S $hltv_name -X stuff "status
  795. # "
  796.                 # # Write the info in the screen to a temp file
  797.                 # sleep 500
  798.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  799.                 # sleep 500
  800.                 # # Reading tmp file into eggdrop
  801.                 # set fs [open /tmp/$hltv_name r]
  802.                 # while {![eof $fs]} {
  803.                         # gets $fs line
  804.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  805.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  806.                 # }
  807.                 # if {$hltv_lastline==""} {
  808.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV�02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  809.                 # }
  810.                 # if {$hltv_lastline!=""} {
  811. # sleep 500
  812.                 # exec screen -S $hltv_name -X stuff "stoprecording
  813. # "
  814. # sleep 500
  815.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  816.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  817. # "
  818. # sleep 500
  819. # }
  820.         # }
  821.         # }
  822.                 # if {$hltv_name==".60"} {
  823.                 # set hltv_lastline ""
  824.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  825.                 # # Ask HLTV for its status
  826.                 # exec screen -S $hltv_name -X stuff "status
  827. # "
  828.                 # # Write the info in the screen to a temp file
  829.                 # sleep 500
  830.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  831.                 # sleep 500
  832.                 # # Reading tmp file into eggdrop
  833.                 # set fs [open /tmp/$hltv_name r]
  834.                 # while {![eof $fs]} {
  835.                         # gets $fs line
  836.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  837.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  838.                 # }
  839.                 # close $fs
  840.                 # if {$hltv_lastline!=""} {
  841.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  842.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  843.                 # return 0
  844.                 # }
  845.                 # if {$hltv_lastline==""} {
  846.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.65:38160 �02e a password�02 [lindex $args 2] �02Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  847.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  848. # "
  849. # sleep 500
  850.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.65:38160
  851. # "
  852. # sleep 5000
  853.  
  854.                 # set hltv_lastline ""
  855.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  856.                 # # Ask HLTV for its status
  857.                 # exec screen -S $hltv_name -X stuff "status
  858. # "
  859.                 # # Write the info in the screen to a temp file
  860.                 # sleep 500
  861.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  862.                 # sleep 500
  863.                 # # Reading tmp file into eggdrop
  864.                 # set fs [open /tmp/$hltv_name r]
  865.                 # while {![eof $fs]} {
  866.                         # gets $fs line
  867.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  868.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  869.                 # }
  870.                 # if {$hltv_lastline==""} {
  871.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV�02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  872.                 # }
  873.                 # if {$hltv_lastline!=""} {
  874. # sleep 500
  875.                 # exec screen -S $hltv_name -X stuff "stoprecording
  876. # "
  877. # sleep 500
  878.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  879.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  880. # "
  881. # sleep 500
  882. # }
  883.         # }
  884.         # }
  885.                         # if {$hltv_name==".61"} {
  886.                 # set hltv_lastline ""
  887.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  888. # Ask HLTV for its status
  889.                 # exec screen -S $hltv_name -X stuff "status
  890. # "
  891. # Write the info in the screen to a temp file
  892.                 # sleep 500
  893.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  894.                 # sleep 500
  895. # Reading tmp file into eggdrop
  896.                 # set fs [open /tmp/$hltv_name r]
  897.                 # while {![eof $fs]} {
  898.                         # gets $fs line
  899.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  900.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  901.                 # }
  902.                 # close $fs
  903.                 # if {$hltv_lastline!=""} {
  904.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  905.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  906.                 # return 0
  907.                 # }
  908.                 # if {$hltv_lastline==""} {
  909.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.65:38161 �02e a password�02 [lindex $args 2] �02Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  910.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  911. # "
  912. # sleep 500
  913.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.65:38161
  914. # "
  915. # sleep 5000
  916.  
  917.                 # set hltv_lastline ""
  918.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  919. # Ask HLTV for its status
  920.                 # exec screen -S $hltv_name -X stuff "status
  921. # "
  922. # Write the info in the screen to a temp file
  923.                 # sleep 500
  924.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  925.                 # sleep 500
  926. # Reading tmp file into eggdrop
  927.                 # set fs [open /tmp/$hltv_name r]
  928.                 # while {![eof $fs]} {
  929.                         # gets $fs line
  930.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  931.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  932.                 # }
  933.                 # if {$hltv_lastline==""} {
  934.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV�02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  935.                 # }
  936.                 # if {$hltv_lastline!=""} {
  937. # sleep 500
  938.                 # exec screen -S $hltv_name -X stuff "stoprecording
  939. # "
  940. # sleep 500
  941.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  942.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  943. # "
  944. # sleep 500
  945. # }
  946.         # }
  947.         # }
  948.                 # if {$hltv_name==".44"} {
  949.                 # set hltv_lastline ""
  950.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  951.                 #Ask HLTV for its status
  952.                 # exec screen -S $hltv_name -X stuff "status
  953. # "
  954.                 #Write the info in the screen to a temp file
  955.                 # sleep 500
  956.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  957.                 # sleep 500
  958.                 #Reading tmp file into eggdrop
  959.                 # set fs [open /tmp/$hltv_name r]
  960.                 # while {![eof $fs]} {
  961.                         # gets $fs line
  962.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  963.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  964.                 # }
  965.                 # close $fs
  966.                 # if {$hltv_lastline!=""} {
  967.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  968.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  969.                 # return 0
  970.                 # }
  971.                 # if {$hltv_lastline==""} {
  972.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.41:38344 �02e a password�02 [lindex $args 2] �02Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  973.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  974. # "
  975. # sleep 500
  976.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.41:38344
  977. # "
  978. # sleep 5000
  979.  
  980.                 # set hltv_lastline ""
  981.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  982.                 #Ask HLTV for its status
  983.                 # exec screen -S $hltv_name -X stuff "status
  984. # "
  985.                 #Write the info in the screen to a temp file
  986.                 # sleep 500
  987.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  988.                 # sleep 500
  989.                 #Reading tmp file into eggdrop
  990.                 # set fs [open /tmp/$hltv_name r]
  991.                 # while {![eof $fs]} {
  992.                         # gets $fs line
  993.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  994.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  995.                 # }
  996.                 # if {$hltv_lastline==""} {
  997.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV�02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  998.                 # }
  999.                 # if {$hltv_lastline!=""} {
  1000. # sleep 500
  1001.                 # exec screen -S $hltv_name -X stuff "stoprecording
  1002. # "
  1003. # sleep 500
  1004.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  1005.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  1006. # "
  1007. # sleep 500
  1008. # }
  1009.         # }
  1010.         # }
  1011.                 # if {$hltv_name==".45"} {
  1012.                 # set hltv_lastline ""
  1013.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  1014.                 #Ask HLTV for its status
  1015.                 # exec screen -S $hltv_name -X stuff "status
  1016. # "
  1017.                 #Write the info in the screen to a temp file
  1018.                 # sleep 500
  1019.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  1020.                 # sleep 500
  1021.                 #Reading tmp file into eggdrop
  1022.                 # set fs [open /tmp/$hltv_name r]
  1023.                 # while {![eof $fs]} {
  1024.                         # gets $fs line
  1025.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  1026.                         # if {[string match *Recording* $line]} {set hltv_lastline $line}
  1027.                 # }
  1028.                 # close $fs
  1029.                 # if {$hltv_lastline!=""} {
  1030.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 $hltv_name �02 já tinha recebebido ordem para conectar, certifica-te que introduziste correctamente o servidor, password eou matchid. �02�0307»�0314]"
  1031.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 Se tiveres a certeza que os dados que introduziste estão correctos, podes usar �02!hltv $hltv_name free�02 para libertar a HLTV do servidor"
  1032.                 # return 0
  1033.                 # }
  1034.                 # if {$hltv_lastline==""} {
  1035.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A conectar a HLTV ao servidor com o ip�02 188.93.232.65:38345 �02e a password�02 [lindex $args 2]  �02 Aguarda um momento pelo inicio da gravação da demo... �0307»�0314]"
  1036.                 # exec screen -S $hltv_name -X stuff "serverpassword [lindex $args 2]
  1037. # "
  1038. # sleep 500
  1039.                 # exec screen -S $hltv_name -X stuff "connect 188.93.232.65:38345
  1040. # "
  1041. # sleep 5000
  1042.  
  1043.                 # set hltv_lastline ""
  1044.                 # if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  1045.                 #Ask HLTV for its status
  1046.                 # exec screen -S $hltv_name -X stuff "status
  1047. # "
  1048.                 #Write the info in the screen to a temp file
  1049.                 # sleep 500
  1050.                 # exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  1051.                 # sleep 500
  1052.                 #Reading tmp file into eggdrop
  1053.                 # set fs [open /tmp/$hltv_name r]
  1054.                 # while {![eof $fs]} {
  1055.                         # gets $fs line
  1056.                         # if {[string match *Connected* $line]} { set hltv_lastline $line }
  1057.                         # if {[string match *Not*connected* $line]} {set hltv_lastline ""}
  1058.                 # }
  1059.                 # if {$hltv_lastline==""} {
  1060.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0304 NÃO CONECTADO�02�0300: A HLTV �02 '$hltv_name' �02não entrou no servidor, certifica-te que introduziste correctamente a password. �02�0307»�0314]"
  1061.                 # }
  1062.                 # if {$hltv_lastline!=""} {
  1063. # sleep 500
  1064.                 # exec screen -S $hltv_name -X stuff "stoprecording
  1065. # "
  1066. # sleep 500
  1067.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0303 Conectado!�02�0300 A gravação da demo para o matchid:�02 [lindex $args 3] �02foi iniciada na HLTV do servidor:�02 '$hltv_name' �0307»�0314]"
  1068.                 # exec screen -S $hltv_name -X stuff "record ../../hltv-eggdrop/[lindex $args 3]
  1069. # "
  1070. # sleep 500
  1071. # }
  1072.         # }
  1073.         # }
  1074.                                 return 0
  1075.         }
  1076.        
  1077.         ########################
  1078.         #if {[lindex $args 1]=="connect"} {
  1079.         #if {$hltv_name==".gd3"} {
  1080.         #putquick "PRIVMSG $chan:�0314,01[�02�0307«�0300 "
  1081.         #}
  1082.         #}
  1083.         #############################
  1084.        
  1085.         if {[lindex $args 1]=="stop"} {
  1086.                 set hltv_lastline ""
  1087.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  1088.                 #Ask HLTV for its status
  1089.                 exec screen -S $hltv_name -X stuff "status
  1090. "
  1091.                 #Write the info in the screen to a temp file
  1092.                 sleep 500
  1093.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  1094.                 sleep 500
  1095.                 #Reading tmp file into eggdrop
  1096.                 set fs [open /tmp/$hltv_name r]
  1097.                 while {![eof $fs]} {
  1098.                         gets $fs line
  1099.                         if {[string match *Not*connected* $line]} { set hltv_lastline $line}
  1100.                         if {[string match *dem* $line]} { set linee [regexp -nocase -- {../../hltv-eggdrop/([-_0-9A-Za-z]+)&?.*?dem} $line demo demo2] }
  1101.                 }
  1102.                 close $fs       
  1103.                                         if {$hltv_lastline!=""} {
  1104.                         putquick "PRIVMSG #cs.gather.uk.admin :�0314,01[�02�0307«�0300�02 HLTV�02 '$hltv_name' �02is not connected to any server �02�0307»�0314]"
  1105.                  set hltv_lastline ""
  1106.                  return 0
  1107.                 }
  1108.                 if {$linee!=""} {              
  1109.                                 sleep 500
  1110.                 exec screen -S $hltv_name -X stuff "stoprecording
  1111. "       
  1112.                                 sleep 500
  1113.                                 putquick "PRIVMSG #cs.gather.uk.admin :�0314,01[�02�0307«�02�0300 Disconnecting HLTV with the number�02 '$hltv_name' �02... Please wait a few seconds while link to download the demo is generated... �02�0307»�0314]"
  1114.                 set demext ".dem"
  1115.                                                 sleep 500
  1116.                 exec zip $demo2 $demo2$demext
  1117.                                                 sleep 3000
  1118.  
  1119.                 set     zip ".zip"
  1120.                         sleep 500
  1121.                         exec mv $demo2$zip /home/gather-uk/www/demos/$demo2$zip
  1122.                         set matchid [string range $demo2 0 6]
  1123.                 putquick "PRIVMSG #cs.gather.uk.admin :�0314,01[�02�0307«�02�0300 Gather on the server�0304 $hltv_name �0300with the matchid�0304 $matchid �0300is complete. Download:�0307 http://gather-uk.tegarte.com/demos/$demo2$zip �02»�0314]"
  1124.                 putquick "PRIVMSG #cs.gather.uk :�0314,01[�02�0307«�02�0300 Gather on the server�0304 $hltv_name �0300with the matchid�0304 $matchid �0300is complete. Download:�0307 http://gather-uk.tegarte.com/demos/$demo2$zip �02»�0314]"
  1125.                 putquick "PRIVMSG CSGatherPT :$matchid �0314,01[�02�0307«�02�0300 Download demo for the matchid�02 $matchid�02:�0307 http://gather-uk.tegarte.com/demos/$demo2$zip �02»�0314]"
  1126.                         sleep 500
  1127.                         exec screen -S $hltv_name -X stuff "stop
  1128. "
  1129.                         sleep 5000
  1130.                 exec rm $demo2$demext
  1131.                                                 sleep 500
  1132.                 set linee ""
  1133.                 return 0
  1134.         }
  1135.         }
  1136.        
  1137.                 if {[lindex $args 1]=="stopp"} {
  1138.                 set hltv_lastline ""
  1139.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  1140.                 #Ask HLTV for its status
  1141.                 exec screen -S $hltv_name -X stuff "status
  1142. "
  1143.                 #Write the info in the screen to a temp file
  1144.                 sleep 500
  1145.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  1146.                 sleep 500
  1147.                 #Reading tmp file into eggdrop
  1148.                 set fs [open /tmp/$hltv_name r]
  1149.                 while {![eof $fs]} {
  1150.                         gets $fs line
  1151.                         if {[string match *Not*connected* $line]} { set hltv_lastline $line}
  1152.                         if {[string match *dem* $line]} { set linee [regexp -nocase -- {../../hltv-eggdrop/([-_0-9A-Za-z]+)&?.*?dem} $line demo demo2] }
  1153.                 }
  1154.                 close $fs       
  1155.                                         if {$hltv_lastline!=""} {
  1156.                         putquick "PRIVMSG #gather.support :�0314,01[�02�0307«�0300�02 HLTV�02 '$hltv_name' �02is not connected to any server �02�0307»�0314]"
  1157.                  set hltv_lastline ""
  1158.                  return 0
  1159.                 }
  1160.                 if {$linee!=""} {              
  1161.                                 sleep 500
  1162.                 exec screen -S $hltv_name -X stuff "stoprecording
  1163. "       
  1164.                                 sleep 500
  1165.                                 putquick "PRIVMSG #cs.gather.uk.admin :�0314,01[�02�0307«�02�0300 Disconnecting HLTV with the number�02 '$hltv_name' �02... Please wait a few seconds while link to download the demo is generated... �02�0307»�0314]"
  1166.                 set demext ".dem"
  1167.                                                 sleep 500
  1168.                 exec zip $demo2 $demo2$demext
  1169.                                                 sleep 3000
  1170.  
  1171.                 set     zip ".zip"
  1172.                         sleep 500
  1173.                         exec mv $demo2$zip /home/gather-uk/www/demos/$demo2$zip
  1174.                         set matchid [string range $demo2 0 6]
  1175.                 putquick "PRIVMSG #cs.gather.uk.admin :�0314,01[�02�0307«�02�0300 Gather on the server�0304 $hltv_name �0300with the matchid�0304 $matchid �0300is complete. Download:�0307 http://gather-uk.tegarte.com/demos/$demo2$zip �02»�0314]"
  1176.                 putquick "PRIVMSG #cs.gather.uk :�0314,01[�02�0307«�02�0300 Gather on the server�0304 $hltv_name �0300with the matchid�0304 $matchid �0300is complete. Download:�0307 http://gather-uk.tegarte.com/demos/$demo2$zip �02»�0314]"
  1177.                 putquick "PRIVMSG CSGatherPT :$matchid �0314,01[�02�0307«�02�0300 Download demo for the matchid�02 $matchid�02:�0307 http://gather-uk.tegarte.com/demos/$demo2$zip �02»�0314]"
  1178.                         sleep 500
  1179.                         exec screen -S $hltv_name -X stuff "stop
  1180. "
  1181.                         sleep 5000
  1182.                 exec rm $demo2$demext
  1183.                                                 sleep 500
  1184.                 set linee ""
  1185.                 return 0
  1186.         }
  1187.         }
  1188.        
  1189.        
  1190.                 if {[lindex $args 1]=="free"} {
  1191.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 Forcing the HLTV�02 '$hltv_name' �02to exit the server. �02�0307»�0314]"
  1192.                         sleep 500
  1193.                 exec screen -S $hltv_name -X stuff "stoprecording
  1194. "       
  1195.                         sleep 500
  1196.                 exec screen -S $hltv_name -X stuff "stop
  1197. "
  1198.                 return 0
  1199.         }
  1200.  
  1201.        
  1202.        
  1203.         if {[lindex $args 1]=="status"} {
  1204.                 set hltv_lastline ""
  1205.                 if {[file exists /tmp/$hltv_name]} { exec rm /tmp/$hltv_name }
  1206.                 #Ask HLTV for its status
  1207.                 exec screen -S $hltv_name -X stuff "status
  1208. "
  1209.                 #Write the info in the screen to a temp file
  1210.                 sleep 500
  1211.                 exec screen -S $hltv_name -X hardcopy /tmp/$hltv_name
  1212.                 sleep 500
  1213.                 #Reading tmp file into eggdrop
  1214.                 set fs [open /tmp/$hltv_name r]
  1215.                 while {![eof $fs]} {
  1216.                         gets $fs line
  1217.                         if {[string match *Connected* $line]} { set hltv_lastline $line }
  1218.                         if {[string match *Name* $line]} { set hltv_lastname $line }                   
  1219.                         if {[string match *Not*connected* $line]} { set hltv_lastline ""}
  1220.                         if {[string match *,*Players* $line]} { set hltv_players [string rang $line [expr [string length $line] - 2] [expr [string length $line] - 1]] }
  1221.                 }
  1222.                 close $fs
  1223.                 if {$hltv_lastline!=""} {
  1224.                 putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 $hltv_lastline �02�0307»�0314]"
  1225.                 if {$hltv_players!=""} { putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 $hltv_lastname, players: [expr $hltv_players - 1] �02�0307»�0314]" }
  1226.                 if {$hltv_players==""} { putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 $hltv_lastname �02�0307»�0314]" }
  1227.                 }
  1228.                 if {$hltv_lastline==""} { putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 HLTV�02 '$hltv_name' �02is not connected to any server. �02�0307»�0314]" }
  1229.                 set hltv_lastline ""                                                           
  1230.                 }
  1231. }
  1232.  
  1233.  
  1234. #bind pubm - * teste120
  1235.  
  1236. # proc teste120 {nick uhost hand chan text} {
  1237. # if {[regexp {^(.+) O servidor de jogo (.+):(.+) (#(.+)) está agora (.+)$} $text inicio dummy ip port serv fim tudo]} {
  1238.                 # set hltv_lastline ""
  1239.                 # if {[file exists /tmp/.$serv]} { exec rm /tmp/.$serv }
  1240.         #       Ask HLTV for its status
  1241.                 # exec screen -S .$serv -X stuff "status
  1242. # "
  1243.         #       Write the info in the screen to a temp file
  1244.                 # sleep 500
  1245.                 # exec screen -S .$serv -X hardcopy /tmp/.$serv
  1246.                 # sleep 500
  1247.                 #Reading tmp file into eggdrop
  1248.                 # set fs [open /tmp/.$serv r]
  1249.                 # while {![eof $fs]} {
  1250.                         # gets $fs line
  1251.                         # if {[string match *Not*connected* $line]} { set hltv_lastline $line}
  1252.                         # if {[string match *dem* $line]} { set linee [regexp -nocase -- {../../hltv-eggdrop/([-_0-9A-Za-z]+)&?.*?dem} $line demo demo2] }
  1253.                 # }
  1254.                 # close $fs     
  1255.                                         # if {$hltv_lastline!=""} {
  1256.                         # putquick "PRIVMSG $chan :�0314,01[�02�0307«�0300�02 A HLTV do servidor�02 '.$serv' �02não está conectada �02�0307»�0314]"
  1257.                  # set hltv_lastline ""
  1258.                  # return 0
  1259.                 # }
  1260.                 # if {$linee!=""} {            
  1261.                                 # sleep 500
  1262.                 # exec screen -S .$serv -X stuff "stoprecording
  1263. # "     
  1264.                                 # sleep 500
  1265.                                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 A desconectar a HLTV do servidor�02 '.$serv' �02... Aguarda alguns segundos enquanto o link para o download é criado... �02�0307»�0314]"
  1266.                 # set demext ".dem"
  1267.                                                 # sleep 500
  1268.                 # exec zip $demo2 $demo2$demext
  1269.                                                 # sleep 3000
  1270.  
  1271.                 # set   zip ".zip"
  1272.                         # sleep 500
  1273.                         # exec mv $demo2$zip /home/gather/www/demos/$demo2$zip
  1274.                         # set matchid [string range $demo2 0 6]
  1275.                 # putquick "PRIVMSG $chan :�0314,01[�02�0307«�02�0300 Gather no servidor�0304 .$serv �0300com o ID�0304 $matchid �0300terminou. Download:�0307 http://gather.tegarte.com/hltv/index.php?dir=&file=$demo2$zip �02»�0314]"
  1276.                 # putquick "PRIVMSG #cs.gather.pt :�0314,01[�02�0307«�02�0300 Gather no servidor�0304 .$serv �0300com o ID�0304 $matchid �0300terminou. Download:�0307 http://gather.tegarte.com/hltv/index.php?dir=&file=$demo2$zip �02»�0314]"
  1277.                 # putquick "PRIVMSG #cs.gather.pt.services :$matchid �0314,01[�02�0307«�02�0300 Download da demo HLTV para o matchid�02 $matchid�02:�0307 http://gather.tegarte.com/hltv/index.php?dir=&file=$demo2$zip �02»�0314]"
  1278.                         # sleep 500
  1279.                         # exec screen -S .$serv -X stuff "stop
  1280. # "
  1281.                         # sleep 5000
  1282.                 # exec rm $demo2$demext
  1283.                                                 # sleep 500
  1284.                 # set linee ""
  1285.                 # return 0
  1286.         # }
  1287.         # }
  1288.                 # }
  1289.  
  1290. # bind pubm - * hltv_pvt
  1291.  
  1292. # proc hltv_pvt {nick uhost hand chan text} {
  1293. # if {[regexp -nocase -- {^(.+) IP and password has now been sent to every subscribed player, if you did not receive it, then use (.+) or contact your admin: (.+) ((.+))(.+)$} $text ini getpass admini resto fim ola]} {
  1294. # set nickadmin "[stripcodes bcruag $resto]"
  1295. # putquick "NOTICE $nickadmin :�02�0314,01[�0307«�02�0300 Don't forget to use the HLTV on the server, is a 7 digit number that you received from �02CS-Gather-UK�02. �02�0307»�0314]"
  1296. # }
  1297. # }
  1298.  
  1299. proc sleep { val } {
  1300.      set x 0
  1301.      after $val {set x 1}
  1302.      vwait x
  1303. }
  1304. ##############################################
  1305. putlog "(Loaded!) TCL BY �02TEGA�02 - hltv.tcl - HLTV proxy caller on #cs.gather.pt"
  1306. ##############################################
  1307.  
Parsed in 0.422 seconds