• Log in or sign up for an account here: https://www.sythe.org/login

Basic help

Burden

Apprentice
Joined
Dec 30, 2008
Sythe Gold
0
Messages
894
Basic help
I am working on this for a game I play were I will have kick power, since I am lazy.

2iaeyi8.png


I set up the boxes ect as I did always in VB6, however this time in .NET, I don't have the code for the stuff I setup, I only have this.


Code:
Public Class form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub sendButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendButton.Click

    End Sub
End Class

How do I set values to each listbox item, and the button onClick to use sendkeys to type?

Also, how can I have a hotkey for this that will activate in the background and type in the currently open window?

Many <3's, this is a lot different than VB6...
 
Member of the Month Winner
Sythe's 10th Anniversary
Basic help
I am working on this for a game I play were I will have kick power, since I am lazy.

2iaeyi8.png


I set up the boxes ect as I did always in VB6, however this time in .NET, I don't have the code for the stuff I setup, I only have this.


Code:
Public Class form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub sendButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendButton.Click

    End Sub
End Class

How do I set values to each listbox item, and the button onClick to use sendkeys to type?

Also, how can I have a hotkey for this that will activate in the background and type in the currently open window?

Many <3's, this is a lot different than VB6...

It isn't very different at all. It is actually easier.

I suggest you look up how to use Hashtables for the values, and use the text of the list item as the hash key. Hashtables are like arrays, except rather than accessing the elements of the array with the number of the element, the "key" is what you use to get the values rather than a number. The key us generally a string.

SendKeys is deprecated and SendMessage is better (but a lot harder), but in .Net you would use SendKeys.Send().

For hotkeys, look up methods on checking whether or not keys have been pressed, or look up the RegisterHotKey() API.
 
Basic help
Thanks so much.

Ok, so I have this set up:

Code:
SendKeys.Send("` " & (userBox.Text) " " & (infList.Text) & (levelList.Text))
The bolded part has an error.
Comma, ), or a continued expression expected.
Also, could I just use
Code:
SendKeys.Send(key combination for alt+Tab here.)
?
 
Basic help
There is no bolded part. But this should work:
Code:
SendKeys.Send("` " & (userBox.Text) & " " & (infList.Text) & (levelList.Text))

You forgot an "&".

EDIT: Swan! Stop saying this is easier, before I rip off your face.
 
Basic help
There is no bolded part. But this should work:
Code:
SendKeys.Send("` " & (userBox.Text) & " " & (infList.Text) & (levelList.Text))
You forgot an "&".

EDIT: Swan! Stop saying this is easier, before I rip off your face.
Oh, jeeze that was a dumb mistake, many thanks.

EDIT: Now it sends a million things to the kicklog.txt, and freezes.
I don't see where/why it should be looping, and it also that I know of isn't typing out the command.
EDIT: Here's my updated code.

Imports System.IO
Public Class form1

Dim Sx As IO.TextWriter
Dim SR As StreamReader
Dim SW As StreamWriter


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub sendButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendButton.Click
Sx = IO.File.AppendText("C:\KickLog.txt")
Sx.WriteLine("Person Kicked: " & (userBox.Text))
Sx.WriteLine("Reason: " & (infList.Text) & (levelList.Text))
Sx.WriteLine("")
Sx.Flush()
Sx.Close()

SendKeys.Send("` " & (userBox.Text) & " " & (infList.Text) & (levelList.Text))



End Sub
End Class
 
Member of the Month Winner
Sythe's 10th Anniversary
Basic help
There is no bolded part. But this should work:
Code:
SendKeys.Send("` " & (userBox.Text) & " " & (infList.Text) & (levelList.Text))

You forgot an "&".

EDIT: Swan! Stop saying this is easier, before I rip off your face.
But it is easier. Very much so. Lrn2OOP :D
 
Basic help
I can't see why it would loop either. :\

EDIT: What the hell does "Sx.Flush()" do? Try commenting out that line, I don't know why it's there. (BACK IT UP!)

-

But it is easier. Very much so. Lrn2OOP :D
lrn2ControlArray
 
Member of the Month Winner
Sythe's 10th Anniversary
Basic help
I can't see why it would loop either. :\

EDIT: What the hell does "Sx.Flush()" do? Try commenting out that line, I don't know why it's there. (BACK IT UP!)

-


lrn2ControlArray
StreamWriter.Flush() flushes the data from the stream.

And also, control arrays? That useless feature? What are you talking about?
 
Basic help
Oh, my.
FIGHT!

I'll try commenting it out and edit what it does in.
I'm pretty sure that will kill the entire write to text file though.
 
Runescape Gamblingrunescape gambling
Back
Top