CatchEvent OnConnect( $userName ) SetCurrentPlayerVar( "Chat_Status", "Maximized" ); EndCatchEvent CatchEvent OnDisConnect( $userName, $reason ) IF( GetCurrentPlayerVar( "Chat" ) != "" ) THEN Chat_Text_input ( $userName, "^4> ^7Left Chat" ); privMsg( "^7Left Chat " . GetCurrentPlayerVar( "Chat" ) ); writeline( "| " . StripLFSColor( $HostName ) . " | " . $userName . " Left Chat " . GetCurrentPlayerVar( "Chat" ) ); RemoveUserFromGroup( GetCurrentPlayerVar( "Chat" ), $userName ); SetCurrentPlayerVar( "Chat" , "" ); ENDIF EndCatchEvent CatchEvent OnMSO( $userName, $text ) $idxOfFirtsSpace = indexOf( $text, " "); IF( $idxOfFirtsSpace == -1 ) THEN $command = $text; $argv = ""; ELSE $command = subStr( $text,0,$idxOfFirtsSpace ); $argv = trim( subStr( $text,$idxOfFirtsSpace ) ); ENDIF SWITCH( ToLower($command) ) CASE "!chat": IF( GetCurrentPlayerVar( "Chat" ) != "" ) THEN Chat_Text_input ( $userName, $argv ); ELSE privMsg ( "^7Your Not In A ChatRoom" ); ENDIF BREAK; CASE "!joinchat": IF( $argv != "" ) THEN IF( GetCurrentPlayerVar( "Chat" ) != "" ) THEN Chat_Close("","Leave"); ENDIF SetCurrentPlayerVar( "Chat" , "#" . tolower( $argv ) ); privMsg( "^7Joined Chat " . GetCurrentPlayerVar( "Chat" ) ); writeline( "| " . StripLFSColor( $HostName ) . " | " . $userName . " Joined Chat " . GetCurrentPlayerVar( "Chat" ) ); MoveUserToGroup( GetCurrentPlayerVar( "Chat" ), $userName ); Chat_Text_input ( $userName, "^4> ^7Joined Chat" ); Chat_Maximize("",""); ELSE privMsg ( "^7Command needs a parameter" ); ENDIF BREAK; CASE "!openchat": Chat_Maximize("",""); BREAK; CASE "!leavechat": IF( GetCurrentPlayerVar( "Chat" ) != "" ) THEN Chat_Close("","Leave"); ELSE privMsg ( "^7Your Not In A ChatRoom" ); ENDIF BREAK; ENDSWITCH EndCatchEvent Sub Chat_Text_input ( $userName, $argv ) IF( $argv != "" ) THEN $temp = GetListOfPlayers( ); FOREACH( $maVar IN $temp ) $NickName = GetPlayerVar($maVar["value"], "nickName"); $NickStrip = StripLFSColor( ToLower($NickName) ); $IdxOfTag = indexOf( $NickStrip , "[TEAM]"); IF( ToNum(indexOf( $NickStrip , "[TEAM]")) >= 0 ) THEN PrivMsg($maVar["value"],"Team: ".$argv) ENDIF ENDFOREACH ENDIF SetPlayerVar( $maVar["value"], "msg1", GetPlayerVar( $maVar["value"], "msg2" ) ); SetPlayerVar( $maVar["value"], "msg2", GetPlayerVar( $maVar["value"], "msg3" ) ); SetPlayerVar( $maVar["value"], "msg3", GetPlayerVar( $maVar["value"], "msg4" ) ); SetPlayerVar( $maVar["value"], "msg4", GetPlayerVar( $maVar["value"], "msg5" ) ); SetPlayerVar( $maVar["value"], "msg5", GetPlayerVar( $maVar["value"], "msg6" ) ); SetPlayerVar( $maVar["value"], "msg6", GetPlayerVar( $maVar["value"], "msg7" ) ); SetPlayerVar( $maVar["value"], "msg7", GetPlayerVar( $maVar["value"], "msg8" ) ); SetPlayerVar( $maVar["value"], "msg8", "^4> " . GetCurrentPlayerVar( "NickName" ) . " ^8: ^2" . $argv ); SWITCH( GetPlayerVar( $maVar["value"], "Chat_Status" ) ) CASE "Maximized": openButton( $maVar["value"], "Chat_Text",25,45,150,6,10,-1,96, GetPlayerVar( $maVar["value"], "msg1" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg2" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg3" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg4" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg5" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg6" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg7" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg8" ) ); $ListOfUsers = GetListOfUsersGroup($ChatRoom); openButton( $maVar["value"],"Chat_Users_1",9,34,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[0] . "%nl%^7" . $ListOfUsers[1] . "%nl%^7" . $ListOfUsers[2] . "%nl%^7" . $ListOfUsers[3] . "%nl%^7" . $ListOfUsers[4] . "%nl%^7" . $ListOfUsers[5] . "%nl%^7" . $ListOfUsers[6] . "%nl%^7" . $ListOfUsers[7] . "%nl%^7" . $ListOfUsers[8] . "%nl%^7" . $ListOfUsers[9] . "%nl%^7" . $ListOfUsers[10] . "%nl%^7" . $ListOfUsers[11] . "%nl%^7" . $ListOfUsers[12] . "%nl%^7" . $ListOfUsers[13] . "%nl%^7" . $ListOfUsers[14] . "%nl%^7" . $ListOfUsers[15] . "%nl%^7" . $ListOfUsers[16] . "%nl%^7" . $ListOfUsers[17] ); openButton( $maVar["value"],"Chat_Users_2",176,34,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[18] . "%nl%^7" . $ListOfUsers[19] . "%nl%^7" . $ListOfUsers[20] . "%nl%^7" . $ListOfUsers[21] . "%nl%^7" . $ListOfUsers[22] . "%nl%^7" . $ListOfUsers[23] . "%nl%^7" . $ListOfUsers[24] . "%nl%^7" . $ListOfUsers[25] . "%nl%^7" . $ListOfUsers[26] . "%nl%^7" . $ListOfUsers[27] . "%nl%^7" . $ListOfUsers[28] . "%nl%^7" . $ListOfUsers[29] . "%nl%^7" . $ListOfUsers[30] . "%nl%^7" . $ListOfUsers[31] . "%nl%^7" . $ListOfUsers[32] . "%nl%^7" . $ListOfUsers[33] . "%nl%^7" . $ListOfUsers[34] . "%nl%^7" . $ListOfUsers[35] ); BREAK; CASE "Restored": openButton( $maVar["value"], "Chat_Text",40,65,120,6,10,-1,96, GetPlayerVar( $maVar["value"], "msg5" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg6" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg7" ) . "%nl%" . GetPlayerVar( $maVar["value"], "msg8" ) ); $ChatRoom = GetCurrentPlayerVar( "Chat" ); $ListOfUsers = GetListOfUsersGroup($ChatRoom); openButton( $maVar["value"],"Chat_Users_1",24,54,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[0] . "%nl%^7" . $ListOfUsers[1] . "%nl%^7" . $ListOfUsers[2] . "%nl%^7" . $ListOfUsers[3] . "%nl%^7" . $ListOfUsers[4] . "%nl%^7" . $ListOfUsers[5] . "%nl%^7" . $ListOfUsers[6] . "%nl%^7" . $ListOfUsers[7] . "%nl%^7" . $ListOfUsers[8] . "%nl%^7" . $ListOfUsers[9] ); openButton( $maVar["value"],"Chat_Users_2",161,54,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[10] . "%nl%^7" . $ListOfUsers[11] . "%nl%^7" . $ListOfUsers[12] . "%nl%^7" . $ListOfUsers[13] . "%nl%^7" . $ListOfUsers[14] . "%nl%^7" . $ListOfUsers[15] . "%nl%^7" . $ListOfUsers[16] . "%nl%^7" . $ListOfUsers[17] . "%nl%^7" . $ListOfUsers[18] . "%nl%^7" . $ListOfUsers[19] ); BREAK; CASE "Closed": $argv1 = substr( $argv,0,30 ); IF( strlen($argv) > 30 ) THEN $argv2 = substr( $argv,30,strlen($argv) ); ENDIF IF( $argv2 != "" ) THEN IF( strlen($argv2) > 30 ) THEN $argv3 = substr( $argv,strlen($argv2),strlen($argv) ); ENDIF ENDIF PrivMsg( $maVar["value"], "^4> " . GetCurrentPlayerVar( "UserName" ) . " ^8: ^2" . $argv1 ); IF( $argv2 != "" ) THEN PrivMsg( $maVar["value"], "^4> " . GetCurrentPlayerVar( "UserName" ) . " ^8: ^2" . $argv2 ); ENDIF IF( $argv3 != "" ) THEN PrivMsg( $maVar["value"], "^4> " . GetCurrentPlayerVar( "UserName" ) . " ^8: ^2" . $argv3 ); ENDIF BREAK; CASE "Minimized": openButton( $maVar["value"], "Chat_Minimized",80,1,40,5,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ) . "%at%^7MSG From " . GetCurrentPlayerVar( "NickName" ), Chat_Maximize ); BREAK; ENDSWITCH ENDIF ENDFOREACH ELSE privMsg ( "^7Command needs a parameter" ); ENDIF EndSub Sub Chat_Close_ask ( $KeyFlags,$id ) closePrivButton ( "Chat_Text&Chat_BG&Chat_Title&Chat_X&Chat_-&Chat_Restore&Chat_Text_input&Chat_Minimized&Chat_Users_1&Chat_Users_2" ); openPrivButton( "Chat_Close_Ask_Q",55,58,80,6,5,-1,32, "^7Do You want To Close Chat or Leave Chat" ); openPrivButton( "Close",75,75,20,10,8,-1,32,"^2Close Chat",Chat_Close ); openPrivButton( "Leave",95,75,20,10,8,-1,32,"^1Leave Chat",Chat_Close ); openPrivButton( "Cancel",75,85,40,10,8,-1,32,"^3Cancel",Chat_Close ); EndSub Sub Chat_Close ( $KeyFlags,$id ) closePrivButton ( "Chat_Text&Chat_BG&Chat_Title&Chat_X&Chat_-&Chat_Restore&Chat_Text_input&Chat_Minimized&Chat_Users_1&Chat_Users_2" ); closePrivButton ( "Chat_Close_Ask_Q&Close&Leave&Cancel&Chat_Close_Ask_BG" ); SWITCH( $id ) CASE "Close": SetCurrentPlayerVar( "Chat_Status", "Closed" ); BREAK; CASE "Leave": $userName = GetCurrentPlayerVar( "UserName" ); RemoveUserFromGroup( GetCurrentPlayerVar( "Chat" ), $userName ); Chat_Text_input ( $userName, "^4> ^7Left Chat" ); SetCurrentPlayerVar( "msg1", "" ); SetCurrentPlayerVar( "msg2", "" ); SetCurrentPlayerVar( "msg3", "" ); SetCurrentPlayerVar( "msg4", "" ); SetCurrentPlayerVar( "msg5", "" ); SetCurrentPlayerVar( "msg6", "" ); SetCurrentPlayerVar( "msg7", "" ); SetCurrentPlayerVar( "msg8", "" ); privMsg( "^7Left Chat " . GetCurrentPlayerVar( "Chat" ) ); writeline( "| " . StripLFSColor( $HostName ) . " | " . $userName . " Left Chat " . GetCurrentPlayerVar( "Chat" ) ); SetCurrentPlayerVar( "Chat" , "" ); BREAK; CASE "Cancel": Chat_Maximize("",""); BREAK; ENDSWITCH EndSub Sub Chat_Minimize ( $KeyFlags,$id ) closePrivButton ( "Chat_Text&Chat_BG&Chat_Title&Chat_X&Chat_-&Chat_Restore&Chat_Text_input&Chat_Minimized&Chat_Users_1&Chat_Users_2" ); SetCurrentPlayerVar( "Chat_Status", "Minimized" ); openPrivButton( "Chat_Minimized",80,1,40,5,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ), Chat_Maximize ); EndSub Sub Chat_Maximize ( $KeyFlags,$id ) openPrivButton( "Chat_Text",25,45,150,6,10,-1,96, GetCurrentPlayerVar( "msg1" ) . "%nl%" . GetCurrentPlayerVar( "msg2" ) . "%nl%" . GetCurrentPlayerVar( "msg3" ) . "%nl%" . GetCurrentPlayerVar( "msg4" ) . "%nl%" . GetCurrentPlayerVar( "msg5" ) . "%nl%" . GetCurrentPlayerVar( "msg6" ) . "%nl%" . GetCurrentPlayerVar( "msg7" ) . "%nl%" . GetCurrentPlayerVar( "msg8" ) ); openPrivButton( "Chat_BG",24,34,152,95,10,-1,96,"" ); openPrivButton( "Chat_Title",25,35,150,10,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ) ); openPrivButton( "Chat_X",167,37,6,6,10,-1,32,"^1X", Chat_Close_ask ); openPrivButton( "Chat_Restore",161,37,6,6,10,-1,32,"^7[_]", Chat_Restore ); openPrivButton( "Chat_-",155,37,6,6,10,-1,32,"^7-", Chat_Minimize ); openPrivTextButton( "Chat_Text_input",25,121,150,6,10,32,"^6Enter Message","^7Type here!",90,Chat_Text_input ); openPrivButton( "Chat_Minimized",80,1,40,5,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ), Chat_Minimize ); SetCurrentPlayerVar( "Chat_Status", "Maximized" ); $ChatRoom = GetCurrentPlayerVar( "Chat" ); $ListOfUsers = GetListOfUsersGroup($ChatRoom); openPrivButton( "Chat_Users_1",9,34,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[0] . "%nl%^7" . $ListOfUsers[1] . "%nl%^7" . $ListOfUsers[2] . "%nl%^7" . $ListOfUsers[3] . "%nl%^7" . $ListOfUsers[4] . "%nl%^7" . $ListOfUsers[5] . "%nl%^7" . $ListOfUsers[6] . "%nl%^7" . $ListOfUsers[7] . "%nl%^7" . $ListOfUsers[8] . "%nl%^7" . $ListOfUsers[9] . "%nl%^7" . $ListOfUsers[10] . "%nl%^7" . $ListOfUsers[11] . "%nl%^7" . $ListOfUsers[12] . "%nl%^7" . $ListOfUsers[13] . "%nl%^7" . $ListOfUsers[14] . "%nl%^7" . $ListOfUsers[15] . "%nl%^7" . $ListOfUsers[16] . "%nl%^7" . $ListOfUsers[17] ); openPrivButton( "Chat_Users_2",176,34,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[18] . "%nl%^7" . $ListOfUsers[19] . "%nl%^7" . $ListOfUsers[20] . "%nl%^7" . $ListOfUsers[21] . "%nl%^7" . $ListOfUsers[22] . "%nl%^7" . $ListOfUsers[23] . "%nl%^7" . $ListOfUsers[24] . "%nl%^7" . $ListOfUsers[25] . "%nl%^7" . $ListOfUsers[26] . "%nl%^7" . $ListOfUsers[27] . "%nl%^7" . $ListOfUsers[28] . "%nl%^7" . $ListOfUsers[29] . "%nl%^7" . $ListOfUsers[30] . "%nl%^7" . $ListOfUsers[31] . "%nl%^7" . $ListOfUsers[32] . "%nl%^7" . $ListOfUsers[33] . "%nl%^7" . $ListOfUsers[34] . "%nl%^7" . $ListOfUsers[35] ); EndSub Sub Chat_Restore ( $KeyFlags,$id ) SWITCH( GetCurrentPlayerVar( "Chat_Status" ) ) CASE "Maximized": SetCurrentPlayerVar( "Chat_Status", "Restored" ); openPrivButton( "Chat_Text",40,65,120,6,10,-1,96, GetCurrentPlayerVar( "msg5" ) . "%nl%" . GetCurrentPlayerVar( "msg6" ) . "%nl%" . GetCurrentPlayerVar( "msg7" ) . "%nl%" . GetCurrentPlayerVar( "msg8" ) ); openPrivButton( "Chat_BG",39,54,122,55,10,-1,96,"" ); openPrivButton( "Chat_Title",40,55,120,10,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ) ); openPrivButton( "Chat_X",152,57,6,6,10,-1,32,"^1X", Chat_Close_ask ); openPrivButton( "Chat_Restore",146,57,6,6,10,-1,32,"^7[_]", Chat_Restore ); openPrivButton( "Chat_-",140,57,6,6,10,-1,32,"^7-", Chat_Minimize ); openPrivTextButton( "Chat_Text_input",40,101,120,6,10,32,"^6Enter Message","^7Type here!",90,Chat_Text_input ); openPrivButton( "Chat_Minimized",80,1,40,5,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ), Chat_Minimize ); $ChatRoom = GetCurrentPlayerVar( "Chat" ); $ListOfUsers = GetListOfUsersGroup($ChatRoom); openPrivButton( "Chat_Users_1",24,54,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[0] . "%nl%^7" . $ListOfUsers[1] . "%nl%^7" . $ListOfUsers[2] . "%nl%^7" . $ListOfUsers[3] . "%nl%^7" . $ListOfUsers[4] . "%nl%^7" . $ListOfUsers[5] . "%nl%^7" . $ListOfUsers[6] . "%nl%^7" . $ListOfUsers[7] . "%nl%^7" . $ListOfUsers[8] . "%nl%^7" . $ListOfUsers[9] ); openPrivButton( "Chat_Users_2",161,54,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[10] . "%nl%^7" . $ListOfUsers[11] . "%nl%^7" . $ListOfUsers[12] . "%nl%^7" . $ListOfUsers[13] . "%nl%^7" . $ListOfUsers[14] . "%nl%^7" . $ListOfUsers[15] . "%nl%^7" . $ListOfUsers[16] . "%nl%^7" . $ListOfUsers[17] . "%nl%^7" . $ListOfUsers[18] . "%nl%^7" . $ListOfUsers[19] ); Break; CASE "Restored": openPrivButton( "Chat_Text",25,45,150,6,10,-1,96, GetCurrentPlayerVar( "msg1" ) . "%nl%" . GetCurrentPlayerVar( "msg2" ) . "%nl%" . GetCurrentPlayerVar( "msg3" ) . "%nl%" . GetCurrentPlayerVar( "msg4" ) . "%nl%" . GetCurrentPlayerVar( "msg5" ) . "%nl%" . GetCurrentPlayerVar( "msg6" ) . "%nl%" . GetCurrentPlayerVar( "msg7" ) . "%nl%" . GetCurrentPlayerVar( "msg8" ) ); openPrivButton( "Chat_BG",24,34,152,95,10,-1,96,"" ); openPrivButton( "Chat_Title",25,35,150,10,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ) ); openPrivButton( "Chat_X",167,37,6,6,10,-1,32,"^1X", Chat_Close_ask ); openPrivButton( "Chat_Restore",161,37,6,6,10,-1,32,"^7[_]", Chat_Restore ); openPrivButton( "Chat_-",155,37,6,6,10,-1,32,"^7-", Chat_Minimize ); openPrivTextButton( "Chat_Text_input",25,121,150,6,10,32,"^6Enter Message","^7Type here!",90,Chat_Text_input ); SetCurrentPlayerVar( "Chat_Status", "Maximized" ); openPrivButton( "Chat_Minimized",80,1,40,5,10,-1,32,"^7Chat " . GetCurrentPlayerVar( "Chat" ), Chat_Minimize ); $ChatRoom = GetCurrentPlayerVar( "Chat" ); $ListOfUsers = GetListOfUsersGroup($ChatRoom); openPrivButton( "Chat_Users_1",9,34,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[0] . "%nl%^7" . $ListOfUsers[1] . "%nl%^7" . $ListOfUsers[2] . "%nl%^7" . $ListOfUsers[3] . "%nl%^7" . $ListOfUsers[4] . "%nl%^7" . $ListOfUsers[5] . "%nl%^7" . $ListOfUsers[6] . "%nl%^7" . $ListOfUsers[7] . "%nl%^7" . $ListOfUsers[8] . "%nl%^7" . $ListOfUsers[9] . "%nl%^7" . $ListOfUsers[10] . "%nl%^7" . $ListOfUsers[11] . "%nl%^7" . $ListOfUsers[12] . "%nl%^7" . $ListOfUsers[13] . "%nl%^7" . $ListOfUsers[14] . "%nl%^7" . $ListOfUsers[15] . "%nl%^7" . $ListOfUsers[16] . "%nl%^7" . $ListOfUsers[17] ); openPrivButton( "Chat_Users_2",176,34,15,5,5,-1,96,"^3Group Users" . "%nl%^7" . $ListOfUsers[18] . "%nl%^7" . $ListOfUsers[19] . "%nl%^7" . $ListOfUsers[20] . "%nl%^7" . $ListOfUsers[21] . "%nl%^7" . $ListOfUsers[22] . "%nl%^7" . $ListOfUsers[23] . "%nl%^7" . $ListOfUsers[24] . "%nl%^7" . $ListOfUsers[25] . "%nl%^7" . $ListOfUsers[26] . "%nl%^7" . $ListOfUsers[27] . "%nl%^7" . $ListOfUsers[28] . "%nl%^7" . $ListOfUsers[29] . "%nl%^7" . $ListOfUsers[30] . "%nl%^7" . $ListOfUsers[31] . "%nl%^7" . $ListOfUsers[32] . "%nl%^7" . $ListOfUsers[33] . "%nl%^7" . $ListOfUsers[34] . "%nl%^7" . $ListOfUsers[35] ); Break; ENDSWITCH EndSub