MoreBloodWine Posted October 13, 2009 Author Share Posted October 13, 2009 Thx Zed, you rock big time ;-) Link to comment Share on other sites More sharing options...
Zedna Posted October 13, 2009 Share Posted October 13, 2009 Thx Zed, you rock big time ;-)No problem mate. It was easy :-)And you did good start with Autoit. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
MoreBloodWine Posted October 13, 2009 Author Share Posted October 13, 2009 And you did good start with Autoit. Thx, I suppose my last big hurdle will be to merge the script with the GUI and I know for a fact thats something I would need either yours or Melbas help with. The script is pretty much done... but if you dont mind me asking for one last favor then would you care to take a crack at merging it with the GUI Zed ? Any questions please dont hesitate to ask. If the Pause/Break function "hot key" needs to be removed to make the script work with the single action Start n Stop button then fine but if it can be tied to the button and leave the hot key intact then even better. Either way ty for trying this if you dont mind ;-) Here's the Script Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client Global $Paused HotKeySet("{PAUSE}", "TogglePause") ; default is a paused script TogglePause() While 1 While NOT $Paused ToolTip('WoW Vendor Loop is " Running "',0,0) $Pos = MouseGetPos() MouseClick("right", $pos[0], $pos[1], 1) ; 1 right click at location x,y Sleep(10000) ; sleep 10 seconds Send("{ESC}") ; press esc Sleep(5000) ; sleep 5 seconds WEnd WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('WoW Vendor Loop is " Not Running "',0,0) WEnd ToolTip("") EndFunc Here's the GUI expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Global $actionitem, $label _Main() Func _Main() Local $filemenu, $fileitem Local $exititem, $disclaimeritem, $authoritem, $programitem, $dlitem Local $msg GUICreate(" WoW Vendor Loop", 245, 50) $filemenu = GUICtrlCreateMenu("File") $disclaimeritem = GUICtrlCreateMenuItem("Disclaimer", $filemenu) $programitem = GUICtrlCreateMenuItem("Program Function", $filemenu) $authoritem = GUICtrlCreateMenuItem("Author Info", $filemenu) ; next one creates a menu separator (line) GUICtrlCreateMenuItem("", $filemenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) ; Action button $actionitem = GUICtrlCreateButton("Start", 185, 5, 55, 20) $filemenu = GUICtrlCreateMenu("DL Vend-o-matic") $dlitem = GUICtrlCreateMenuItem("http://wow.curse.com/downloads/wow-addons/details/vendomatic.aspx", $filemenu) $label = GUICtrlCreateLabel(" WoW Vendor Loop is not running.", 8, 8, 170, 15) GUICtrlSetBkColor($label, 0xFF0000) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $disclaimeritem MsgBox(0, "Disclaimer", "Disclaimer:" & @CRLF & " This program is a fine line issue since it can effectively allow un-attended" & @CRLF & "vendor buying / botting. So use at your own risk unless you want to take the" & @CRLF & "off chance of not being caught and banned or suspended by a GM. So please" & @CRLF & "when possible always use this program while at your keyboard. In either case," & @CRLF & "the author of this program assumes no responsibility what so ever of how you" & @CRLF & "use or even misuse his program.") Case $msg = $programitem MsgBox(0, "Program Function", "Program Function:" & @CRLF & " This program serves no real function unless you have the Vend-o-matic mod" & @CRLF & "as it will just open and close a vendors bag every 15 seconds. Its main function" & @CRLF & " is to help automate the buying of items from World of Warcraft vendors while" & @CRLF & "working along side the Vend-o-matic mod from the curse.com website.") Case $msg = $authoritem MsgBox(0, "Author Info", "Language: English" & @CRLF & "Platform: Win9x/NT" & @CRLF & "Author: Andrew C. McNamara ( MoreBloodWine@hotmail.com )" & @CRLF & "" & @CRLF & "Support: Melba23 & Zedna of the AutoIt scripting forums.") Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $exititem ExitLoop Case $msg = $actionitem _action() Case $msg = $dlitem _ShellExecute() EndSelect WEnd GUIDelete() Exit EndFunc ;==>_Main Func _Action() Switch GUICtrlRead($actionitem) Case "Start" GUICtrlSetData($actionitem, "Stop") ; <<<<<<<<<<<<<< change button text GUICtrlSetData($label, " WoW Vendor Loop is running.") GUICtrlSetBkColor($label, 0x00FF00) ; whatever you need as start code here Case "Stop" GUICtrlSetData($actionitem, "Start") ; <<<<<<<<<<<<< change button text GUICtrlSetData($label, " WoW Vendor Loop is not running.") GUICtrlSetBkColor($label, 0xFF0000) ; whatever you need as stop code here EndSwitch EndFunc ;==> _Action Func _ShellExecute() ShellExecute("iexplore.exe", "http://wow.curse.com/downloads/wow-addons/details/vendomatic.aspx") EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 14, 2009 Moderators Share Posted October 14, 2009 MoreBloodWine, If you get stuck here is my version. There are quite a few changes to make everything fit together nicely - I have commented them so you can see where and why I have changed things: expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client Global $actionitem, $exititem, $label, $Paused = False ; <<<<<<<<<<<<<<<<<<<<<<<<<<< Set $Paused as False when you declare it HotKeySet("{PAUSE}", "TogglePause") _Main() Func _Main() Local $filemenu, $fileitem Local $disclaimeritem, $authoritem, $programitem, $dlitem Local $msg GUICreate(" WoW Vendor Loop", 245, 50) $filemenu = GUICtrlCreateMenu("File") $disclaimeritem = GUICtrlCreateMenuItem("Disclaimer", $filemenu) $programitem = GUICtrlCreateMenuItem("Program Function", $filemenu) $authoritem = GUICtrlCreateMenuItem("Author Info", $filemenu) ; next one creates a menu separator (line) GUICtrlCreateMenuItem("", $filemenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) ; Action button $actionitem = GUICtrlCreateButton("Start", 185, 5, 55, 20) $filemenu = GUICtrlCreateMenu("DL Vend-o-matic") $dlitem = GUICtrlCreateMenuItem("http://wow.curse.com/downloads/wow-addons/details/vendomatic.aspx", $filemenu) $label = GUICtrlCreateLabel(" WoW Vendor Loop is not running.", 8, 8, 170, 15) GUICtrlSetBkColor($label, 0xFF0000) GUISetState() While 1 Switch GUIGetMsg() ; <<<<<<<<<<<<<< Use Switch, not Select - see below for why! Case $disclaimeritem MsgBox(0, "Disclaimer", "Disclaimer:" & @CRLF & " This program is a fine line issue since it can effectively allow un-attended" & @CRLF & "vendor buying / botting. So use at your own risk unless you want to take the" & @CRLF & "off chance of not being caught and banned or suspended by a GM. So please" & @CRLF & "when possible always use this program while at your keyboard. In either case," & @CRLF & "the author of this program assumes no responsibility what so ever of how you" & @CRLF & "use or even misuse his program.") Case $programitem MsgBox(0, "Program Function", "Program Function:" & @CRLF & " This program serves no real function unless you have the Vend-o-matic mod" & @CRLF & "as it will just open and close a vendors bag every 15 seconds. Its main function" & @CRLF & " is to help automate the buying of items from World of Warcraft vendors while" & @CRLF & "working along side the Vend-o-matic mod from the curse.com website.") Case $authoritem MsgBox(0, "Author Info", "Language: English" & @CRLF & "Platform: Win9x/NT" & @CRLF & "Author: Andrew C. McNamara ( MoreBloodWine@hotmail.com )" & @CRLF & "" & @CRLF & "Support: Melba23 & Zedna of the AutoIt scripting forums.") Case $GUI_EVENT_CLOSE, $exititem ; <<<<<<<<< because it lets you have multiple choices in a Case !! ExitLoop Case $actionitem _action() Case $dlitem _ShellExecute() EndSwitch WEnd GUIDelete() Exit EndFunc ;==>_Main Func _Action() Local $iBegin Switch GUICtrlRead($actionitem) Case "Start" GUICtrlSetData($actionitem, "Stop") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<< Your original script starts here While 1 If $Paused Then ; <<<<<<<<<<<<<<< Pause is set, so write label and then look for Stop or Exit If GUICtrlRead($label) <> " WoW Vendor Loop is Paused." Then GUICtrlSetData($label, " WoW Vendor Loop is Paused.") GUICtrlSetBkColor($label, 0xFFFF00) EndIf ToolTip('WoW Vendor Loop is Paused',0,0) If Action_Check() Then ContinueCase ; <<<<<<<<<<< If Stop button pressed, move to that Case Else ; Run the Vendor Loop GUICtrlSetData($label, " WoW Vendor Loop is Running.") GUICtrlSetBkColor($label, 0x00FF00) ToolTip('WoW Vendor Loop is Running',0,0) ConsoleWrite("Running Vendor Loop Pt1" & @CRLF) ;Local $Pos = MouseGetPos() ;MouseClick("right", $pos[0], $pos[1], 1) ; 1 right click at location x,y ;Sleep(10000) ; sleep 10 seconds ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<< Makes script unresponsive - better to have a loop as follows $iBegin = TimerInit() While TimerDiff($iBegin) < 10000 If Action_Check() Then ContinueCase ; <<<<<<<<<<< If Stop button pressed, move to that Case WEnd ConsoleWrite("Running Vendor Loop Pt2" & @CRLF) ;Send("{ESC}") ; press esc ;Sleep(5000) ; sleep 5 seconds ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Makes script unresponsive - better to have a loop as above $iBegin = TimerInit() While TimerDiff($iBegin) < 5000 If Action_Check() Then ContinueCase ; <<<<<<<<<<< If Stop button pressed, move to that Case WEnd EndIf WEnd Case "Stop" GUICtrlSetData($actionitem, "Start") GUICtrlSetData($label, " WoW Vendor Loop is not running.") GUICtrlSetBkColor($label, 0xFF0000) ToolTip("") $Paused = False ; <<<<<<<<<<<<<<<<<<<<< Reset any paused condition EndSwitch EndFunc ;==> _Action Func _ShellExecute() ShellExecute("iexplore.exe", "http://wow.curse.com/downloads/wow-addons/details/vendomatic.aspx") EndFunc Func TogglePause() If GUICtrlRead($actionitem) = "Start" Then Return ; <<<<<<<<<<<<<<<<<<<<<< No point in pausing if Vendor Loop is not running $Paused = NOT $Paused If $Paused Then ToolTip('WoW Vendor Loop will Pause',0,0) ; <<<<<<<<<<<<<< The script will pause AFTER current cycle of the vendor loop EndFunc Func Action_Check() Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $exititem Exit ; <<<<<<<<<<<<<<<<<<<<<<<<<< Exit if [X] or menu clicked Case $actionitem Return 1 ; <<<<<<<<<<<<<<<< The Stop button was pressed, so return a flag EndSwitch Return 0 ; <<<<<<<<<<<<<<<<<<<<<<<<< Nothing pressed so ensure no flag returned EndFunc Let me know if it this is not how you imagined it working - it should be pretty easy to adjust. But no peeking until you have tried for yourself! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MoreBloodWine Posted October 14, 2009 Author Share Posted October 14, 2009 (edited) I promise not to peak, much. By that I just mean I might have to peak a few lines just to get a start or idea or where to try and begin. Edit: In either case I just wanted to thank you and Zedna again for everything you guys have helped me with so far. If you didnt noticed I credited you both in the "Author Notes". Nice angry face above btw hehe Edited October 14, 2009 by MoreBloodWine Link to comment Share on other sites More sharing options...
MoreBloodWine Posted October 15, 2009 Author Share Posted October 15, 2009 Quick question while I work on embedding the script into the GUI myself without peeking more than the few lines I said I would. This kinda hit/came to me lastnight but when you build/compiled ones script into an EXE is it possible to excrypt it so it can be backwords engineered for lack of a better term. So like if someone excrypted their EXE i wouldnt be able to turn the EXE into a script with AutoIts conversion thing. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 15, 2009 Moderators Share Posted October 15, 2009 MoreBloodWine,Searching the forums will provide you with a lot more information in greater detail, but in brief:- Your plain language script is within the compiled .exe, but in compressed form. It is not immediately viewable with a hex editor, but is by no means secure as it is expanded in memory when the .exe is run.- Obfuscator (part of the full SciTE4AutoIt3 package) will obscure your script by changing variable and constant names (and a lot more!), which makes it harder to decompile but again does not render the .exe secure.So, compiling an Autoit script will prevent quick snooping, but a determined, experienced hacker can relatively easily get your source - including passwords, specific filenames, etc.AutoIt is NOT a secure language (any more than any other).M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now