cxzzD Posted January 12, 2011 Share Posted January 12, 2011 So I was wondering if it's possible to make my $button1 start a functin when it's pressed? So, basicly I got a whole lot of code, but I do not have an GUI for it. So I decided to create a GUI for it, but now I do not know how to make my Button actually execute the script. Here is the GUI code: #include <NomadMemory.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 443, 192, 124) $Label1 = GUICtrlCreateLabel("Label1", 8, 32, 84, 25) $Label2 = GUICtrlCreateLabel("Label2", 8, 104, 84, 33) $Button1 = GUICtrlCreateButton("Start Bot", 8, 360, 257, 57, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd After this I created a "func _start()" right before my code, and right after I put EndFunc, so how do I start the "_start()" function by pressing the button on my GUI? Thanks in advance. If anything was hard to understand,just say, and ill try to elaborate. Was quite hard to explain this when I do not really know what everything is called Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 12, 2011 Moderators Share Posted January 12, 2011 xCynic, Start BotPlease read this. The answer to your question can be found on the <GUI Reference - MessageLoop Mode> page of the Help file. You might find the excellent tutorials that you will find here and here useful as well. 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...
Varian Posted January 12, 2011 Share Posted January 12, 2011 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _Start() EndSwitch WEnd Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 xCynic, Please read this. The answer to your question can be found on the <GUI Reference - MessageLoop Mode> page of the Help file. You might find the excellent tutorials that you will find here and here useful as well. M23 The bot dosn't necessarily have to be for an online game now does it? Thanks for your answer tho ^^ Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 (edited) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _Start() EndSwitch WEnd Thanks, ill try it, got no clue what it does tho :3 EDIT: Awesome, it worked. <3 Edited January 12, 2011 by xCynic Link to comment Share on other sites More sharing options...
ZacUSNYR Posted January 12, 2011 Share Posted January 12, 2011 Good luck with that Microsoft Word bot you were working on Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 Good luck with that Microsoft Word bot you were working on Actually it's a friend of mine who requested me to create a spam bot for him (MSN). Nudge spam, Message Spam, and to Steal the other persons information (your MSN status will be the exact same as the other persons), allthough, I don't think I'm able to do the last one just yet. Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 Got a new problem now tho. Is there anyway to check if a certain process is running? I got this "WinWaitActive", but I want it to clearly state on the *bot* if the process is not running. Like "Waiting for MSN to start" and when the program finds MSN's process this text will dissapear? Link to comment Share on other sites More sharing options...
Varian Posted January 12, 2011 Share Posted January 12, 2011 Actually it's a friend of mine who requested me to create a spam bot for him (MSN). Nudge spam, Message Spam, and to Steal the other persons information (your MSN status will be the exact same as the other persons), allthough, I don't think I'm able to do the last one just yet.In the Name of all that is Holy, please NEVER say anything like that on a public forum again. You are inviting a world of hurt on yourself!!!! Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 (edited) In the Name of all that is Holy, please NEVER say anything like that on a public forum again. You are inviting a world of hurt on yourself!!!!Did not know that a MSN *bot* was against the rules. In that case, it won't happen again..Just out of curiosity, why is this against the rules(?), all I'm trying to do here is learn the language :3 + Can't come up with a good idea for a script to make, seems quite lame to create a script that opens Chrome and searches for something random ;o+In the announcement, it was only stated that one may not talk about automating games. And in my head, MSN isn't really a game, is it? Edited January 12, 2011 by xCynic Link to comment Share on other sites More sharing options...
Developers Jos Posted January 12, 2011 Developers Share Posted January 12, 2011 (edited) Did not know that a MSN *bot* was against the rules. In that case, it won't happen again..Just out of curiosity, why is this against the rules(?), all I'm trying to do here is learn the language :3 + Can't come up with a good idea for a script to make, seems quite lame to create a script that opens Chrome and searches for something random ;oYea right, you are just stupid and can't think of any reason why we do not want any of this shit discussed here?Jos Edited January 12, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Varian Posted January 12, 2011 Share Posted January 12, 2011 Steal the other persons information (your MSN status will be the exact same as the other persons)That part may be considered criminal impersonation, keyword "criminal", aka identity theft Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 Yea right, you are just stupid and can't think of any reason why we do not want any of this shit discussed here?JosTemper FTW. Would have been better if you just told me that it's against the rules, but no.. Here we have to go on and get pissed off. I'm just looking for help and an explanation. And no actually, I can't come up with a good reason why this would not be discussed.. But nvm, I see this forum dosn't really feel the urge to help, nor be polite. So I will take my "shit" and go somewhere else.. Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 That part may be considered criminal impersonation, keyword "criminal", aka identity theftLet me rephrase. The only thing that will happen, is that your Name (That you can change at any given time) will be changed to the other persons name. This is not considered an criminal act, sorry for my bad description earlier. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 12, 2011 Developers Share Posted January 12, 2011 So I will take my "shit" and go somewhere else..Bye.. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
cxzzD Posted January 12, 2011 Author Share Posted January 12, 2011 Bye..Asshole.. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 12, 2011 Developers Share Posted January 12, 2011 Asshole..The true personality always surfaces. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts