Jump to content

[Open Source Project] WoW Auto-Caster-Lite-


Krypton88
 Share

Recommended Posts

Hey all, I wanted to make a small simple program, It started off as just a private program because I got tired of spamming multiple spells with my Blood elf Paladin, So, I made a "lite" Version of an Auto caster, But since I learned a few different AutoIT functions making it that are useful in other projects like programs that support Opening/Writing/Reading Config.ini files. So I decided to put a little more time into the project and release it as a Open-Source learning project! Ive had a few PM's with question on how to do a few things in AutoIT and how to set them up. Well for those of you new to AutoIT this is a perfect openSource project for you to look over! It casts spells down to the Milli-Second of the global cool down which casts spells about 3 times faster than you can do it with your fingers! Although it doesnt support packets or memory reading yet because this is the "lite" version it does support Config.ini files so you can save your settings. Also, it has a built in "GUI_SKIN" Which the #include is in the .rar with the source, But you can find the XSkin.au3 on the AutoIT forums Here: Skin your GUI and Buttons! So ENjoy this project and Feel Free to Edit/Use the Script in your own projects. All I ask is that you credit me if you do use any of my code :) [This post was copied from my post at MMOWNED.com ]

Posted Image

#cs==============================================================================|
///////////////////////// AutoITV3 BETA-/////////////////////////////////////////|
//  Author: Krypton88@MMOWNED and Owner of KryptonWorkz.info/////////////////////|
//  Program: World Of WarCraft Auto-Caster (Fully Customizable)//////////////////|
//  Version: 1.0 ////////////////////////////////////////////////////////////////|
//  Type: OPEN SOURCE!///////////////////////////////////////////////////////////|
//  Notes: Thanks for downloading! This is a Small Project that I made on my/////|
// Free time! I originally made it for a small simple private program cuz ///////|
// I was sick of spamming spells, So I made a Fully Customizable program/////////|
// that casts spells Down to the Milli-Second of the global Cool-down! //////////|
// Meaning this program spams spells and buff's 3 times as fast as your hands!///|
// Making this very usful for grinding PLUS MORE EXP! and good for duels!////////|
// The faster you can cast spells the faster you can win right? /////////////////|
// Have Fun with it and Edit the Script if you want, Just respect me as//////////|
// the author and Credit me if you use this source on one of your projects :)////|
// Enjoy -Krypton88//////////////////////////////////////////////////////////////|
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#ce

The .EXE with Config Files etc, can be downloaded here(if ya want to try it out):

http://www.mediafire.com/imgbnc.php/917b41...aa63d4fa14g.jpg

Copy_of_wowautocast.au3

Edited by Krypton88
Link to comment
Share on other sites

Edit* The source code may need to have the Coords fixed to fit the GUI...I lost the fixed one for some reason...Did a full computer search and couldnt find it...dammit. Sry bout that but its not to much work, enjoy. I know this is basic code btw, but I learned alot of functions doing this like INI's files.

Link to comment
Share on other sites

IE ate my post so this is going to be my second time typing this. Wouldn't it be easier to simply make a /castsequence macro?

Internal changes:

I removed the section names to allow for easier access and expandability. I changed the $key1 and $nkey1 variables into an array so the routines that operate on these variables could be converted (more easily) into loops and to allow for easier code maintenance and expandability. I changed the many lines of the same code for different variables into loops. I merged the hotkey functions into one that allows for any {NUMPAD#} hotkey to call it as long as the $keys[][] array has enough elements to support it. The message loop was using both switch and select statements to test the message when only switch were necessary. There are probably other changes. I removed the dependency on EzSkin.au3, I don't have that file. #AutoIt3Wrapper_Add_Constants gave me errors but I'm probably using an old version of whatever gave the errors.

External changes:

Only one ini file is used now. Only one was needed because

You can stop the 'spell casting' mid-sequence by hitting any of the NUMPAD hotkeys again.

The Sleep() times between the 'spell casts' have been randomized a little.

Changed "Non-combat Buff's" into "Non-combat Buffs"

Recommendations:

Remove the exit button, there is already a button to do that.

Switch the locations of the 'spells' input boxes. Currently NUMPAD2 is on the left and NUMPAD1 is on the right.

It really doesn't have a lot to do with WoW. It just sends keys to the active window with a delay between each input field. You could remove the references to WoW to make it more of a general tool.

The global cooldown for rogues and cat-form druids is lower so people might want to change the Sleep(Random()) line in the script to better suit their needs.

I generally try to avoid superfluous code so I removed constructs like:

While 1
    ;code
    ExitLoop
WEndoÝ÷ Ù8^­æ«zèm¦åÊj+zX§zÊr^¶­j·§¢ÙÞy×jëh×6#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Documents and Settings\J\My Documents\My Pictures\autoicon.ico
;~ #AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs==============================================================================|
///////////////////////// AutoITV3 BETA-/////////////////////////////////////////|
//  Author: Krypton88@MMOWNED and Owner of KryptonWorkz.info/////////////////////|
//  Program: World Of WarCraft Auto-Caster (Fully Customizable)//////////////////|
//  Version: 1.0 ////////////////////////////////////////////////////////////////|
//  Type: OPEN SOURCE!///////////////////////////////////////////////////////////|
//  Notes: Thanks for downloading! This is a Small Project that I made on my/////|
// Free time! I originally made it for a small simple private program cuz ///////|
// I was sick of spamming spells, So I made a Fully Customizable program/////////|
// that casts spells Down to the Milli-Second of the global Cool-down! //////////|
// Meaning this program spams spells and buff's 3 times as fast as your hands!///|
// Making this very usful for grinding PLUS MORE EXP! and good for duels!////////|
// The faster you can cast spells the faster you can win right? /////////////////|
// Have Fun with it and Edit the Script if you want, Just respect me as//////////|
// the author and Credit me if you use this source on one of your projects :)////|
// Enjoy -Krypton88//////////////////////////////////////////////////////////////|
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#ce
; *** Start added by AutoIt3Wrapper ***
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; *** End added by AutoIt3Wrapper ***
#include <GUIConstants.au3>
#include <Misc.au3>
;~ #include <EzSkin.au3>
;===================================================================================|
; ---GUI CREATION-------------------------------------------------------------------|
;===================================================================================|
;$Form1 = GUICreate("WoW Auto-Caster V1.0", 250, 215, 193, 125)
;~ $EzGUI = EzSkinGUICreate("MyEzSkinDemo",250,215)
;~ $EzIcon = EzSkinIcon($EzGUI)
GUICreate("MyEzSkinDemo",250,215)
$Label1 = GUICtrlCreateLabel("Krypton's WoW Auto-Caster V1.0", 45, 8, 168, 17)
$Status = GUICtrlCreateLabel("Finding WoW.exe.....                    ", 40, 50, 170, 20, $SS_CENTER, $WS_EX_CLIENTEDGE)
$myexit = GUICtrlCreateButton("Exit Auto-Cast", 64, 160, 113, 25, 0, $WS_EX_CLIENTEDGE)
$ksave = GUICtrlCreateButton("Save Settings", 64, 185, 112, 25, 0, $WS_EX_CLIENTEDGE)
$Label2 = GUICtrlCreateLabel("HOTKEYS", 85, 104, 63, 17, $SS_CENTER)
$Label3 = GUICtrlCreateLabel("::Combat Spam::..   NUM Key-1", 47, 120)
$Label4 = GUICtrlCreateLabel("::Non-Combat::....    NUM Key-2", 47, 136)
$Combatlabel = GUICtrlCreateLabel("Combat Spells------------->>", 83, 68)
$Combatlabel = GUICtrlCreateLabel("<<-------------Non-Combat Buffs", 45, 84)
;===========================================================================================================|
; Program Reads the Settings in the ini file, Default settings are 1,2,3,4,5,6,7,8--------------------------|
;===========================================================================================================|
$inifile = "spells.ini"
Dim $keys[2][8]
$keys[0][0] = GUICtrlCreateInput(IniRead($inifile, 0, 0, ""), 220, 10, 25, 20)
$keys[0][1] = GUICtrlCreateInput(IniRead($inifile, 0, 1, ""), 220, 35, 25, 20)
$keys[0][2] = GUICtrlCreateInput(IniRead($inifile, 0, 2, ""), 220, 60, 25, 20)
$keys[0][3] = GUICtrlCreateInput(IniRead($inifile, 0, 3, ""), 220, 85, 25, 20)
$keys[0][4] = GUICtrlCreateInput(IniRead($inifile, 0, 4, ""), 220, 110, 25, 20)
$keys[0][5] = GUICtrlCreateInput(IniRead($inifile, 0, 5, ""), 220, 135, 25, 20)
$keys[0][6] = GUICtrlCreateInput(IniRead($inifile, 0, 6, ""), 220, 160, 25, 20)
$keys[0][7] = GUICtrlCreateInput(IniRead($inifile, 0, 7, ""), 220, 185, 25, 20)
$keys[1][0] = GUICtrlCreateInput(IniRead($inifile, 1, 0, ""), 4, 10, 25, 20)
$keys[1][1] = GUICtrlCreateInput(IniRead($inifile, 1, 1, ""), 4, 35, 25, 20)
$keys[1][2] = GUICtrlCreateInput(IniRead($inifile, 1, 2, ""), 4, 60, 25, 20)
$keys[1][3] = GUICtrlCreateInput(IniRead($inifile, 1, 3, ""), 4, 85, 25, 20)
$keys[1][4] = GUICtrlCreateInput(IniRead($inifile, 1, 4, ""), 4, 110, 25, 20)
$keys[1][5] = GUICtrlCreateInput(IniRead($inifile, 1, 5, ""), 4, 135, 25, 20)
$keys[1][6] = GUICtrlCreateInput(IniRead($inifile, 1, 6, ""), 4, 160, 25, 20)
$keys[1][7] = GUICtrlCreateInput(IniRead($inifile, 1, 7, ""), 4, 185, 25, 20)
GUISetState()
;===================================================================================|
;Hot Key's you can set this to whatever you like! I personally like {NUMPAD} keys..-|
;===================================================================================|
$casting = False
HotKeySet("{NUMPAD1}", "castspells")
HotKeySet("{NUMPAD2}", "castspells")
;====================================================================================|
;If WoW Window Exists Show that Auto-Cast is ready!----------------------------------|
;====================================================================================|
If WinExists("World of Warcraft") Then
    GUICtrlSetData($Status, "Found WoW! Auto-Cast is Ready!")
Else
    GUICtrlSetData($Status, "WoW.exe Not Found...")
EndIf

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $myexit
            Exit
        Case $ksave
            For $i = 0 To UBound($keys, 1)-1
                For $j = 0 To UBound($keys, 2)-1
                    IniWrite($inifile, $i, $j, GUICtrlRead($keys[$i][$j]))
                Next
            Next
    EndSwitch
WEnd

Func castspells()
    Local $column = StringRegExp(@HotKeyPressed, "(?i)\{NUMPAD([0-9])\}", 1)
    If @error Or $column[0] > UBound($keys, 1) Then _
        Return MsgBox(0, @HotKeyPressed, "Assertion failed at line: "&@ScriptLineNumber)
    $column = $column[0]-1
;~  If GUICtrlRead($keys[$column][0]) = "" Then _
;~      MsgBox(1, "Error", "Minimum of 3 spells are Required for Auto-Cast to work!")
;~  If GUICtrlRead($keys[$column][1]) = "" Then _
;~      MsgBox(1, "Error", "Minimum of 3 spells are Required for Auto-Cast to work!")
;~  If GUICtrlRead($keys[$column][2]) = "" Then _
;~      MsgBox(1, "Error", "Minimum of 3 spells are Required for Auto-Cast to work!")
    $casting = Not $casting
    For $i = 0 To UBound($keys, 2)-1
        If Not $casting Then ExitLoop
        Send(GUICtrlRead($keys[$column][$i]))
        Sleep(Random(1550, 1700, 1))
    Next
    $casting = False
EndFunc
Cool stuff.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...