Anyways i think i'm almost there, and now i need some once help to fix a few errors. Please look at this peace of code =)
Imports:
Code:
Imports System.IO Imports System.Net Imports System.Net.Sockets Imports System.Threading Imports Microsoft.VisualBasic Imports System.Text Imports System.Runtime.InteropServices
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub Connect( _
ByVal host As String, _
ByVal port As Integer _
)
End Sub
Public Function Send( _
ByVal buffer As Byte(), _
ByVal offset As Integer, _
ByVal size As Integer, _
ByVal socketFlags As SocketFlags, _
<OutAttribute()> ByRef errorCode As SocketError _
) As Integer
End Function
Public Shared Function hotkeySend1(ByVal Pro As Socket) As Integer
Dim msg As Byte() = Encoding.ASCII.GetBytes("00 0C 00 23 62 65 61 6D 20 6D 65 20 75 70")
Dim bytes(4) As Byte
Try
Dim byteCount As Integer = Pro.Send(msg, 0, msg.Length, SocketFlags.None)
byteCount = Pro.Receive(bytes, 0, Pro.Available, SocketFlags.None)
Catch e As SocketException
Return e.ErrorCode
End Try
Return 0
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim Pro As Socket =
Dim host As String
Dim port As Integer
Dim msg As Byte() = Encoding.ASCII.GetBytes("00 0C 00 23 62 65 61 6D 20 6D 65 20 75 70")
Dim bytes(4) As Byte
Dim hotkey1 As Boolean
Dim hotkey2 As Boolean
Dim hotkey3 As Boolean
Dim hotkey4 As Boolean
hotkey1 = GetAsyncKeyState(Keys.NumPad1)
hotkey2 = GetAsyncKeyState(Keys.NumPad2)
hotkey3 = GetAsyncKeyState(Keys.NumPad3)
hotkey4 = GetAsyncKeyState(Keys.NumPad5)
host = ("213.152.3.5")
port = 2000
If hotkey1 = True Then
Pro.Connect(host, port)
Pro.Send(msg, 0, msg.Length, SocketFlags.None)
End If
End Sub
Code:
Error 1 Expression expected. C:\Documents and Settings\Qvintus\Skrivebord\VB\EL\EL Fruit Master\EL Fruit Master\Form1.vb 75 27 EL Fruit Master Error 2 Name 'Pro' is not declared. C:\Documents and Settings\Qvintus\Skrivebord\VB\EL\EL Fruit Master\EL Fruit Master\Form1.vb 92 13 EL Fruit Master Error 3 Name 'Pro' is not declared. C:\Documents and Settings\Qvintus\Skrivebord\VB\EL\EL Fruit Master\EL Fruit Master\Form1.vb 93 13 EL Fruit Master
Code:
Error 1 Method 'Private Sub Timer1_Tick(Pro As System.Net.Sockets.Socket, sender As Object, e As System.EventArgs)' cannot handle event 'Public Event Tick(sender As Object, e As System.EventArgs)' because they do not have a compatible signature. C:\Documents and Settings\Qvintus\Skrivebord\VB\EL\EL Fruit Master\EL Fruit Master\Form1.vb 74 125 EL Fruit Master






