Sign in to follow this  
Followers 0
ulti

linking script to button

7 posts in this topic

#1 ·  Posted (edited)

hi i have made a script for wow its just a simple send 1 and send mouse click blahh blahh bot

but in the past i have had to run each script buy its self each with its own hot key one that sends mouse clicks and one that sends 1,2,3 button presses

so for one "bot" i have 4-5 auto it scripts running now i would like to add them all into a gui so i can turn them on and off with clicking the button on the gui not the hot key and have only one script running at a time

i have tried linking it to the "help dice file" gui but not got it yet

the scripts i want to assign to the gui are like this

HotKeySet("{pgdn}", "TogglePause")
HotKeySet("!{pgdn}","Quit")
Dim $Paused

TogglePause()
While 1
Start()
WEnd

func Start()
ToolTip('Auto Atackr started.',0,0)
Sleep(1000)
While 1
Send("{2}") 
sleep(80)
send ("{2}")
Sleep(Random(1000,2000))
WEnd
EndFunc

Func TogglePause()
ToolTip('Auto Atackr stoped.',0,0)
Sleep(2000)
ToolTip("")
$Paused = NOT $Paused
While $Paused
WEnd
Start()  
EndFunc

func Quit()
Exit
EndFunc

and for aguments sake i want them assigned to this type of button wich i didnt make.

#include <GUIConstants.au3>

AutoItSetOption("WinTitleMatchMode", 4)

Global $handle = WinGetHandle("classname=GxWindowClassD3d")
Global $show = 0, $Color = 0x3a0806, $Enter = 0xEE1400, $Killer = ""

$Form1_1 = GUICreate("Battle Ground Selector", 471, 101, -1, -1)
GUISetBkColor(0x0000FF)
$WSG = GUICtrlCreateButton("Warsong Gulch", 8, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$AV = GUICtrlCreateButton("Alterac Valley", 122, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$AB = GUICtrlCreateButton("Arathi Basin", 237, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$EOTS = GUICtrlCreateButton("Eye of the Storm", 351, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$Bottom = GUICtrlCreateLabel("World of Warcraft Battleground Automation Bot", 120, 80, 226, 17)
$Title = GUICtrlCreateLabel("Select Which Battleground You Wish to Enter:", 80, 8, 298, 19)
GUICtrlSetFont(-1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetColor(-1, 0x800000)
GUISetState(@SW_SHOW)

so baseicly want i want it to do is wen i click a button on the gui it runs one or 2 of my scripts then wen i press it a seccond time it stops it/them

im just stuck on how i can do this it sounds easy but wen i try to think how, and play with the script it dosent work.

Edited by ulti

Share this post


Link to post
Share on other sites



hi i have made a script for wow its just a simple send 1 and send mouse click blahh blahh bot

but in the past i have had to run each script buy its self each with its own hot key one that sends mouse clicks and one that sends 1,2,3 button presses

so for one "bot" i have 4-5 auto it scripts running now i would like to add them all into a gui so i can turn them on and off with clicking the button on the gui not the hot key and have only one script running at a time

i have tried linking it to the "help dice file" gui but not got it yet

the scripts i want to assign to the gui are like this

HotKeySet("{pgdn}", "TogglePause")
HotKeySet("!{pgdn}","Quit")
Dim $Paused

TogglePause()
While 1
Start()
WEnd

func Start()
ToolTip('Auto Atackr started.',0,0)
Sleep(1000)
While 1
Send("{2}") 
sleep(80)
send ("{2}")
Sleep(Random(1000,2000))
WEnd
EndFunc

Func TogglePause()
ToolTip('Auto Atackr stoped.',0,0)
Sleep(2000)
ToolTip("")
$Paused = NOT $Paused
While $Paused
WEnd
Start()  
EndFunc

func Quit()
Exit
EndFunc

and for aguments sake i want them assigned to this type of button wich i didnt make.

#include <GUIConstants.au3>

AutoItSetOption("WinTitleMatchMode", 4)

Global $handle = WinGetHandle("classname=GxWindowClassD3d")
Global $show = 0, $Color = 0x3a0806, $Enter = 0xEE1400, $Killer = ""

$Form1_1 = GUICreate("Battle Ground Selector", 471, 101, -1, -1)
GUISetBkColor(0x0000FF)
$WSG = GUICtrlCreateButton("Warsong Gulch", 8, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$AV = GUICtrlCreateButton("Alterac Valley", 122, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$AB = GUICtrlCreateButton("Arathi Basin", 237, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$EOTS = GUICtrlCreateButton("Eye of the Storm", 351, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$Bottom = GUICtrlCreateLabel("World of Warcraft Battleground Automation Bot", 120, 80, 226, 17)
$Title = GUICtrlCreateLabel("Select Which Battleground You Wish to Enter:", 80, 8, 298, 19)
GUICtrlSetFont(-1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetColor(-1, 0x800000)
GUISetState(@SW_SHOW)

so baseicly want i want it to do is wen i click a button on the gui it runs one or 2 of my scripts then wen i press it a seccond time it stops it/them

im just stuck on how i can do this it sounds easy but wen i try to think how, and play with the script it dosent work.

Could you simply compile each of the scripts, and when you click a button run that script with Run(...

Then when you want it to stop you could use ProcessClose(...


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

thank you or your advice it helped me learn the program alot :P but im now haveing trouble with makeing my exe close the seccond time i click the same button i used to start it, id all so like to make it have only one instance of the exe open at any one time but i cant make this work in one button i could make a second button to exit the procces tho thats not wat i want. any other advise or a command i should look in to

here is a bit of what i have tried but it seems to close the prcces right after its opend

#include <GUIConstants.au3>
#include <GUIConstants.au3>
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

Opt('GUIEventOptions',1)
Opt('TrayOnEventMode',1)
Opt('TrayMenuMode',1)

AutoItSetOption("WinTitleMatchMode", 4)

Global $handle = WinGetHandle("classname=GxWindowClassD3d")
Global $show = 0, $Join = 0x6a0706, $Enter = 0xEE1400, $Killer = ""

HotKeySet("{F9}", "Start")

$Form1_1 = GUICreate("BG-Bot Elite", 471, 202, -1, -1)
GUISetBkColor(0x0000FF)
$WSG = GUICtrlCreateButton("Warsong Gulch", 8, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$AV = GUICtrlCreateButton("Alterac Valley", 122, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$AB = GUICtrlCreateButton("Arathi Basin", 237, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$EOTS = GUICtrlCreateButton("Eye of the Storm", 351, 32, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")

$click2 = GUICtrlCreateButton("Enemy Auto swing2 ", 8, 132, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$click3 = GUICtrlCreateButton("Anti Afk3", 122, 132, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$click4 = GUICtrlCreateButton("Class Ability4", 237, 132, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$mouseclks = GUICtrlCreateButton("Auto Mouse", 351, 132, 110, 40, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")

$Bottom = GUICtrlCreateLabel("World of Warcraft Battleground Automation Bot", 120, 180, 226, 17)
$Title = GUICtrlCreateLabel("Select Auto follow Style", 165, 8, 298, 19)
GUICtrlSetFont(-1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetColor(-1, 0x800000)
GUISetState(@SW_hide)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(20)
WEnd

Func Big_GUI()
    GUISetState(@SW_SHOW, $Form1_1)
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $WSG
                 run ( "muti folo ai.exe" )
            Case $AV
                 run ( "av folo ai.exe" )
            Case $AB
                 run ( "muti folo ai.exe" )
            Case $EOTS
                 run ( "muti folo ai.exe" )
            Case $click2
                 run ( "ck 2 ato swng.exe" )
            Case $click3
                 run ( "antiafk.exe" )
            if  ProcessExists ( "antiafk.exe" )   Then  ProcessClose ( "antiafk.exe")  <-----here is my attempt
            Case $click4
                 run ( "class sp atack.exe" )
            Case $mouseclks
                 run ( "click mouse.exe" )
            Case $Bottom
            Case $Title
        EndSwitch
    WEnd
    GUISetState(@SW_HIDE, $Form1_1)
EndFunc  

Func start()
    WinSetState($handle, "", @SW_SHOW)
    WinSetState($handle, "", @SW_SHOWMAXIMIZED)
    Big_GUI()
    While 1
        $show = 0
        Join()
        If $show > 0 Then ExitLoop
    WEnd
EndFunc 

Func join()
    ProcessClose ( "muti folo ai.exe")
    ProcessClose ( "av folo ai.exe")
    ProcessClose ( "click mouse.exe")
    ProcessClose ( "class sp atack.exe")
    ProcessClose ( "antiafk.exe")
    ProcessClose ( "ck 2 ato swng.exe")
Exit
EndFunc

but that seems to open and the close

Edited by ulti

Share this post


Link to post
Share on other sites

Couldn't you just create a stop button with proccesclose?

yes i could but i would like it to open and close the exe with one button i dont realy want any more buttons on the ui

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Try this

Case $click3
                If ProcessExists("antiafk.exe") Then
                    ProcessClose("antiafk.exe")
                    GUICtrlSetData($click3, "Anti Afk3")
                Else
                    Run("antiafk.exe")
                    GUICtrlSetData($click3, "Anti Afk3 off")
                EndIf
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Try this

Case $click3
                If ProcessExists("antiafk.exe") Then
                    ProcessClose("antiafk.exe")
                    GUICtrlSetData($click3, "Anti Afk3")
                Else
                    Run("antiafk.exe")
                    GUICtrlSetData($click3, "Anti Afk3 off")
                EndIf
cheeeeers dude that works perfectley :P

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  
Followers 0