Zerohour Posted September 3, 2005 Author Posted September 3, 2005 (edited) What version are you using? How did you install it? Is you input folder in the correct spot?On my computer it's: C:\Program Files\AutoIt3\Include<{POST_SNAPBACK}>I'm using v3 (most current because I just got it this morning)I downloaded the zip and extracted it onto my desktop.And I have no idea what the hell you're talking about "input folder"It's alright val Anyhelp from anyone is appreciated and I'm glad you've at least shown interest in helping me! Edited September 3, 2005 by Zerohour
Moderators SmOke_N Posted September 3, 2005 Moderators Posted September 3, 2005 put the Autoit folder in your Program Files... so you don't have to change all the Include functions in the future to their full path. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Zerohour Posted September 3, 2005 Author Posted September 3, 2005 (edited) put the Autoit folder in your Program Files... so you don't have to change all the Include functions in the future to their full path.<{POST_SNAPBACK}>Moving it now, I'll run the script ASAP and let you know what happens.Update: GUI started fine. Seems to be working.Something else I'd like to see on the gui would be a display for the timer and a way to minimize the gui to the system tray. Is that possible? Edited September 3, 2005 by Zerohour
Moderators SmOke_N Posted September 3, 2005 Moderators Posted September 3, 2005 Look up TimerInit() / TimerDiff() in help and there was a post a few days ago on minimizing to tray. GL.. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Zerohour Posted September 3, 2005 Author Posted September 3, 2005 (edited) Look up TimerInit() / TimerDiff() in help and there was a post a few days ago on minimizing to tray.GL..<{POST_SNAPBACK}>Setting up a timer and the systemtray is now on my todo list. But untill I get that done I want to have the script actually work. I just tested it 3 times and each time all it did was select the active window! (Hell, at least that works.) but after that it doesn't do anything.This is the code I'm using as of right nowexpandcollapse popup#include <GUICONSTANTS.AU3> Opt("WINTITLEMATCHMODE", 4) Global $Paused HotKeySet("{PAUSE}", "TogglePause") $MAIN_GUI = GUICreate("AutoIt Example", 125, 50) $BUTTON_1 = GUICtrlCreateButton("START", 10, 10, 50, 30, $BS_DEFPUSHBUTTON) $BUTTON_2 = GUICtrlCreateButton("STOP", 65, 10, 50, 30, $BS_DEFPUSHBUTTON) GUISetState() While 1 $MSG = GUIGetMsg() Select Case $MSG = $GUI_EVENT_CLOSE Exit Case $MSG = $BUTTON_1 MAIN_LOOP() Case $MSG = $BUTTON_2 If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(4,"Exit Chose","Are you sure you want to Exit?") Select Case $iMsgBoxAnswer = 6 Exit EndSelect EndSelect WEnd Func MAIN_LOOP() $CNT = 0 While WinExists("PHANTASY STAR ONLINE Blue Burst") Sleep(60000) $CNT = $CNT + 1 If $CNT = 1 Then If Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); Send("{ESC 3}") Sleep(500) Send("{F4}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ESC 5}") EndIf If $CNT = 6 Then If Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); Send("{ESC 3}") Sleep(500) Send("{F4}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ESC 5}") EndIf If $CNT = 11 Then Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); Send("{ESC 3}") Sleep(500) Send("{F4}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ESC 5}") EndIf If $CNT = 15 Then Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); Send("{ESC 3}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{DOWN 3}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{DOWN}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ESC 3}") $CNT = 0 EndIf WEnd EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFuncWhat could I have screwed up?Edit: Updated the code Edited September 3, 2005 by Zerohour
Moderators SmOke_N Posted September 3, 2005 Moderators Posted September 3, 2005 Did you minimize it? Instead of While 1... Try: While WinExists("PHANTASY STAR ONLINE Blue Burst") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Valuater Posted September 3, 2005 Posted September 3, 2005 (edited) Did you minimize it?Instead of While 1... Try: While WinExists("PHANTASY STAR ONLINE Blue Burst")<{POST_SNAPBACK}>got it8) Edited September 3, 2005 by Valuater
Zerohour Posted September 3, 2005 Author Posted September 3, 2005 (edited) I changed the line that you suggested, it works fine. It's still not doing the commands that it's assigned to do. I've update the code above, again. Maby someone can see what I don't... Edited September 3, 2005 by Zerohour
Moderators SmOke_N Posted September 3, 2005 Moderators Posted September 3, 2005 Try debugging it w/ a MsgBox: (on a 2 second timer) expandcollapse popup#include <GUICONSTANTS.AU3> Opt("WINTITLEMATCHMODE", 4) Global $Paused HotKeySet("{PAUSE}", "TogglePause") $MAIN_GUI = GUICreate("AutoIt Example", 125, 50) $BUTTON_1 = GUICtrlCreateButton("START", 10, 10, 50, 30, $BS_DEFPUSHBUTTON) $BUTTON_2 = GUICtrlCreateButton("STOP", 65, 10, 50, 30, $BS_DEFPUSHBUTTON) GUISetState() While 1 $MSG = GUIGetMsg() Select Case $MSG = $GUI_EVENT_CLOSE Exit Case $MSG = $BUTTON_1 MAIN_LOOP() Case $MSG = $BUTTON_2 If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(4,"Exit Chose","Are you sure you want to Exit?") Select Case $iMsgBoxAnswer = 6 Exit EndSelect EndSelect WEnd Func MAIN_LOOP() $CNT = 0 While WinExists("PHANTASY STAR ONLINE Blue Burst") Sleep(60000) $CNT = $CNT + 1 If $CNT = 1 Then If Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); If WinActive("PHANTASY STAR ONLINE Blue Burst") Then MsgBox(0, "Debug", "Made it to $CNT 1", 2) Send("{ESC 3}") Sleep(500) Send("{F4}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ESC 5}") MsgBox(0, "Debug", "Made it to end of $CNT 1", 2) EndIf If $CNT = 6 Then If Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); If WinActive("PHANTASY STAR ONLINE Blue Burst") Then MsgBox(0, "Debug", "Made it to $CNT 6", 2) Send("{ESC 3}") Sleep(500) Send("{F4}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ESC 5}") MsgBox(0, "Debug", "Made it to end of $CNT 6", 2) EndIf If $CNT = 11 Then If Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); If WinActive("PHANTASY STAR ONLINE Blue Burst") Then MsgBox(0, "Debug", "Made it to $CNT 11", 2) Send("{ESC 3}") Sleep(500) Send("{F4}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(3000) Send("{ESC 5}") MsgBox(0, "Debug", "Made it to end of $CNT 11", 2) EndIf If $CNT = 15 Then If Not WinActive("PHANTASY STAR ONLINE Blue Burst") Then WinActivate("PHANTASY STAR ONLINE Blue Burst"); If WinActive("PHANTASY STAR ONLINE Blue Burst") Then MsgBox(0, "Debug", "Made it to $CNT 15", 2) Send("{ESC 3}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{DOWN 3}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{DOWN}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ENTER}") Sleep(500) Send("{ESC 3}") MsgBox(0, "Debug", "Made it to end of $CNT 16", 2) $CNT = 0 EndIf WEnd EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Also, you took the If Not and replaced it with just Not... I don't understand that logic. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Zerohour Posted September 3, 2005 Author Posted September 3, 2005 (edited) Well, I did that because I was hoping that the two if cmd lines were causing an error. It didn't help me. Anyways, I got the msg popup with you code and it still was not execing the commands. This is getting depressing. Added: It also showed the complete dialog so either the script is totally fubar'd or the game has somehow disabled emulated keystrikes. (It has gamegaurd so I have no clue) Edited September 3, 2005 by Zerohour
Zerohour Posted September 3, 2005 Author Posted September 3, 2005 Well, I've gone through debuging it. Riping it apart. Compiling it into an exe. So finally I got the idea of trying to see if the on screen keyboard would send the keystrokes to the game. And it doesn't. I'm kind of pissed off I just spent about 9 hours learning how to script and code this one thing and it doesn't work, but at least I've learned something today.
quick_sliver007 Posted September 3, 2005 Posted September 3, 2005 Well, I've gone through debuging it. Riping it apart. Compiling it into an exe. So finally I got the idea of trying to see if the on screen keyboard would send the keystrokes to the game.And it doesn't.I'm kind of pissed off I just spent about 9 hours learning how to script and code this one thing and it doesn't work, but at least I've learned something today. <{POST_SNAPBACK}>Well don't give up yet on scripting. There is a lot for things that can be made automatic. I once made a bot to gain levels in a RPG game. So I was multi tasking in my sleep. Sleeping and playing my game at the same time. Just so you know, AutoIt3 is the easiest scripting lauguage I know of and you can do more then just make bots with it. You can use it to store information in INI files and retrieve the info like customer data. If you like you can even build small games with it, search Hangman and Snake in the scripts and scraps section of the forum.P.S. You don't have to complie the script to run it on computers with AutoIt3 installed. .
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