Jump to content
Sign in to follow this  
blueskyspeedy

Need help... how to get this macro to work

Recommended Posts

blueskyspeedy

I want to make a macro for a game called 9Dragons, That macro just click on your skillbars to train up my skills...

But the problem is i dont know how to do it..

This is what I want, if "Skill 1" is checked then its ON and unchecked = off

If skill 1 = checked then it must repeat clicking "1" and if NOT checked it dont press it anymore

If skill 2 = checked then it must repeat clicking "2" and if NOT checked it dont press it anymore

If skill 3 = checked then it must repeat clicking "3" and if NOT checked it dont press it anymore

If skill 4 = checked then it must repeat clicking "4" and if NOT checked it dont press it anymore

If skill 5 = checked then it must repeat clicking "5" and if NOT checked it dont press it anymore

So for example: if skill 1 and skill 4 = checked, Then it will click "1" and "4" all the time.

And on the right u see a combobox "1 till 5" its for the cooldown that the macro will reclick it...

Example:

If selected 3 it will wait 3 seconds to reclick the buttom you want

If selected 5 it will wait 5 seconds to reclick the buttom you want

So for example:

If skill 2 and skill 3 = checked

then it will do this: "skill 1" is waiting 3 sec for reclicking on buttom "1" and "skill 4" is waiting 5 sec for reclicking on buttom "4"

Its clicking then this: buttom "1" (Reclick every 3 seconds) and buttom "4" (Reclick every 5 seconds)

Thats what i want to do;

I really need HELP!! =(

Here is the code what i have;

#NoTrayIcon
#include <GUIConstants.au3>
#include <Constants.au3>
#include <Date.au3>
#include <INet.au3>
#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
Opt("TrayMenuMode", 1) ; Don't show the default tray context menu




Local $hGUI, $hCombo

; Create GUI
$hGUI = GUICreate("NineDragons Macro", 300, 400)
$hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 205, 55, 30, 150)
$hCombo2 = _GUICtrlComboBoxEx_Create ($hGUI, "", 205, 110, 30, 150)
$hCombo3 = _GUICtrlComboBoxEx_Create ($hGUI, "", 205, 165, 30, 150)
$hCombo4 = _GUICtrlComboBoxEx_Create ($hGUI, "", 205, 220, 30, 150)
$hCombo5 = _GUICtrlComboBoxEx_Create ($hGUI, "", 205, 275, 30, 150)
$checkbox1 = GUICtrlCreateCheckbox("Skill 1",10,58)
$checkbox2 = GUICtrlCreateCheckbox("Skill 2",10,113)
$checkbox3 = GUICtrlCreateCheckbox("Skill 3",10,168)
$checkbox4 = GUICtrlCreateCheckbox("Skill 4",10,223)
$checkbox5 = GUICtrlCreateCheckbox("Skill 5",10,278)


GUISetState()

$options = GUICtrlCreateMenu("Options")
$settings = GUICtrlCreateMenuItem("Settings", $options)
$find9d = GUICtrlCreateButton("Start macro", 30, 340, 100, 20)
$exit1 = GUICtrlCreateButton("Exit", 175, 340, 100, 20)


For $x = 0 To 0
$test1 = _GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("1"), $x, $x)
$test2 = _GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("2"), $x, $x)
$test3 = _GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("3"), $x, $x)
$test4 = _GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("4"), $x, $x)
$test5 = _GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("5"), $x, $x)
$test6 = _GUICtrlComboBoxEx_AddString ($hCombo2, StringFormat("1"), $x, $x)
$test7 = _GUICtrlComboBoxEx_AddString ($hCombo2, StringFormat("2"), $x, $x)
$test8 = _GUICtrlComboBoxEx_AddString ($hCombo2, StringFormat("3"), $x, $x)
$test9 = _GUICtrlComboBoxEx_AddString ($hCombo2, StringFormat("4"), $x, $x)
$test10 = _GUICtrlComboBoxEx_AddString ($hCombo2, StringFormat("5"), $x, $x)
$test11 = _GUICtrlComboBoxEx_AddString ($hCombo3, StringFormat("1"), $x, $x)
$test12 = _GUICtrlComboBoxEx_AddString ($hCombo3, StringFormat("2"), $x, $x)
$test13 = _GUICtrlComboBoxEx_AddString ($hCombo3, StringFormat("3"), $x, $x)
$test14 = _GUICtrlComboBoxEx_AddString ($hCombo3, StringFormat("4"), $x, $x)
$test15 = _GUICtrlComboBoxEx_AddString ($hCombo3, StringFormat("5"), $x, $x)
$test16 = _GUICtrlComboBoxEx_AddString ($hCombo4, StringFormat("1"), $x, $x)
$test17 = _GUICtrlComboBoxEx_AddString ($hCombo4, StringFormat("2"), $x, $x)
$test18 = _GUICtrlComboBoxEx_AddString ($hCombo4, StringFormat("3"), $x, $x)
$test19 = _GUICtrlComboBoxEx_AddString ($hCombo4, StringFormat("4"), $x, $x)
$test20 = _GUICtrlComboBoxEx_AddString ($hCombo4, StringFormat("5"), $x, $x)
$test21 = _GUICtrlComboBoxEx_AddString ($hCombo5, StringFormat("1"), $x, $x)
$test22 = _GUICtrlComboBoxEx_AddString ($hCombo5, StringFormat("2"), $x, $x)
$test23 = _GUICtrlComboBoxEx_AddString ($hCombo5, StringFormat("3"), $x, $x)
$test24 = _GUICtrlComboBoxEx_AddString ($hCombo5, StringFormat("4"), $x, $x)
$test25 = _GUICtrlComboBoxEx_AddString ($hCombo5, StringFormat("5"), $x, $x)

Next







Global $active = 1
Global $activeoff = 0
Global $activewin = 0
#EndRegion
#Region Other

GUISetState()

While 1
    $msg = GUIGetMsg()


    Select

        Case $msg = $test2
            MsgBox(0,"","lol")

        Case $msg = $exit1
            MsgBox(0,"exit","exit",2)
        Exit


        Case $msg = $checkbox1

        Case $msg = $checkbox2

        Case $msg = $checkbox3

        Case $msg = $checkbox4

        Case $msg = $checkbox5



        Case $msg = $GUI_EVENT_CLOSE
            $answer = MsgBox(4, "", "Are you sure you want to Exit?", 15)
            If $answer = 7 Then
            Else
            Exit
            EndIf

        Case $msg = $find9d
            If Not WinExists("9Dragons") Then
                MsgBox(0,"Error","9Dragons not found.",1)
            Else
                MsgBox(0,"","9Dragons founded.",1)
                WinActivate("9Dragons")
                Sleep(1100)
                MsgBox(0,"","Macro Starting...",1)
                WinActivate("9Dragons")
            EndIf


    EndSelect
WEnd

Share this post


Link to post
Share on other sites
Zedna

Func IsChecked($control)
      Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

$command = ''

If  IsChecked($checkbox1) Then $command += '1' 
If  IsChecked($checkbox2) Then $command += '2' 
If  IsChecked($checkbox3) Then $command += '3'
 
Send ($command)

Edited by Zedna

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.