PsaltyDS Posted July 13, 2006 Posted July 13, 2006 (edited) I never wrote a script until I tried, and I never finished one, until I didn't give up.I'm getting that cast in bronze and mounting it on the SmOke_N wall in my house. @BuddyBoy: Break it down to basic steps and take it one at a time. First thing, make sure you are running the latest Beta (version 129 or 130 last I looked), and using the Beta help file that comes with it.Second thing, learn to use AutoIT via the tutorial mentioned before and in my signature below. The answer to your question will be completely alien to you until you understand some basics about the difference between window titles, handles, WinTitleMatchMode, etc. The answer is to get a list of window handles for the ones you are interested in, keep it in an array, and run a loop to poll those windows. The loop will see if any new ones open up, any of them close (so they can be reopened), and do whatever you want them to while they're open. You won't get far implementing that answer until you learn at least some AutoIT basics. That's just the way it is, and it's the same place many of us started (unless you have a backgound in C++, Perl, or some other language). Edited July 13, 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
Moderators SmOke_N Posted July 13, 2006 Moderators Posted July 13, 2006 I have AutoIt 1-2-3 but i dont get how it works at all. It shows it has a game bot builder, i cannot find that anywhere, it has other stuff he sed i cannot find them... I dont see why you cannot anwer 1 question about a function, then i can look it up in autoit help file and rea dmore about it and then continue my script Ugg im sry i have no success what so ever! i searched fo 30 mins more... for any function that would help me i jsut cant find one and if i ran across it i dont get it! please smooke n or someone can you just help me get that one function I really don't know what "function" your talking about. I was purely trying to help you help yourself. As far as not answering you, you'll note that the last time I posted yesterday was in your thread... I wasn't around the rest of the evening. If you are trying to get the name of the game windows, then I wrote a little thing that went through the windows, and listed them into an array, you could have modded that (had you understood it) to catch the [Game Name]. While 1 Sleep(100) $ArrayWindowList = _GetWinList() For $i = 1 To UBound($ArrayWindowList) - 1 ; gathered all the windows with titles and put them in an array MsgBox(64, 'Info', 'Window ' & $i & ' = ' & $ArrayWindowList[$i]) Next WEnd Func _GetWinList() Local $aWinList = WinList(), $aReturnArray = '' For $iCount = 1 To $aWinList[0][0] If BitAND(WinGetState($aWinList[$iCount][1]), 2) And $aWinList[$iCount][0] <> '' _ And StringInStr($aWinList[$iCount][0], '[Conquer2.0]') Then $aReturnArray = $aReturnArray & $aWinList[$iCount][0] & Chr(01) EndIf Next If $aReturnArray <> '' Then Return StringSplit(StringTrimRight($aReturnArray, 1), Chr(01)) ;Will now return all the window names for [Conquer2.0] Return '' EndFunc 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.
BuddyBoy Posted July 13, 2006 Author Posted July 13, 2006 I really don't know what "function" your talking about. I was purely trying to help you help yourself. As far as not answering you, you'll note that the last time I posted yesterday was in your thread... I wasn't around the rest of the evening. If you are trying to get the name of the game windows, then I wrote a little thing that went through the windows, and listed them into an array, you could have modded that (had you understood it) to catch the [Game Name]. While 1 Sleep(100) $ArrayWindowList = _GetWinList() For $i = 1 To UBound($ArrayWindowList) - 1 ; gathered all the windows with titles and put them in an array MsgBox(64, 'Info', 'Window ' & $i & ' = ' & $ArrayWindowList[$i]) Next WEnd Func _GetWinList() Local $aWinList = WinList(), $aReturnArray = '' For $iCount = 1 To $aWinList[0][0] If BitAND(WinGetState($aWinList[$iCount][1]), 2) And $aWinList[$iCount][0] <> '' _ And StringInStr($aWinList[$iCount][0], '[Conquer2.0]') Then $aReturnArray = $aReturnArray & $aWinList[$iCount][0] & Chr(01) EndIf Next If $aReturnArray <> '' Then Return StringSplit(StringTrimRight($aReturnArray, 1), Chr(01)) ;Will now return all the window names for [Conquer2.0] Return '' EndFunc I know you were trying to help me but i did search and try over and over to look for the one thing i needed. Im not quite sure if your code there is what i need, i explained before, i like need it to find which one disconnected but recently i figured out that AutoIt window tool can read text on the log in screen (but not in-game) So if there is a function/tool that can read multiple windows and recognize there is any kind of text in one window it will go to that window and re log in... I dont need a code from you smoke n i jsut need to know which function that might be able to do that so i can make the code myself and become better.
BuddyBoy Posted July 13, 2006 Author Posted July 13, 2006 Well heres what i got but only 1 problem... Dim $WinWait = 1 Opt("WinDetectHiddenText", 1) While 1 $text = WinGetClassList("[Conquer2.0]", "") While $WinWait WinWait("Instruction") WinClose("Instruction") WinActivate("[Conquer2.0]") WEnd WEnd When i do the winwait and win close functions seperate they work. And when i do the $text and winactivate by them selves it works. But when i have 2 Conquer clients running at same time and im viewing character number 1 and then player number 2 disconnects, it does the win close Instruction jsut fine but then it wont activate the Conquer window because of this... Class names are linefeed (@LF) separated. WinGetClassList works on both minimized and hidden windows. Up to 64KB of text can be retrieved. If multiple windows match the criteria, the classes are read from the most recently active window.[/quote from autoit help] I did a lot of researching for this smoke n and i think i found the one i need (wingetclasslist) But how would i do it for if it reads text on a different conquer window it will activate that one and not the current one that has not disconnected? p.s. i Think i have an idea, is there anyway for it to declare a-z letters. So If any letters a-z are found then it will activate that Conquer window?? Just an idea i dont know for sure though
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