Charger Posted April 22, 2006 Share Posted April 22, 2006 Ok to start off with, please dont tell me to read the help file. I have, its just somewhat hard to follow. First question: GUI, ok I was reading the help file on GUI it told me just about everything I need to know. But I dont get how to set witch button to witch Func, I am not 100% sure but I think im using the right tag: $GuiCtrlCreateButton("Slot 1", 10, 300, 100, 30) ______________________________________________________ 2ed question: How do I set it up to work inside a window? (like running a but but I can lowwer the window and do something else.) Im sure im going to have more questions, being im only learning this from nothing. But the programs that made AutoIt did a good job, program looks to be easy to learn. I found the "Examples" very helpful, being it tells what each Func does. Is there anywhere I can download more? Thanks for the help, -Charger (P.S.>Pease check this topic here and there, I would like to just keep this one so I dont spam help topic, I just hope I can get the hang of it to where I will no long need help) Never forget the power of words, and how it can affect someones life.Always remember theres another person on the other side of the computer. Link to comment Share on other sites More sharing options...
elgabionline Posted April 22, 2006 Share Posted April 22, 2006 Ok to start off with, please dont tell me to read the help file. I have, its just somewhat hard to follow. First question: GUI, ok I was reading the help file on GUI it told me just about everything I need to know. But I dont get how to set witch button to witch Func, I am not 100% sure but I think im using the right tag: $GuiCtrlCreateButton("Slot 1", 10, 300, 100, 30) ______________________________________________________ you should read the help file! lol... Read section AutoItSetOption (). You can assign Events (functions) at each button. GUIOnEventMode Enable/disable OnEvent functions notifications. 0 = (default) disable. 1 = enable. 2ed question: How do I set it up to work inside a window? (like running a but I can lowwer the window and do something else.) Im sure im going to have more questions, being im only learning this from nothing. But the programs that made AutoIt did a good job, program looks to be easy to learn. I found the "Examples" very helpful, being it tells what each Func does. Is there anywhere I can download more? Thanks for the help, -Charger You really should read the help file... GUISetState ( [flag [, winhandle]] ) Remarks When windows are created they are intially hidden so you must use this function to display them. You should put your control: $MyControl=GuiCtrlCreateButton("Slot 1", 10, 300, 100, 30) into a window GUI: opt ("GuiOnEventMode",1) $MyGUI=guicreate ("title" [, width [, height ]]) $MyControl=GuiCtrlCreateButton("Slot 1", 10, 300, 100, 30) GuiCtrlSetOnEvent ($MyControl,"MyFunc") GUISetState () while 1 sleep (50) wend Func MyFunc () beep (1000,500) endfunc Something like that... Link to comment Share on other sites More sharing options...
Charger Posted April 22, 2006 Author Share Posted April 22, 2006 Ty, and I have read the help file, I just forget what I read 5 page back lol.... And also I found a cool lil tool in ScriTe, GUI builder. That helps alot.... Thanks again for your help, -Charger Never forget the power of words, and how it can affect someones life.Always remember theres another person on the other side of the computer. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 22, 2006 Share Posted April 22, 2006 (edited) Ty, and I have read the help file, I just forget what I read 5 page back lol.... And also I found a cool lil tool in ScriTe, GUI builder. That helps alot.... Thanks again for your help, -Charger I know what you mean. I can't retain it until I use it for something. Don't pass up the AutoIT 1-2-3 Tutorial. I think just from reading your posts that you missed the idea of GUI messages vs. GUI events. Your GUI is always in message mode or event mode. In message mode (the default), nothing happens when you click a button until your script reads the message. So your script needs a loop (While/Wend) where it keeps reading the latest GUI message (GuiGetMsg), and reacts if the message equals the button's control ID. Here is a basic demo of a GUI in message mode. You'll find many more, and demos of event mode, in the tutorial: ; GUI Message Mode Demo #include<guiconstants.au3> $GuiHandle = GUICreate("Demo GUI", 200, 100) $Button_1 = GUICtrlCreateButton("Click Me", 70, 35, 60, 30) GUISetState() While 1 $GuiMsg = GUIGetMsg() Select Case $GuiMsg = $GUI_EVENT_CLOSE Exit Case $GuiMsg = $Button_1 MsgBox(64, "Demo GUI", "You clicked me, you really clicked me! :-)") EndSelect WEnd Edited April 22, 2006 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Charger Posted April 22, 2006 Author Share Posted April 22, 2006 Well I already download autoit 1-2-3, I found it cool, but I got to the gui test and almost all the questions got cut off, and I can give the test a try unless I know whats being asked of me... Heres as where im at now: (I need to find out what number stands for a click) my problem now is <If $Button_1 = Then> heres the full scripted: expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 310,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Slot 1", 10, 90, 80, 30) $Button_2 = GuiCtrlCreateButton("Slot 2", 110, 90, 80, 30) $Button_3 = GuiCtrlCreateButton("Slot 3", 210, 90, 80, 30) $Button_4 = GuiCtrlCreateButton("Slot 4", 310, 90, 80, 30) $Button_5 = GuiCtrlCreateButton("Slot 1-2", 10, 150, 80, 30) $Button_6 = GuiCtrlCreateButton("Slot 2-2", 110, 150, 80, 30) $Button_7 = GuiCtrlCreateButton("Slot 3-2", 210, 150, 80, 30) $Button_8 = GuiCtrlCreateButton("Slot 4-2", 310, 150, 80, 30) $Progress_9 = GuiCtrlCreateProgress(60, 50, 260, 20) $Group_10 = GuiCtrlCreateGroup("Guild Wars Account Links.", 100, 20, 160, 10) If $Button_1 = Then Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") MouseClick("left", 380, 259, 0) sleep(1000) Send("Username") sleep(1000) MouseClick("left", 380, 300, 0) sleep(1000) Send("Password") sleep(1000) MouseClick("left", 460, 280, 0) sleep(1000) MouseClick("left", 280, 600, 0) EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Never forget the power of words, and how it can affect someones life.Always remember theres another person on the other side of the computer. Link to comment Share on other sites More sharing options...
elgabionline Posted April 22, 2006 Share Posted April 22, 2006 Hi, being you seem to know alot about auto it, I wanted to ask you something> I got stuck on a problem, I dont know what number stands for a click. expandcollapse popup#include <GuiConstants.au3> GuiCreate("MyGUI", 392, 310,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Slot 1", 10, 90, 80, 30) $Button_2 = GuiCtrlCreateButton("Slot 2", 110, 90, 80, 30) $Button_3 = GuiCtrlCreateButton("Slot 3", 210, 90, 80, 30) $Button_4 = GuiCtrlCreateButton("Slot 4", 310, 90, 80, 30) $Button_5 = GuiCtrlCreateButton("Slot 1-2", 10, 150, 80, 30) $Button_6 = GuiCtrlCreateButton("Slot 2-2", 110, 150, 80, 30) $Button_7 = GuiCtrlCreateButton("Slot 3-2", 210, 150, 80, 30) $Button_8 = GuiCtrlCreateButton("Slot 4-2", 310, 150, 80, 30) $Progress_9 = GuiCtrlCreateProgress(60, 50, 260, 20) $Group_10 = GuiCtrlCreateGroup("Guild Wars Account Links.", 100, 20, 160, 10) |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| If $Button_1 = Then<----Heres where the problems coming from... |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") MouseClick("left", 380, 259, 0) sleep(1000) Send("Username") sleep(1000) MouseClick("left", 380, 300, 0) sleep(1000) Send("Password") sleep(1000) MouseClick("left", 460, 280, 0) sleep(1000) MouseClick("left", 280, 600, 0) EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Think you can help? And if you have msn I would like to maybe add you to my friends list, if you dont mind some nooby questions here and there.... -Charger You take the Gui messages with "GUIGetMsg", you can try this: While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $Button_1 Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") MouseClick("left", 380, 259, 0) sleep(1000) Send("Username") sleep(1000) MouseClick("left", 380, 300, 0) sleep(1000) Send("Password") sleep(1000) MouseClick("left", 460, 280, 0) sleep(1000) MouseClick("left", 280, 600, 0) EndSelect Wend Link to comment Share on other sites More sharing options...
Charger Posted April 22, 2006 Author Share Posted April 22, 2006 Ok I tryed that, and it cuts out the hole gui set up, It just starts running and would not stop.....LOL had to end task it.. Is there any other way I could do it? Never forget the power of words, and how it can affect someones life.Always remember theres another person on the other side of the computer. Link to comment Share on other sites More sharing options...
elgabionline Posted April 22, 2006 Share Posted April 22, 2006 Ok I tryed that, and it cuts out the hole gui set up,It just starts running and would not stop.....LOL had to end task it..Is there any other way I could do it?well, maybe now you should put entire code here so I can see what is the issue... Link to comment Share on other sites More sharing options...
Charger Posted April 23, 2006 Author Share Posted April 23, 2006 "entire code"? Never forget the power of words, and how it can affect someones life.Always remember theres another person on the other side of the computer. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 23, 2006 Share Posted April 23, 2006 (edited) Well I already download autoit 1-2-3, I found it cool, but I got to the gui test and almost all the questions got cut off, and I can give the test a try unless I know whats being asked of me... Heres as where im at now: (I need to find out what number stands for a click) my problem now is <If $Button_1 = Then> heres the full scripted: CODE ; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 310,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Slot 1", 10, 90, 80, 30) $Button_2 = GuiCtrlCreateButton("Slot 2", 110, 90, 80, 30) $Button_3 = GuiCtrlCreateButton("Slot 3", 210, 90, 80, 30) $Button_4 = GuiCtrlCreateButton("Slot 4", 310, 90, 80, 30) $Button_5 = GuiCtrlCreateButton("Slot 1-2", 10, 150, 80, 30) $Button_6 = GuiCtrlCreateButton("Slot 2-2", 110, 150, 80, 30) $Button_7 = GuiCtrlCreateButton("Slot 3-2", 210, 150, 80, 30) $Button_8 = GuiCtrlCreateButton("Slot 4-2", 310, 150, 80, 30) $Progress_9 = GuiCtrlCreateProgress(60, 50, 260, 20) $Group_10 = GuiCtrlCreateGroup("Guild Wars Account Links.", 100, 20, 160, 10) If $Button_1 = Then Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") MouseClick("left", 380, 259, 0) sleep(1000) Send("Username") sleep(1000) MouseClick("left", 380, 300, 0) sleep(1000) Send("Password") sleep(1000) MouseClick("left", 460, 280, 0) sleep(1000) MouseClick("left", 280, 600, 0) EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit This has been modified to show the GUI and run your game when button one is clicked. Your group was probably meant to be a label, and the progress bar was never updated. As a demo, I changed it quite a bit, but have no idea if it does anything like what you were trying. You can tweak it to your needs once you see how it works. expandcollapse popup#include <GuiConstants.au3> GUICreate("MyGUI", 392, 310, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GUICtrlCreateLabel("Guild Wars Account Links.", 100, 20, 160, 30) $Progress_1 = GUICtrlCreateProgress(60, 50, 260, 20) $Button_1 = GUICtrlCreateButton("Slot 1", 10, 90, 80, 30) $Button_2 = GUICtrlCreateButton("Slot 2", 110, 90, 80, 30) $Button_3 = GUICtrlCreateButton("Slot 3", 210, 90, 80, 30) $Button_4 = GUICtrlCreateButton("Slot 4", 310, 90, 80, 30) $Button_5 = GUICtrlCreateButton("Slot 1-2", 10, 150, 80, 30) $Button_6 = GUICtrlCreateButton("Slot 2-2", 110, 150, 80, 30) $Button_7 = GUICtrlCreateButton("Slot 3-2", 210, 150, 80, 30) $Button_8 = GUICtrlCreateButton("Slot 4-2", 310, 150, 80, 30) GUISetState() $Progress = 0 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 _RunGW() Case $msg = $Button_2 _OtherButtons("2") Case $msg = $Button_3 _OtherButtons("3") Case $msg = $Button_4 _OtherButtons("4") Case $msg = $Button_5 _OtherButtons("5") Case $msg = $Button_6 _OtherButtons("6") Case $msg = $Button_7 _OtherButtons("7") Case $msg = $Button_8 _OtherButtons("8") EndSelect WEnd ; Local Functions Func _RunGW() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") MouseClick("left", 380, 259, 0) Sleep(1000) Send("Username") Sleep(1000) MouseClick("left", 380, 300, 0) Sleep(1000) Send("Password") Sleep(1000) MouseClick("left", 460, 280, 0) Sleep(1000) MouseClick("left", 280, 600, 0) EndFunc Func _OtherButtons($sButton) $Progress = $Progress + 20 GUICtrlSetData($Progress_1, $Progress) MsgBox(64, "Debug", "You clicked button number " & $sButton & "; " & $Progress & "% complete.", 3) If $Progress >= 100 Then Exit EndFunc Edited April 23, 2006 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Charger Posted April 23, 2006 Author Share Posted April 23, 2006 Thanks That helped alot, And I have already ran into another problem lol, **cant get a break**.The game will not let me use a auto click, or my auto click text is wrong.So I came up with this:If you use the arrow keys, it lets you move from char to char, the onlt problem is it starts off on the last char you started with. That means it will be some what diff each time I log in(x4). So when your in the game the char that the mouse would have been on get big<(screen cap)>So I want to have a pixel color activator, Have it click left till it hits the first char, then after it see the color it will run the rest of the scripted.Heres the window info:>>>>>>>>>>>> Window Details <<<<<<<<<<<<<Title: Guild WarsClass: ArenaNet_Dx_Window_ClassSize: X: 0 Y: 0 W: 1024 H: 733>>>>>>>>>>> Mouse Details <<<<<<<<<<<Screen: X: 226 Y: 532Cursor ID: 0>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<RGB: Hex: 0xA2A4A6 Dec: 10658982Now here the hole scripted if you want to take a look at it:expandcollapse popup#include <GuiConstants.au3> GUICreate("MyGUI", 392, 310, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GUICtrlCreateLabel("Guild Wars Account Links.", 100, 20, 160, 30) $Button_1 = GUICtrlCreateButton("Slot 1", 10, 90, 80, 30) $Button_2 = GUICtrlCreateButton("Slot 2", 110, 90, 80, 30) $Button_3 = GUICtrlCreateButton("Slot 3", 210, 90, 80, 30) $Button_4 = GUICtrlCreateButton("Slot 4", 310, 90, 80, 30) $Button_5 = GUICtrlCreateButton("Slot 1-2", 10, 150, 80, 30) $Button_6 = GUICtrlCreateButton("Slot 2-2", 110, 150, 80, 30) $Button_7 = GUICtrlCreateButton("Slot 3-2", 210, 150, 80, 30) $Button_8 = GUICtrlCreateButton("Slot 4-2", 310, 150, 80, 30) GUISetState() $Progress = 0 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 _RunGW() Case $msg = $Button_2 _RunGW2() Case $msg = $Button_3 _RunGW3() Case $msg = $Button_4 _RunGW4() Case $msg = $Button_5 _RunGW5() Case $msg = $Button_6 _RunGW6() Case $msg = $Button_7 _RunGW7() Case $msg = $Button_8 _RunGW8() EndSelect WEnd ; Local Functions Func _RunGW() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("chargerracing@gmail.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW2() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("chargerracing@gmail.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW3() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("chargerracing@gmail.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW4() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("chargerracing@gmail.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW5() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("bluffing_kid@hotmail.com.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW6() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("bluffing_kid@hotmail.com.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW7() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("bluffing_kid@hotmail.com.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFunc Func _RunGW8() Run("C:\Program Files\Guild Wars\Gw.exe") WinWaitActive("Guild Wars") Sleep(2000) Send("{tab}") Send("bluffing_kid@hotmail.com.com") Send("{tab}") Sleep(100) Send("*********") Send("{enter}") EndFuncI have to go to work now but when I get back im going to read the hole help file on pixel color and so on.... But if one of you would like to give it a try that would be awsome....Thanks again PsaltyDS, and elgabionline.-Charger Never forget the power of words, and how it can affect someones life.Always remember theres another person on the other side of the computer. 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