PDA

View Full Version : [Tutorial] Making a Simple Macro in VB6



lpxxfaintxx
01-26-2006, 05:55 PM
Writing a Macro Program in VB6
By lpxxfaintxx

Requirements: Basic knowledge of VB6 and English.
You will learn to: Make a simple macro program, pause between messages, make a simple/ghetto whisper bomb and make a ghetto lag macro.

Tools Needed: VB6, and preferably a color hack.


macro (m k r )
n. Computer Science pl. mac•ros
1. A single, user-defined command that is part of an application and executes a series of commands.

2. A shorthand representation for a number of lines of code.
In other words, a program which can send “stuff(s)” with only a single command.

Method that will be used: Sendkeys.

1. Make 3 option buttons.

2. Name the first one: optMacro1 and name the second one: optMacro2 and the third one: optMacro3

3. Make a new timer. Keep the name for now, and change the interval to 100

4. Enter the following code all the way at the top:


Option Explicit
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Integer
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Function Pause(intDelay As Integer)
Dim msDelay As Integer, i As Integer, X As Integer
msDelay = intDelay * 1000
X = msDelay / 100
For i = 1 To X
Sleep (100)
DoEvents
Next
End Function



5. Enter the following code for Timer1:


Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyHome) Then ‘ Hotkey to activate the macro is home
If optMacro1.Value = True Then
Sendkeys “LPX is l337{enter}”
Elseif optMacro2.Value = True Than
Sendkeys “http://www.lpxxfaintxx.uni.cc {enter}”
Elseif optMacro3.Value = True Than
Sendkeys “How to use the pause function{enter}”
Pause (2) ‘Pauses for 2 seconds and then the macro below is triggered
Sendkeys “Im baaaaaack{enter}” ‘{enter} is the same as ~ | It triggers the “enter button” so that you don’t have to do it manually.
End If
End If ‘ Yes, 2 endifs
End Sub


6. You are basically done. Just change the captions and customize the macro. As you go along, you can make the program MUCH more complex.
7. Misc.
A) Making a whisper bomb for Starcraft
1. You must have 2 textboxes. One for the victim and one for the whisper message. Name them txtWhisper and txtWhisperMsg
2. Study this code:
SendKeys "{enter} /whisper " & Form1.txtWhisper.Text & " " & Form1.txtWhisperMsg.Text & "{enter}"
B) Making a lag macro
1. Make a completely new timer. Name it tmrLag
2. Set the interval to 1. NOT 100.
3. Enter this code:

Private Sub tmrLag_timer()
If GetAsyncKeyState(vbKeyHome) Then
Sendkeys “1539285923589462366432638674876376346738673896437 673468367486”
End Sub
Explanation: Since I have not added {enter} or ~, the numbers up there is not getting through. Setting the timer to interval of 1 makes the macro go faster causing your SC to lag, causing the whole SC game to lag.

YOU MUST HOLD ON TO HOME

C) Changing the hotkey
1. Simple. Anytime you see the code “If GetAsyncKeyState(vbKeyHome)” change the Home part to whatever you may choose. List of Keys Here
D) Incorporating the color hack with Starcraft.
1. Before you read any further, make sure that your color hack trigger (Lets say I have color.dll. To use it, I have to do #y (yellow text). # is your trigger) is compatible with VB6. For an example, if the trigger was ~, than if you did ~y (for yellow text) than the macro in SC would come out as, {enter} y (not colored. Remember, ~ = {enter}).
2. After you have found a color hack (there is no public one currently, as of 1/26/05) it is pretty simple. Study the following:
Sendkeys “~#l#l#l#l#l#l#l#l#l#l#l#l#l#c#wCheat Enabled~” (#l = new line; #w = centered text; #w = White Color) There is 11 lines in SC, therefore this message would simply come out as “Cheat Enabled” centered, and your name hidden.
F) To use macros in a Starcraft game, make sure you have ~ or {enter} in front and at the end of each macro. (First to open the text box, and then submit the macro).


Credits

The_Untouchable/DrinkBleach – Basic Info back in the old days :P (ok, not that old)
Dyndrilliac – The Pause Function
Forget anyone?


Sorry If some parts are hard to read/confusing. *First tutorial*

I am aware that Sendkeys Suck balls. Get over it.

Ganondorf
01-26-2006, 05:58 PM
It'd be nicer/easier to read if you uncommented it. Otherwise, thanks for the contribution.

lpxxfaintxx
01-26-2006, 06:01 PM
Hold on, im working it.. damn. Im never writing a tut on MSWord, it gets all messed up when I paste it.

NickF
01-26-2006, 06:31 PM
There is a tutorial section for this yuo know.

LCS
01-26-2006, 06:44 PM
Indy will kill you...
http://www.bwhacks.com/forums/showthread.php?t=11132

lpxxfaintxx
01-26-2006, 06:48 PM
Haha, oh well.

Lyagushkka
09-15-2009, 02:01 PM
Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

Suzi
09-15-2009, 06:41 PM
People say VB6 is the easiest langauge out of all even assembly. I beg to differ I didn't understand one piece of that code don't Matter anyway. I understand C++ more than that and I use assembly, if he is talking about making a simple text screen macro without the PublicText function or anykind of offset for messageing.

Anyway I just came up with a idea. A hack that spams your friendlist like this.

invoke BWPublicText, CTEXT ("/whisper I'm sexy as I can be")

Just putting that in a loop alone with own everyone in your friendlist useful for annoying others :D.

SC_Modder
09-15-2009, 07:21 PM
People say VB6 is the easiest langauge out of all even assembly. I beg to differ I didn't understand one piece of that code

:lol:

Suzi
09-16-2009, 03:22 AM
Whats funny? You only quoted 1 sentence, quote all if your gonna quote one.

-187-
09-16-2009, 04:46 AM
Whats funny? You only quoted 1 sentence, quote all if your gonna quote one.

He might think you're an idiot. :worried:

Suzi
09-16-2009, 12:48 PM
Its funny what I think of him and what I think of you well your a newb. For those of you don't know noob is not a word however newb is so yeah. Just to teach you some proper english.

-187-
09-16-2009, 06:53 PM
Its funny what I think of him and what I think of you well your a newb. For those of you don't know noob is not a word however newb is so yeah. Just to teach you some proper english.

Ok Promasser. :fine:

kill_urself[SA]
09-16-2009, 08:05 PM
:yeah:

SC_Modder
09-17-2009, 12:06 AM
:yeah:

btw ProMasser: Your whisper spam idea that you described will drop you from B.Net. You're about 10 years late in thinking that.

JeweyK
09-17-2009, 05:56 AM
Its funny what I think of him and what I think of you well your a newb. For those of you don't know noob is not a word however newb is so yeah. Just to teach you some proper english.

Hey, newb, it's "you're" not "your". Mr. English teacher.

Edit: Not to backseat moderate, and I love messing with Promasser, but this thread should be moved to flame board or closed because it was necroed by a porn bot. :(

SC_Modder
09-17-2009, 08:00 AM
Edit: Not to backseat moderate, and I love messing with Promasser, but this thread should be moved to flame board or closed because it was necroed by a porn bot. :(

This is true... messing with ProMasser can distract one from the greater meaning of things.

Closed.