Advertisement
agentsix1

Episode 6 - Notes

Sep 4th, 2017
40,543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. Step 1:
  2. dim statusOnline = 0
  3. dim statusOffline = 0
  4. dim statusIdle = 0
  5. dim statusDnd = 0
  6.  
  7. Step 2 Private update users if discord clear users
  8. statusOnline = 0
  9. statusOffline = 0
  10. statusIdle = 0
  11. statusDnd = 0
  12. For Each
  13.  
  14. step 3 for each
  15. Select Case user.Status.Value
  16. Case "online"
  17. statusOnline += 1
  18. Case "offline"
  19. statusOffline += 1
  20. Case "idle"
  21. statusIdle += 1
  22. Case "dnd"
  23. statusDnd += 1
  24. End Select
  25.  
  26.  
  27. Step 4
  28.  
  29.  
  30. Public Sub updateStatus(status As Integer(), server As String)
  31. statusOnline = status(0)
  32. statusOffline = status(1)
  33. statusIdle = status(2)
  34. statusDnd = status(3)
  35. editHTML("server", "
  36. <html>
  37. <head>
  38. <meta charset=""utf-8"">
  39. <meta name=""viewport"" content=""width=device-width, initial - Scale() = 1"">
  40. <link rel=""stylesheet"" href=""https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"" type=""text/css"">
  41. <link rel=""stylesheet"" href=""users.css"" type=""text/css""> </head>
  42.  
  43. <body color=white bgcolor=black style=""color: white;background-color: black;"">
  44. <div class=""py-5"">
  45. <div class=""container"">
  46. <div class=""row"">
  47. <div class=""col-md-12""><center>
  48. " & server & "<br>
  49. <img src=""./images/online.png"" width=10 height=10 />" & status(0) & "
  50. <img src=""./images/idle.png"" width=10 height=10 />" & status(2) & "
  51. <img src = ""./images/offline.png"" width=10 height=10 />" & status(1) & "
  52. <img src = ""./images/offline.png"" width=10 height=10 />" & status(3) & "
  53. </center>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <script src=""https//code.jquery.com/jquery-3.1.1.min.js""></script>
  59. <script src=""https//cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js""></script>
  60. <script src=""https//pingendo.com/assets/bootstrap/bootstrap-4.0.0-alpha.6.min.js""></script>
  61. </body>
  62.  
  63. </html>
  64.  
  65. ", "")
  66. End Sub
  67.  
  68. Step 5
  69. Select Case box
  70. Case "chat"
  71. Case "server"
  72. End Select
  73.  
  74.  
  75. Step 6
  76. Move code under chat
  77.  
  78. Step 7 Move this under server
  79. If Not System.IO.File.Exists(Application.StartupPath & "\logs\server.html") Then
  80. System.IO.File.WriteAllText(Application.StartupPath & "\logs\server.html", msg)
  81. Else
  82. System.IO.File.WriteAllText(Application.StartupPath & "\logs\server.html", msg)
  83. End If
  84. wbServer.Navigate(Application.StartupPath & "\logs\server.html")
  85.  
  86. Step 8 add webbrowser for wbServer
  87.  
  88. Step 9 add code for server log
  89. If Not System.IO.File.Exists(Application.StartupPath & "\logs\server.html") Then
  90. System.IO.File.WriteAllText(Application.StartupPath & "\logs\server.html", "")
  91. End If
  92.  
  93. Step 10 add code for status update
  94.  
  95. updateStatus({statusOnline, statusIdle, statusOffline, statusDnd}, ComboBox2.Text)
  96.  
  97. step 11 add user update listener
  98. Public Sub onPlayerUpdate(send As Object, e As Discord.UserUpdatedEventArgs) Handles discord.UserUpdated
  99. doit = True
  100. End Sub
  101.  
  102. step 12 add code to activate player update under timer that wont stop
  103. add dim doit = false in global
  104. If doit Then
  105. doit = False
  106. updateUsers()
  107. End If
  108.  
  109. step 13 remove any other updateusers that are found outside the listener
  110.  
  111.  
  112. step 14 add the status images
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement