VB Closing problems menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    Krillere's Avatar Contributor
    Reputation
    112
    Join Date
    Nov 2007
    Posts
    668
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    VB Closing problems

    Hello, im learning VB, and im trying to remake Krilleres Spam'o matic into VB (it was AutoIt before) Now its iZpam ( I know.. New language = New name! ) Im adding some new stuff and so, but im having some troubles.

    Heres the source of the "main" form.

    Code:
    Public Class Form1
    
        Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
        
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' ReadMe
            System.Diagnostics.Process.Start("C:\Users\Sørensen\Documents\Visual Studio 2008\Projects\Newtry\ReadMe.txt")
        End Sub
    
        Private Sub ButtonW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonW.Click ' Whisper Knap
            AppActivate("World of Warcraft")
    
            Do
                SendKeys.Send("{Enter}")
                Sleep(150)
                SendKeys.Send("{/}")
                Sleep(150)
                SendKeys.Send("w ")
                SendKeys.Send(TextBox13.Text)
                Sleep(100)
                SendKeys.Send(" ")
                SendKeys.Send(TextBox12.Text)
                SendKeys.Send("{Enter}")
                Sleep(TextBox11.Text * 1000)
            Loop
        End Sub
    
        Private Sub Button124_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button124.Click ' /1 /2 & /4
    
            If RadioButton1.Checked Then ' General
                AppActivate("World of Warcraft")
                Do
                    SendKeys.Send("{Enter}")
                    Sleep(100)
                    SendKeys.Send("{/}")
                    Sleep(150)
                    SendKeys.Send("1 ")
                    SendKeys.Send(TextBox1.Text)
                    Sleep(100)
                    SendKeys.Send("{Enter}")
                    Sleep(TextBox1.Text * 1000)
                Loop
            End If
    
            If RadioButton2.Checked Then ' Trade
                AppActivate("World of Warcraft")
                Do
                    SendKeys.Send("{Enter}")
                    Sleep(100)
                    SendKeys.Send("{/}")
                    Sleep(150)
                    SendKeys.Send("2 ")
                    SendKeys.Send(TextBox2.Text)
                    Sleep(100)
                    SendKeys.Send("{Enter}")
                    Sleep(TextBox1.Text * 1000)
                Loop
            End If
            If RadioButton3.Checked Then ' LFG
                AppActivate("World of Warcraft")
                Do
                    SendKeys.Send("{Enter}")
                    Sleep(100)
                    SendKeys.Send("{/}")
                    Sleep(150)
                    SendKeys.Send("4 ")
                    SendKeys.Send(TextBox2.Text)
                    Sleep(100)
                    SendKeys.Send("{Enter}")
                    Sleep(TextBox1.Text * 1000)
                Loop
            End If
    
        End Sub
    
        Private Sub ButtonY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonY.Click ' Yell
            AppActivate("World of Warcraft")
    
            Do
                SendKeys.Send("{Enter}")
                Sleep(100)
                SendKeys.Send("{/}")
                Sleep(150)
                SendKeys.Send("y ")
                SendKeys.Send(TextBox4.Text)
                SendKeys.Send("{Enter}")
                Sleep(TextBox3.Text * 1000)
            Loop
    
        End Sub
    
        Private Sub ButtonE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonE.Click ' Emote
            AppActivate("World of Warcraft")
    
            Do
                SendKeys.Send("{Enter}")
                Sleep(150)
                SendKeys.Send("{/}")
                Sleep(150)
                SendKeys.Send(TextBox6.Text)
                SendKeys.Send("{Enter}")
                Sleep(TextBox5.Text * 1000)
            Loop
        End Sub
    
        Private Sub ButtonRW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRW.Click ' Raid Warning
            AppActivate("World of Warcraft")
    
            Do
                SendKeys.Send("{Enter}")
                Sleep(150)
                SendKeys.Send("{/}")
                Sleep(150)
                SendKeys.Send("rw ")
                SendKeys.Send(TextBox8.Text)
                SendKeys.Send("{Enter}")
                Sleep(TextBox7.Text * 1000)
            Loop
        End Sub
    
        Private Sub ButtonN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonN.Click ' Normal
            AppActivate("World of Warcraft")
    
            Do
                SendKeys.Send("{Enter}")
                SendKeys.Send(TextBox10.Text)
                SendKeys.Send("{Enter}")
                Sleep(TextBox9.Text * 1000)
            Loop
        End Sub
        Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Integer
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Dim Hotkey1 As Boolean
            Hotkey1 = GetAsyncKeyState(Keys.F10)
            If Hotkey1 = True Then
                Me.Close()
                Form2.Close()
                Browser.Close()
            End If
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Form2.Show()
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Browser.Show()
        End Sub
    End Class
    Problem 1. Sometimes when i choose a spam-type it crashes with some weird errors, you have to see them because i get them in danish and errors like that is hard to translate.

    Problem 2. I cant make it close with the Hotkey. Dont know whats wrong there

    Problem 3. Sometimes it cant find the application "World of Warcraft" Even tho its running on my computer.

    You can try it yourself here just to see.

    Download Link:
    Krilleres iZpam VB.rar
    (Dont press the ReadMe, theres no ReadMe so a waste of time xD )

    Picture:



    Viruscheck:
    Virustotal. MD5: f79b427bf9f6bde8c62d9390fbc37608

    (First time i didnt get ANY positives. Yay!)

    VB Closing problems
  2. #2
    Krillere's Avatar Contributor
    Reputation
    112
    Join Date
    Nov 2007
    Posts
    668
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, no help? Thanks..

  3. #3
    JoeBiden's Avatar Contributor
    Reputation
    153
    Join Date
    Aug 2007
    Posts
    498
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tell us the error, i understand danish

  4. #4
    buzzaugust's Avatar Contributor
    Reputation
    139
    Join Date
    Jun 2007
    Posts
    141
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Me too. Whats the actual error?
    Eventually add my msn:
    [email protected]

  5. #5
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Krillere View Post
    Problem 1. Sometimes when i choose a spam-type it crashes with some weird errors, you have to see them because i get them in danish and errors like that is hard to translate.
    I see nowhere to choose what spam type to use.

    Problem 2. I cant make it close with the Hotkey. Dont know whats wrong there
    Because .NET doesn't have the same hotkey ability that AutoIt does. You'll need to look up how to register a global hotkey. (pinvoke.net: RegisterHotKey (user32)) Look for example code on how to actually work with the hotkey.

    Problem 3. Sometimes it cant find the application "World of Warcraft" Even tho its running on my computer.
    Because AppActivate sucks. Use proper .NET stuff. (And Win32 API. pinvoke.net: SetForegroundWindow (user32)) That will make sure WoW gets sent to the front no matter where it is. (Minimized, maximized, hidden under windows, etc)


    Also, there's NO REASON to import Sleep as a PInvoke signature.

    System.Threading.Thread.Sleep(int millisecs);

  6. #6
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +1 Apoc, you can also use this, it make your application don't freeze while sleep :

    Public Shared Sub xWait(ByVal MilsecToWait As Long)
    Dim lngEndingTime As Long
    lngEndingTime = GetTickCount() + (MilsecToWait)
    Do While GetTickCount() < lngEndingTime
    Application.DoEvents()
    Loop
    End Sub
    and use xWait(millisecs)

  7. #7
    JoeBiden's Avatar Contributor
    Reputation
    153
    Join Date
    Aug 2007
    Posts
    498
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JuJuBoSc View Post
    +1 Apoc, you can also use this, it make your application don't freeze while sleep :



    and use xWait(millisecs)
    Yep, same as I use for my account checker, lil diferent though

  8. #8
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Go read up about how to actually use threads properly.

    You should never do long work cycles on the main GUI thread. Instead, spawn a new thread, and do your work there. (How do you think I got STS to do 40 things at once without ever freezing the GUI?)

Similar Threads

  1. Problem with CE.
    By Eldretch in forum World of Warcraft General
    Replies: 1
    Last Post: 08-08-2006, 06:49 PM
  2. realm list problem
    By robtuner in forum World of Warcraft General
    Replies: 2
    Last Post: 07-21-2006, 09:08 AM
  3. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
  4. wow emu problem
    By bezike in forum World of Warcraft General
    Replies: 0
    Last Post: 07-09-2006, 04:45 PM
  5. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
All times are GMT -5. The time now is 07:31 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search