Guest User

Untitled

a guest
Feb 18th, 2018
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' ### K-Under Online Bot ###
  2. ' 13.10.2011 20:00 Uhr Projekt gestartet
  3. ' Funktionen geplant:
  4. ' Updater, Anti-Admin, Steuernick, MyBB Login, Changelog, kleine Statistik
  5. ' Projekt arbeitet mit der KNLib
  6.  
  7. 'KNLib importieren
  8. Imports KNLib
  9. Imports System.Net
  10.  
  11. Public Class Form1
  12.  
  13. #Region "Variablen"
  14.  
  15.     Private MyBB_Username As String = String.Empty
  16.     Private Nickname As String = String.Empty
  17.     Private Password As String = String.Empty
  18.     Private Channel As String = String.Empty
  19.     Private Proxy As String = String.Empty
  20.     Private Steuernick As String = String.Empty
  21.     Private Uhrzeit As String = String.Empty
  22.  
  23.     Private Anti_Admin As Boolean = False
  24.     Private Steuernick_verwenden As Boolean = False
  25.     Private Update_vorhanden As Boolean = False
  26.     Private Channel_wechseln As Boolean = False
  27.     Private James_vollspammen As Boolean = False
  28.     Private proxy_nutzen As Boolean = False
  29.  
  30.     Private aktuelle_Version As String = "1.0"
  31.     Private neuste_Version As String = String.Empty
  32.     Private Autor As String = "schmitz_dev@live.de"
  33.  
  34.     Dim applet As Applet
  35.     Dim WithEvents client As KSClient
  36.  
  37. #End Region
  38.  
  39.     Sub send_to_knuddels(ByVal text As String)
  40.  
  41.     End Sub
  42.  
  43.     Sub write_log(ByVal name As String, ByVal text As String, ByVal Color As Color, ByVal font As FontStyle)
  44.  
  45.         Uhrzeit_aktualisieren()
  46.         RichTextBox_chatlog.SelectionFont = New Font(RichTextBox_chatlog.Font, FontStyle.Bold)
  47.         RichTextBox_chatlog.AppendText("[" & Uhrzeit & "] ")
  48.         RichTextBox_chatlog.SelectionFont = New Font(RichTextBox_chatlog.Font, font)
  49.         RichTextBox_chatlog.SelectionColor = Color
  50.         RichTextBox_chatlog.AppendText(name & ": " & text & vbNewLine)
  51.  
  52.     End Sub
  53.  
  54.     Sub Uhrzeit_aktualisieren()
  55.  
  56.         Uhrzeit = My.Computer.Clock.LocalTime.Hour & ":" & My.Computer.Clock.LocalTime.Minute & ":" & My.Computer.Clock.LocalTime.Second
  57.  
  58.     End Sub
  59.  
  60.     Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  61.  
  62.         Environment.Exit(0)
  63.  
  64.     End Sub
  65.  
  66.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  67.  
  68.         CheckForIllegalCrossThreadCalls = False
  69.  
  70.         If CheckBox_proxynutzen.Checked = True Then
  71.             proxy_nutzen = True
  72.         Else
  73.             proxy_nutzen = False
  74.         End If
  75.  
  76.     End Sub
  77.  
  78.     Private Sub Button_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_login.Click
  79.  
  80.         RichTextBox_chatlog.Clear()
  81.  
  82.         Nickname = TextBox_nickname.Text
  83.         Password = TextBox_passwort.Text
  84.         Channel = TextBox_Channel.Text
  85.        
  86.         set_values()
  87.         write_on_login()
  88.  
  89.  
  90.         Dim Knuddels_System As New ChatSystem
  91.  
  92.         Select Case ComboBox_Chatsystem.Text
  93.             Case "DE"
  94.                 Knuddels_System = ChatSystem.DE
  95.             Case "AT"
  96.                 Knuddels_System = ChatSystem.AT
  97.             Case "CH"
  98.                 Knuddels_System = ChatSystem.CH
  99.             Case "COM"
  100.                 Knuddels_System = ChatSystem.COM
  101.             Case "MFC"
  102.                 Knuddels_System = ChatSystem.MFC
  103.         End Select
  104.  
  105.         If proxy_nutzen = False Then
  106.             client.Connect(Knuddels_System)
  107.         Else
  108.             Try
  109.                 Dim Proxy As String = TextBox_proxy.Text
  110.  
  111.                 Dim ProxyIP As String = String.Empty
  112.                 Dim ProxyPort As String = String.Empty
  113.  
  114.                 ProxyIP = Proxy.Split(":")(0)
  115.                 ProxyPort = Proxy.Split(":")(1)
  116.  
  117.                 client.Connect(Knuddels_System, ProxyIP, ProxyPort)
  118.             Catch ex As Exception
  119.                 MessageBox.Show("Es ist ein Fehler aufgetreten!")
  120.             End Try
  121.         End If
  122.  
  123.         client.Login(Nickname, Password, Channel)
  124.  
  125.     End Sub
  126.  
  127.     Sub set_values()
  128.         If CheckBox_proxynutzen.Checked = True Then
  129.             proxy_nutzen = True
  130.         Else
  131.             proxy_nutzen = False
  132.         End If
  133.  
  134.         If CheckBox_Steuernick.Checked = True Then
  135.             Steuernick_verwenden = True
  136.             Steuernick = TextBox_steuernick.Text
  137.         Else
  138.         End If
  139.  
  140.         If CheckBox_AntiAdmin.Checked = True Then
  141.             Anti_Admin = True
  142.         Else
  143.         End If
  144.  
  145.         If CheckBox_channelwechseln.Checked = True Then
  146.             Channel_wechseln = True
  147.         Else
  148.         End If
  149.  
  150.         If CheckBox_jamesspam.Checked = True Then
  151.             James_vollspammen = True
  152.         Else
  153.         End If
  154.     End Sub
  155.  
  156.     Sub write_on_login()
  157.         write_log("Bot", "Einstellungen:", Color.Red, FontStyle.Bold)
  158.         write_log("Bot", "Steuernick verwenden: " & Steuernick_verwenden, Color.Red, FontStyle.Bold)
  159.         write_log("Bot", "Anti-Admin: " & Anti_Admin, Color.Red, FontStyle.Bold)
  160.         write_log("Bot", "Channel wechseln: " & Channel_wechseln, Color.Red, FontStyle.Bold)
  161.         write_log("Bot", "James vollspammen: " & James_vollspammen, Color.Red, FontStyle.Bold)
  162.  
  163.         write_log("Bot", "Verbinde zum Chatsystem " & ComboBox_Chatsystem.Text & ".", Color.Green, FontStyle.Bold)
  164.  
  165.         write_log("Bot", "Versuche einzuloggen...", Color.Green, FontStyle.Bold)
  166.         write_log("Bot", "Logge " & Nickname & " in den Channel " & Channel & " ein. Nutze Proxy: " & proxy_nutzen, Color.Green, FontStyle.Bold)
  167.     End Sub
  168.  
  169.     Private Sub CheckBox_proxynutzen_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox_proxynutzen.CheckedChanged
  170.         If CheckBox_proxynutzen.Checked = True Then
  171.             proxy_nutzen = True
  172.             TextBox_proxy.Enabled = True
  173.         Else
  174.             proxy_nutzen = False
  175.             TextBox_proxy.Enabled = False
  176.         End If
  177.     End Sub
  178.  
  179.     Private Sub RichTextBox_chatlog_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox_chatlog.TextChanged
  180.         RichTextBox_chatlog.ScrollToCaret()
  181.     End Sub
  182.  
  183.     Private Sub Button_logout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_logout.Click
  184.         client.Disconnect()
  185.     End Sub
  186. End Class
Add Comment
Please, Sign In to add comment