Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1. '========================================================================
  2. dim fso: set fso = CreateObject("Scripting.FileSystemObject")
  3. dim CD
  4. CD = fso.GetAbsolutePathName(".")
  5. '========================================================================
  6. Dim userName
  7. userName = "Dmill035"
  8. Dim limit
  9. limit = 3
  10. dim commandS
  11. commandS = ""
  12. dim rawInput
  13. rawInput = ""
  14. '========================================================================
  15. Dim objIE
  16. Set objIE = CreateObject( "InternetExplorer.Application" )
  17. objIE.Navigate cd & "\main.html"
  18. objIE.Document.title = "Session Manager!"
  19. objIE.ToolBar = False
  20. objIE.Resizable = False
  21. objIE.StatusBar = False
  22. objIE.Width = 700
  23. objIE.Height = 300
  24. Do While objIE.Busy
  25. WScript.Sleep 200
  26. Loop
  27. objIE.Visible = True
  28. 'On Error Resume Next
  29.  
  30. '========================================================================
  31. Function print(uN,c,data)
  32. objIE.document.getElementByID("content").innerHTML = objIE.document.getElementByID("content").innerHTML & "<p style='color:"& c &";'>"& uN &": "& data & "</p>"
  33. end function
  34. '========================================================================
  35. Function argExist(args,var)
  36. if Ubound(args) => var then
  37. argExist = true
  38. else
  39. argExist = false
  40. end if
  41. end function
  42. '========================================================================
  43. Function quit
  44. objIE.quit
  45. wscript.quit
  46. end function
  47. '========================================================================
  48. Function CParse(rawArgs)
  49. args = split(rawArgs, " ")
  50. select case lcase(args(0))
  51. case "/help"
  52. help(args)
  53. case "/session"
  54. session(args)
  55. case "/exit"
  56. quit
  57. case else
  58. print "@","red", "Unknown command use /help for more information"
  59. end select
  60. commandS = ""
  61. end function
  62. '========================================================================
  63. Function session(args)
  64. if argExist(args,1) then
  65. select case lcase(args(1))
  66. case "join"
  67. sessionJoin(args)
  68. case "leave"
  69.  
  70. case "create"
  71.  
  72. case "manage"
  73.  
  74. case else
  75. print "@", "red", "Invalid command usage!"
  76. end select
  77. else
  78. print "@", "red", "Invalid usage of /session use ""/help session"""
  79. end if
  80. end function
  81. '========================================================================
  82. Function sessionJoin(args)
  83. if argExist(args,2) then
  84. print "@","red", "Attempted to open session: " & args(2)
  85. else
  86. print "@","red", "Missing session name. Use /help session"
  87. end if
  88. end function
  89. '========================================================================
  90. Function sessionHelp(args)
  91. if argExist(args,2) then
  92.  
  93. else
  94. print"@","red","/session join <sessionName> </br> "
  95. end if
  96. end function
  97. '========================================================================
  98. Function help(args)
  99. if argExist(args,1) then
  100. select case args(1)
  101. case "session"
  102.  
  103. case else
  104. print"@","red","Unknown help article"
  105. end select
  106. else
  107. print"@","red","Available commands are /help /session /exit"
  108. print"@","red","Available help options: session"
  109. end if
  110. end function
  111. '========================================================================
  112. While True
  113. if objIE.document.getElementByID("readyState").value = "1" Then
  114. rawInput = objIE.document.getElementByID("userInput").value
  115. if left(rawInput,1) = "/" then
  116. CParse(rawInput)
  117. else
  118. if not(isEmpty(rawInput)) and rawInput = "" then
  119. print "@","red","Please type something before hitting enter."
  120. else
  121. print userName, "white", rawInput
  122. end if
  123. end if
  124. rawInput = ""
  125. objIE.document.getElementById("content").scrollTop = objIE.document.getElementById("content").scrollHeight
  126. objIE.document.getElementByID("readyState").value = "0"
  127. objIE.document.getElementById("userInput").disabled = false
  128. objIE.document.getElementById("userInput").value = ""
  129. objIE.document.getElementById("userInput").focus()
  130. end if
  131. wscript.sleep(200)
  132. Wend
  133. '========================================================================
  134.  
  135. <!-- saved from url=(0017)http://localhost/ -->
  136. <html>
  137. <head>
  138. <style>
  139. body{
  140. Background-Color:black;
  141. Color:white;
  142. }
  143. #content{
  144. Width: 100%;
  145. Height: 90%;
  146. Border-style: solid;
  147. Border-width: thin;
  148. Border-color: white;
  149. overflow: auto;
  150. }
  151. #content p {
  152. padding:0px;
  153. margin:0px;
  154. Border-bottom-style: dotted;
  155. Border-bottom-width: thin;
  156. Border-bottom-color: white;
  157. }
  158. #container{
  159. width:100%;
  160. height:100%;
  161. min-width:600px;
  162. min-height:150px;
  163. }
  164. #UserInput{
  165. width:90%;
  166. }
  167. </style>
  168. <script type="text/javascript">
  169. function setTrue(variable){
  170. var s = document.getElementById(variable);
  171. s.value = "1";
  172. document.getElementById("userInput").disabled = true;
  173. }
  174. </script>
  175. <title>Session Manager!</title>
  176. </head>
  177. <body onLoad="">
  178. <div id="container">
  179. <div id="content">
  180.  
  181. </div>
  182. <input id="userInput" onKeyDown="if (event.keyCode == 13) setTrue('readyState');" type="textarea" value=""></input>
  183. <input type="submit" value="Send" OnClick="setTrue('readyState');" ></input>
  184. <input type="hidden" value="0" id="readyState"></input>
  185.  
  186. </div>
  187. </body>
  188. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement