01-27-2006, 01:55 AM
|
#1 (permalink)
|
|
I hate Steve Jobs.
Senior MemberGold Member   Enlightened
Join Date: Jun 2005
Location: Fullerton, CA
Posts: 3,132
|
[Tutorial] Making a Simple Macro in VB6
Quote:
|
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.
Quote:
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:
Code:
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:
Code:
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:
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:
Code:
Private Sub tmrLag_timer()
If GetAsyncKeyState(vbKeyHome) Then
Sendkeys “1539285923589462366432638674876376346738673896437673468367486”
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:
Code:
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.
__________________
Last edited by lpxxfaintxx : 01-27-2006 at 02:48 AM.
|
|
|