Results 1 to 1 of 1

Thread: Ole Skool AutoIt 3 - No API just simple keyboard

  1. #1

    Ole Skool AutoIt 3 - No API just simple keyboard

    Well I have moved on from this, so for future coders... I give you "Macro 2". I kept it simple, this is not what you would call a bot. I used this for multi-boxing. However it is versatile and can be used on ANY Windows game. The MAC.TXT setup file is included. If you trust me this is the link for the binaries:

    http://www.fileden.com/files/2009/4/...ro%202.exe.zip No BS, wait, or ads direct link to zip.
    Program in AutoIt 3
    Code:
    $Wintitle = InputBox ("Welcome to Macro 2","Enter Window Name:")
    
    If Not WinExists($Wintitle) Then
        MsgBox(0, "", "Please run " & $Wintitle & @CRLF & "then click OK.")
    EndIf
    ;Idiot proofing
    If Not WinExists($Wintitle) Then
        Exit
    EndIf
    ;read setup file
    $file = FileOpen ("MAC.TXT",0)
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro1")
    $mac1 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro2")
    $mac2 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro3")
    $mac3 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro4")
    $mac4 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro5")
    $mac5 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro6")
    $mac6 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro7")
    $mac7 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro8")
    $mac8 = $macro [2]
    $mask = FileReadLine ($file)
    $macro = StringSplit ($mask,":")
    HotKeySet ($macro [1],"macro9")
    $mac9 = $macro [2]
    ;set default variables
    $pc1 = 0
    $time1 = 0
    $pc2 = 0
    $time2 = 0
    $pc3 = 0
    $time3 = 0
    $pc4 = 0
    $time4 = 0
    $pc5 = 0
    $time5 = 0
    $pc6 = 0
    $time6 = 0
    $pc7 = 0
    $time7 = 0
    $pc8 = 0
    $time8 = 0
    ;read Auto Macros
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time1 = $m[1]
    	$pc1 = $m[2]
    	$keys1 = $m[3]
    EndIf
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time2 = $m[1]
    	$pc2 = $m[2]
    	$keys2 = $m[3]
    EndIf	
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time3 = $m[1]
    	$pc3 = $m[2]
    	$keys3 = $m[3]
    EndIf
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time4 = $m[1]
    	$pc4 = $m[2]
    	$keys4 = $m[3]
    EndIf	
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time5 = $m[1]
    	$pc5 = $m[2]
    	$keys5 = $m[3]
    EndIf
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time6 = $m[1]
    	$pc6 = $m[2]
    	$keys6 = $m[3]
    EndIf	
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time7 = $m[1]
    	$pc7 = $m[2]
    	$keys7 = $m[3]
    EndIf
    $mask = FileReadLine ($file)
    $m = StringSplit ($mask,":") 
    If $m[0] = 3 Then
    	$time8 = $m[1]
    	$pc8 = $m[2]
    	$keys8 = $m[3]
    EndIf	
    FileClose ($file)
    ;Timers
    $skill1 = TimerInit()
    $skill2 = TimerInit()
    $skill3 = TimerInit()
    $skill4 = TimerInit()
    $skill5 = TimerInit()
    $skill6 = TimerInit()
    $skill7 = TimerInit()
    $skill8 = TimerInit()
    
    ;Automation Toggle
    $Toggle = False
    HotKeySet ("0","Auto_Attack")
    
    ;Program Loop
    While 1
    	Unstick ()
    	If $Toggle Then
    		Sleep (50)
    		Skill_Check ()
    	EndIf
    	Sleep (random (250,1000,1))
    WEnd
    
    ;Functions
    Func Unstick ()
    	$dll = DllOpen("user32.dll")
    	$vkvalue = 16
    	;DllCall to unstick shift key as it gets stuck somehow.
    	DllCall($dll,"int","keybd_event","int",$vkvalue,"int",0,"long",2,"long",0) 
    	DllClose($dll)
    EndFunc
    
    Func Skill_Check ()
    		$percent = Random (1,100,1)
    		If Int (TimerDiff ($skill1)/1000) > $time1 and $percent <= $pc1 Then
    			ControlSend ($Wintitle,"","",$keys1)
    			$skill1 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill2)/1000) > $time2 and $percent <= $pc2 Then
    			ControlSend ($Wintitle,"","",$keys2)
    			$skill2 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill3)/1000) > $time3 and $percent <= $pc3 Then
    			ControlSend ($Wintitle,"","",$keys3)
    			$skill3 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill4)/1000) > $time4 and $percent <= $pc4 Then
    			ControlSend ($Wintitle,"","",$keys4)
    			$skill4 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill5)/1000) > $time5 and $percent <= $pc5 Then
    			ControlSend ($Wintitle,"","",$keys5)
    			$skill5 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill6)/1000) > $time6 and $percent <= $pc6 Then
    			ControlSend ($Wintitle,"","",$keys6)
    			$skill6 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill7)/1000) > $time7 and $percent <= $pc7 Then
    			ControlSend ($Wintitle,"","",$keys7)
    			$skill7 = TimerInit()
    		EndIf
    		If Int (TimerDiff ($skill8)/1000) > $time8 and $percent <= $pc8 Then
    			ControlSend ($Wintitle,"","",$keys8)
    			$skill8 = TimerInit()
    		EndIf
    EndFunc
    
    Func Auto_Attack ()
    	$Toggle = Not $Toggle
    EndFunc
    
    Func macro1 ()
    	ControlSend($Wintitle,"","",$mac1)
    	$Toggle = False
    EndFunc
    
    Func macro2 ()
    	ControlSend($Wintitle,"","",$mac2)
    	$Toggle = False
    EndFunc
    
    Func macro3 ()
    	ControlSend($Wintitle,"","",$mac3)
    	$Toggle = False
    EndFunc
    
    Func macro4 ()
    	ControlSend($Wintitle,"","",$mac4)
    	$Toggle = False
    EndFunc
    
    Func macro5 ()
    	ControlSend($Wintitle,"","",$mac5)
    	$Toggle = False
    EndFunc
    
    Func macro6 ()
    	ControlSend($Wintitle,"","",$mac6)
    	$Toggle = False
    EndFunc
    
    Func macro7 ()
    	ControlSend($Wintitle,"","",$mac7)
    	$Toggle = False
    EndFunc
    
    Func macro8 ()
    	ControlSend($Wintitle,"","",$mac8)
    	$Toggle = False
    EndFunc
    
    Func macro9 ()
    	ControlSend($Wintitle,"","",$mac9)
    	$Toggle = False
    EndFunc
    Set up file saved in same folder as MAC.TXT
    Code:
    {Numpad1}:Hello{space}World!{enter}
    {Numpad2}:The rain in Spain falls{enter}Mainly on the plains. 
    {Numpad3}:You pressed 2 no really you did...
    {Numpad4}:078-66-2089 is not my social security number
    {Numpad5}:F is the same as +f
    {Numpad6}:nothing here
    {Numpad7}:
    {Numpad8}:see 7 does nothing
    {Numpad9}:^o
    10:50:Apple
    5:100:1{enter}
    20:90:{backspace}
    15:100:Another 15 seconds has past by,
    60:100:The format is <delay> in seconds{space}
    70:100:{space}followed by <chance in %>{space}
    80:100:{space}then the <string> to send.
    0:0:This line will never appear.
    
    The program only reads in 17 lines and stops. So I can tell you all about the gibberish above here. The first 9 lines are "Hotkey macros" in the format;
    <HotKey>:<string>
    As you can see above numpad 7 does nothing but you MUST use all 9 lines. Even if you don't have that many macros to record. For special characters (^=CTRL) use the AutoIt 3 help file under sendkeys.
    
    The last 8 macros are automated or auto attack macros. The first line wait 10 seconds and then only 50% of the time will type "Apple". The next line waits 5 seconds and sends 1 followed by a CRLF. The every 20 seconds 90% of the time the program sends a backspace. 
    
    Ok now run a Notepad then run Macro2. When prompted for the name type; Untitled - Notepad and then the hotkeys will function. Zero on the top row toggles the automation keys.
    
    For Guild Wars try this format;
    {Numpad1}:c{space}12
    {Numpad2}:v{space}
    {Numpad3}:;{space}
    {Numpad4}:v1
    {Numpad5}:v2
    {Numpad6}:78
    {Numpad7}:124
    {Numpad8}:36
    {Numpad9}:57
    5:100:v1
    20:50:2
    10:25:3
    52:100:4
    0:0:5
    0:0:6
    0:0:7
    0:0:8
    
    Basically this is an old N/Mo build I used when I was boxing. I could hit zero and he would be casting healing breaze (until they nerfed it) on me while I fought and about every 10 seconds 25% he would raise up minions. You have to learn to hold off a bit or your guy will quickly lose his energy in a fight.
    
    Remember to have no whitespace at the top of your file. 
    
    ~~~ 16bit

    I still play Guild Wars and I still multibox. I just don't use Windows anymore, I am running 100% Linux now and it seems to handle things much better. Hope you enjoy this little proggy as much as I did making and using it.
    Last edited by 16bit; 09-21-2012 at 10:21 PM. Reason: Error in upload, fixed :D

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •