|
|
|
Page 1 of 2 |
[ 19 posts ] |
1, 2 Next
|
 Anyone left that knows AutoIT code? : EverQuest 2 Premium Discussions
|
|
Posted: February 24th, 2005, 8:28 pm
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Pickled was nice enough to send me this code to add to his Recipe Script to allow camping out after you run out of resources however I am unable to get it to work and since he is no longer playing EQ2 I can't raise him on the horn here to try to determine why I can't get it to work. SOO I am going to post it here, if anyone knows AutoIT code well and can look at this to see why it isn't working OR if you can get it to work and can post where you placed everything in the code to get it to work and could share with us I personally would be extreamly greatful. (!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))): ;Add this anywhere at very top of script Global $retryCount = 0
;Add these anywhere Func Retry() ;Retry 20 Times then Quit If($retryCount > 20) Then For $i = 1 to 10 Step 1 ClearTarget() Next $camp = MsgBox(4, "Logout?", "It appears that you have run out of components for this session"_ & @CRLF _ & @CRLF & "Would you like to Camp out now? (60 seconds before auto camp!)", 60) If($camp == 7) Then WinActivate("Everquest II") Sleep(500) Send("/camp") Sleep(50000) MsgBox(0, "Completed!", "Crafting session complete - auto camped out.") Exit(0) Else MsgBox(0, "Completed!", "Crafting session complete please reload script again to restart!") Exit(0) EndIf EndIf If(PixelGetColor($xBegin, $yBegin) == $colorGrayedBegin) Then $retryCount = $retryCount + 1 EndIf EndFunc
Func ClearTarget() Send("{ESC}") Sleep(500) EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Find this code in script and add $retryCount = 0 BELOW $done = 1 ;; ; ;; ;If (($color = $colorBegin) OR ($color = $colorBeginHighlighted)) Then ;; ; $done = 1 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $retryCount = 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Find this code in script and add Retry() BELOW Sleep(2000 + Random(25));; ; ;; ;MouseClick("left", $xBegin, $yBegin) ; Click repeat ;; ; Sleep(2000 + Random(25)) ;; ; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Retry()
When I place this code into my Recipe Script nothing happens. When the resources run out it pops up the window asking if event 1-5 took place (1-3 counters, 4=gray cloud & 5=none of these).
|
|
|
|
|
Posted: February 24th, 2005, 9:24 pm
|
|
|
|
tault_nuad
tault_nuad's Reps:
|
What these code pieces are doing is simply trying to ckick the begin button 20 times and then asking if you wanna quit.
Code looks good as far as i can see... did you placed all four code pieces at the right places?
|
|
|
|
|
Posted: February 24th, 2005, 10:30 pm
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Yeah I understand what it is doing but the problem is the way his code is working without this code if it runs out of resources it defaults to the (which event is taking place screen (1-5)) which stops the script from moving forward to click that button then camp out. Maybe it is an issue with my computer... /boggle But I have tried the original script on several machines (un-modified) and that is the consistant result I get.
Loraik
P.S.
Yes checked, dbl. checked and tripple checked to make sure all info. was where he said it should be.
|
|
|
|
|
Posted: March 2nd, 2005, 5:17 pm
|
|
|
|
tault_pickled
tault_pickled's Reps:
|
Ok first of all I updated your post to clear up the for statement which may have a problem with uppercase, also added WinActivate before camp so it will make sure to /camp the correct window  Other than that the script simply does not read the events. 1. Is the ColorGrayedBegin BUTTON GRAY? 2. Yes -> Ok -> Ask this 20 attempts -> still gray? -> yes -> /camp. 3. No -> then reset the retryCount as we have managed to start crafting again (retryCount = 0). You must have incorrect pixel colors set up for begin button as I know you manually modified them to suit your window size, so I can't really help as I dont know your offsets. You also mentioned recieving the colour events box a lot, you should really only see this on the first few runs until it has set up all the info. If it reappears regularly it may be the crafting window is being shifted out of place, you could try using the LOCK command in the EQ2 UI.
|
|
|
|
|
Posted: March 2nd, 2005, 8:54 pm
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Sent you a PM Pickled, think I am clear on exactly what is going on now. I have gone thru all the pixel colors like a billion times but will reverify. All windows are locked all the time. Will apply changes tonight when I get home and report back to ya.
Loraik
|
|
|
|
|
Posted: March 3rd, 2005, 9:47 am
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Still getting the same problem. When it runs out of resources (in this case fuel which happens to be in same loc. as events) it moves mouse down to "grey" begin button, moves mouse up to $xevent, $yevent loc. takes reading, see's that it is not a counter nor $colorbehindevents and pops a msg. box asking for 1-3, 4 or 5.
So I say 5 (none of these) and it plays like it is crafting (casting all the counters for 20 times (about 10 minutes or so) then I get a error box saying:
Error: "For" statement is badly formatted.
Should Be:
For $varname = nn To nn [Step nn]
I have checked, dbl checked and triple checked and the $colorgreybegin is the correct color on screen and has the right location variables.
Loraik
|
|
|
|
|
Posted: March 3rd, 2005, 4:10 pm
|
|
|
|
tault_pickled
tault_pickled's Reps:
|
Umm incase you hadnt bothered to read my above post I already edited the for statement.
As for the color checking that is still an issue with the .ini file for that profile, notwithstanding the fact I've PM'ed you about this also.
|
|
|
|
|
Posted: March 3rd, 2005, 4:52 pm
|
|
|
|
tault_pickled
tault_pickled's Reps:
|
Ok try this: (use Editor, Edit Menu -> Find and Replace) CHANGE (!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))): If (NOT $strInput=0) OR ($strInput<4) Then
TO (!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))): If ($strInput>0) AND ($strInput<6) Then
Unfortunately I have never re-worked the original code, which I intended to do at some point < I wrote the recipe mode and lots of other parts > but the event checking was written by Thereus - which has far to many 'if' & 'else' clauses that it makes it hard to understand. The above now accepts input from option 4 / 5 where before it was only accepting info from options 1 - 3! Would be nice to re-work the entire event checking, but sadly I no longer play EQ2, so the incentive is lost.
|
|
|
|
|
Posted: March 3rd, 2005, 10:47 pm
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
I am sorry I should have stated that error I am getting is from your revised "For" code. The only way it would not error on that line is if I remove the Step 1 completely. I tried formatting it the way it said it "should be" but it still got an error.
I also did delete the .ini and let it code a new .ini file then I went into the .ini file and manually verify the color codes & locations were set correct.
There is only one thing that I am looking at that I am not 100% sure I have set correct. There is a variable $colorbegin that I am not real 100% sure what state it is asking for info. on. I say this because if you move the mouse over the Begin button it auto highlights so is that variable wanting the color of the button prior to highlighting or is it asking for the highlighted color. I have tried it both ways and to be honest am not even sure if it has anything to do with the existing problem, I just thought I would mention that I wasn't 100% on the purpose of that variable.
If it would just see the begin button is grey and go directly to the camp out sequence (option to contiune or camp in 60 sec) and not try to continue crafting 20 times it would be more efficient I think and I wouldn't have to worry about it looking at the event/fuel area and detecting a odd color. But I think that might mess up your multiple recipe crafting (not sure haven't figured out how to do that yet).
Thanks again for all your help, I know your not playing anymore and really app. you taking time out of your day/night to trouble shoot this.
Loraik
|
|
|
|
|
Posted: March 4th, 2005, 12:49 am
|
|
|
|
tault_pickled
tault_pickled's Reps:
|
Hmm I just ran the above syntax of the For and got no error like this ??? NoError.au3 (!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))): $z = 1
For $i = 1 to 10 Step 1 $z = $z + 1 Next
MsgBox(0, "", $z)
You must be using some weird version of AutoIt (version 2?). www.hiddensoft.com/autoit3Also try the above changes to code as suggested. Also look at the recipe crafter [version 1] post to overcome what you have just described to me, as I explained this already in my last post there (of course you would have to change the values as you modified all the locations  ). I did keep my word I would help you, when you won that competition for your making the effort. 
|
|
|
|
|
Posted: March 4th, 2005, 1:15 am
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Ya know I think I did download and am using the latest AutoIT (3.10) which if memory server me right (trying to remember because I do this stuff late at night) came out after you posted your script... Maybe there is a difference.. /boggle Maybe I should go back to 3.0...
The error on the "For" has to do with the formatting of "Step 1". What I pasted above about the error is exactly what the error box said. I tried changing it to [Step 1] and that didn't work. Like I said the only way I could get around not getting an error on that line after your change is by removing the "Step 1".. /boggle
Either way tonight I will try what you have posted and see if it works. With luck it will run like a raped ape!
Loraik
|
|
|
|
|
Posted: March 4th, 2005, 1:17 am
|
|
|
|
tault_pickled
tault_pickled's Reps:
|
Should work with all versions of Auto IT it's standard syntax, I've used it about 50 times in the recipe script as it is 
|
|
|
|
|
Posted: March 4th, 2005, 1:22 pm
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Ok went back and redownloaded AutoIT 3.1 and this is what I get now.
It moves past the "For" issue it had before and with your latest modification it will now move to the campout procedure (with 1 hickup).
This is what I get. When I run the script it still reads the color at the $event variable location (fuel/counter) and pops the first menu asking what to do just like before (1-3, 4 & 5). I select 5 being the only one that would make sence ( it reads the color of $colorbehindevents and it crafts the item.
It then goes down and clicks Repeat then the greyed out Begin button, moves the mouse back up to the $event variable location (fuel/counter) however since the Begin button is now grey there is a different color at that location (it is now reading the pixel color of the fuel that is there) and up pops a window asking me to asign it to 1-3, 4 or 5 again.
So I select 5 again and it does it's 20 crafts then clears target, and pops up a box asking to continue or auto camp. I let it go to auto camp (don't touch anything) and it timesout (selects NO after the 60 seconds BUT instead of then camping it seems to bypass the camp sequence and just brings up the next window that says "Crafting session complete please reload script again to restart!". I click ok and it shuts down the window & script.
Ok so this is what it is looking like to me. It appears it is going to HAVE to have a variable asigned to each of the places it is popping up a menu asking what that color is. I just don't see anyway around it since it won't simply see the begin button is grey and go straight to the camp script. I am going to see if I can figure out how to add 2 additional options to the menu for this purpose.
Unless I am totally off base here (which is totally possible).. Just frustrating cause i understand the idea and see the "gears turning" I just can't seem to add my 2 cents to make those gears mesh..
Loraik
|
|
|
|
|
Posted: March 4th, 2005, 4:53 pm
|
|
|
|
tault_pickled
tault_pickled's Reps:
|
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))): ;Add this anywhere at very top of script Global $retryCount = 0
;Add these anywhere Func Retry() ;Retry 20 Times then Quit If($retryCount > 20) Then For $i = 1 to 10 Step 1 ClearTarget() Next $camp = MsgBox(4, "Logout?", "It appears that you have run out of components for this session"_ & @CRLF _ & @CRLF & "Would you like to Camp out now? (60 seconds before auto camp!)", 60) If($camp == 6) Then WinActivate("Everquest II") Sleep(500) Send("/camp") Sleep(50000) MsgBox(0, "Completed!", "Crafting session complete - auto camped out.") Exit(0) Else If($camp == 7) Then MsgBox(0, "Completed!", "Crafting session complete please reload script again to restart!") Exit(0) EndIf WinActivate("Everquest II") Sleep(500) Send("/camp") Sleep(50000) Exit(0) EndIf If(PixelGetColor($xBegin, $yBegin) == $colorGrayedBegin) Then $retryCount = $retryCount + 1 EndIf EndFunc
Func ClearTarget() Send("{ESC}") Sleep(500) EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Find this code in script and add $retryCount = 0 BELOW $done = 1 ;; ; ;; ;If (($color = $colorBegin) OR ($color = $colorBeginHighlighted)) Then ;; ; $done = 1 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $retryCount = 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Find this code in script and add Retry() BELOW Sleep(2000 + Random(25));; ; ;; ;MouseClick("left", $xBegin, $yBegin) ; Click repeat ;; ; Sleep(2000 + Random(25)) ;; ; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Retry()
Should fix the camping issues. As far the events are concerned did you actually try what I asked you to above to change x to x (strinput)? Also it shouldn't be reading fuel, the mouse should just move to the counter box area? Hehe
|
|
|
|
|
Posted: March 4th, 2005, 9:38 pm
|
|
|
|
tault_loraik
tault_loraik's Reps:
|
Yes I made those changes you posted above, copy and pasted to ensure it was exact.
As far as the "reading the fuel" what it is doing is yes the mouse moves there but it does read the pixel at that location as soon as the mouse stops plus I have confirmed with AutoIT spy that it is indeen reading the color at that location. I say the pixel color of the fuel because as you know when your out of a resource it goes to the screen which shows the resources and has the greyed out Begin button on it so when the mouse moves up there the fuel box is inline with the $event location but I am 100% sure it IS reading the pixel when the mouse moves up there.
Like I said before when it clicks repeat and brings up the window with the greyed out Begin button it clicks the greyed out Begin button then moves the mouse to the $event location where it reads the pixel color. Which makes sence because from what I understand from the way you have this setup it trys to craft just as if it had all the resources 20 times reading the $event variable each time then goes to the next try repeating the reading of the $event variable (but because I told it no. 5 and that $event loc. isn't going to change in color due to the fact it isn't actually crafting it knows that pixel color now = no. 5) it doest this 20 times & hits the camp out process.
Loraik
|
|
|
|
|
Who is online |
|
Users browsing this forum: No registered users and 158 guests |
|
|
|