
Mike :)
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by Mike :)
-
Great idea about the tutorial, but in my (probably bad) opinion you can learn AutoIt the best as you are practicing it. By creating scripts you're learning the best part of AutoIt scripting (one you're interested in the most f.ex. network management, game script development or general windows usage), firstly using the most basic commands, then going more and more deeply and more effective. Then you start helping other people that are having problems. After few years of learning you become LxP and write a manual because you're tired of replying to each noob asking stupid questions (me). Nice tactics! lol joke, yeah great thing!
-
Thanks, I'll add them ASAP !!! Cool ideas anyway I added more Loot just for fun, so it picks up more items in-game that's important for me so i left it alone. Here's how my Loot looks like now (couldn't change it at all) Func Loot() If GUICtrlRead($autoloot) = 1 Then MsgBox (0, "loading", "" ,1) Sleep(1000) Sendstr('{SPACE}', 1000) Sendstr('{SPACE}', 1000) EndIf EndFunc Func Sendstr($istr,$idelay) Opt('SendKeyDownDelay',$idelay) Send ($istr) EndFunc Well, I think it's ok
-
Question concerning SendKeyDownDelay
Mike :) replied to Mike :)'s topic in AutoIt General Help and Support
Well, all I can say is I'll surelly do this, as soon as i finish it Thanks for help again! -
Question concerning SendKeyDownDelay
Mike :) replied to Mike :)'s topic in AutoIt General Help and Support
Thanks a lot JdeB, I'd never write such code, although it's not what I actually meant. I'm going to run my script on old laptop (Dell, 400MhZ PII) with NO graphics accelerator, with turned on game that requires it, so... I need it to save as much CPU as possible... what you just written is great, but it still does the SendKeyDownDelay option, I don't know if it's the best solution. Well, still I might be wrong, maybe changing options doesn't affect the CPU at all? -
Hello! I was wondering if there's any method to apply Opt('SendKeyDownDelay') to some of sent keys and to some not? Well, of course I could do f.ex. Opt('SendKeyDownDelay',1) Send ('2') Opt('SendKeyDownDelay', 100) Send('{SPACE}') But I think it's too noobie method... though I have no ideas Is there anything I can do like $var = Opt('SendKeyDownDelay',1) $var2 = Opt('SendKeyDownDelay', 100) Send('2',$var) Send('{SPACE}',$var2) ?? ( I know it's a bad code, I was just giving example to make my idea easier to understand )
-
nvm I added new topic...
-
Well, I just fixed all the Send('{SPACE}') stuff . I was so happy, I felt like I was closing to the far end of my script and then.... wat da f**k!! My another problem is about GUICreate command used in function called by button. I really don't know why it doesn't work, well.... here's the code: $button4 = GUICtrlCreateButton ("", 290, 0, 170, 115, $BS_BITMAP + $BS_FLAT) GUICtrlSetImage (-1, "pic\pic.bmp") GUISetOnEvent ($button4, "Pop") Global $advanced = 0 Here's the button code calling function Pop. Well, here goes the function Func Pop() Global $advanced = 1 GUICreate("Y", 215, 297, @DesktopWidth/2, @DesktopHeight/2,$WS_POPUP + $WS_EX_CLIENTEDGE ) Guisetstate() $def1 = GuiCtrlCreateCheckbox("", 60, 40, 10, 10) $Group_4 = GuiCtrlCreateGroup("", 90, 30, 30, 260) $Group_5 = GuiCtrlCreateGroup("", 130, 30, 30, 260) $def2 = GuiCtrlCreateCheckbox("", 60, 70, 10, 10) $def3 = GuiCtrlCreateCheckbox("", 60, 100, 10, 10) $def4 = GuiCtrlCreateCheckbox("", 60, 130, 10, 10) $def5 = GuiCtrlCreateCheckbox("", 60, 160, 10, 10) $att1 = GuiCtrlCreateCheckbox("", 100, 40, 10, 10) $att2 = GuiCtrlCreateCheckbox("", 100, 70, 10, 10) $att3 = GuiCtrlCreateCheckbox("", 100, 100, 10, 10) $att4 = GuiCtrlCreateCheckbox("", 100, 130, 10, 10) $att5 = GuiCtrlCreateCheckbox("", 100, 160, 10, 10) $heal1 = GuiCtrlCreateCheckbox("", 140, 40, 10, 10) $heal2 = GuiCtrlCreateCheckbox("", 140, 70, 10, 10) $heal3 = GuiCtrlCreateCheckbox("", 140, 100, 10, 10) $heal4 = GuiCtrlCreateCheckbox("", 140, 130, 10, 10) $heal5 = GuiCtrlCreateCheckbox("", 140, 160, 10, 10) $Label_20 = GuiCtrlCreateLabel("Player1", 10, 40, 40, 20) $Label_21 = GuiCtrlCreateLabel("Player2", 10, 70, 40, 20) $Label_22 = GuiCtrlCreateLabel("Player3", 10, 100, 40, 20) $Label_23 = GuiCtrlCreateLabel("Player4", 10, 130, 40, 20) $Label_24 = GuiCtrlCreateLabel("Player5", 10, 160, 40, 20) $alldef = GuiCtrlCreateCheckbox("", 60, 270, 10, 10) GUISetOnEvent (-1, "ALL") $allatck = GuiCtrlCreateCheckbox("", 100, 270, 10, 10) GUISetOnEvent (-1, "ALL") $allheal = GuiCtrlCreateCheckbox("", 140, 270, 10, 10) GUISetOnEvent (-1, "ALL") $Group_28 = GuiCtrlCreateGroup("", 50, 30, 30, 260) $Label_29 = GuiCtrlCreateLabel("Defense", 43, 10, 40, 20) $Label_29 = GuiCtrlCreateLabel("Attack", 89, 10, 40, 20) $Label_29 = GuiCtrlCreateLabel("Heal", 133, 10, 40, 20) EndFunc Func ALL() MsgBox(1, "", GUICtrlRead($alldef)) Global $buff = 0 If GUICtrlRead($alldef) = 1 Then GUICtrlSetState($def1,$GUI_CHECKED) GUICtrlSetState($def2,$GUI_CHECKED) GUICtrlSetState($def3,$GUI_CHECKED) GUICtrlSetState($def4,$GUI_CHECKED) GUICtrlSetState($def5,$GUI_CHECKED) Global $buff = 1 ElseIf GUICtrlRead($alldef) = 0 AND $buff = 1 Then GUICtrlSetState($def1,$GUI_UNCHECKED) GUICtrlSetState($def2,$GUI_UNCHECKED) GUICtrlSetState($def3,$GUI_UNCHECKED) GUICtrlSetState($def4,$GUI_UNCHECKED) GUICtrlSetState($def5,$GUI_UNCHECKED) Global $buff = 0 EndIf Global $buff1 = 0 If GUICtrlRead($allatck) = 1 Then GUICtrlSetState($att1,$GUI_CHECKED) GUICtrlSetState($att2,$GUI_CHECKED) GUICtrlSetState($att3,$GUI_CHECKED) GUICtrlSetState($att4,$GUI_CHECKED) GUICtrlSetState($att5,$GUI_CHECKED) Global $buff1 = 1 ElseIf GUICtrlRead($allatck) = 0 AND $buff1 = 1 Then GUICtrlSetState($att1,$GUI_UNCHECKED) GUICtrlSetState($att2,$GUI_UNCHECKED) GUICtrlSetState($att3,$GUI_UNCHECKED) GUICtrlSetState($att4,$GUI_UNCHECKED) GUICtrlSetState($att5,$GUI_UNCHECKED) EndIf Global $buff2 = 0 If GUICtrlRead($allheal) = 1 Then GUICtrlSetState($heal1,$GUI_CHECKED) GUICtrlSetState($heal2,$GUI_CHECKED) GUICtrlSetState($heal3,$GUI_CHECKED) GUICtrlSetState($heal4,$GUI_CHECKED) GUICtrlSetState($heal5,$GUI_CHECKED) Global $buff2 = 1 ElseIf GUICtrlRead($allheal) = 0 AND $buff2 = 1 Then GUICtrlSetState($heal1,$GUI_UNCHECKED) GUICtrlSetState($heal2,$GUI_UNCHECKED) GUICtrlSetState($heal3,$GUI_UNCHECKED) GUICtrlSetState($heal4,$GUI_UNCHECKED) GUICtrlSetState($heal5,$GUI_UNCHECKED) EndIf EndFunc Any ideas why it doesn't work?
-
LxP, in previous code I was just trying different ways to put it all to work, i never thought GUICtrlRead($loot) could work ^^. Thanks for the code, I done it like this: $autoloot = GUICtrlCreateCheckbox ("Auto PickUp", 120,153) Then Func Loot() If GUICtrlread($autoloot) = 1 Then Send("{SPACE}") Else EndIf And here's code fragment ( i changed it completely in order to use less space, so I made it all in variables, theres just 1 scheme rest are vars): If GUICtrlRead ( $afk1 ) = $GUI_CHECKED AND GUICtrlRead ( $heal ) = $GUI_CHECKED Then Global $kolor1 = PixelGetColor( $pxl1,$buff1y ) Call ("SmartHeal_") Call ("Loot") ElseIf GUICtrlRead ( $afk2 ) = $GUI_CHECKED AND GUICtrlRead ( $heal ) = 1 OR 0 Then WinActivate("Bez tytułu - Notatnik", "") Send("1") Call ("Buff") Call ("Loot") Else Call ("Loot") EndIf Well, it works Thanks alot guys! But here's my another problem: ...To be continued in other topic...
-
Oh, it's not what I mean, the game doesn't have anything to do with that. I was just wondering if loop can work while rest of script is executing or if it just stops it, though I think i understand now Thanks
-
So you mean that I would put that in loop so it checks everytime? Nice idea, thanks User will pause the whole script using F5 hotkey, it's defined in script . Thanks alot again Oh, but then again, doing the loop over and over will pause the script, won't it?
-
Just run this one, you'll see what i mean. I know that what it does might confuse you, but it's for a game. Every time the mouse goes up the screen and clicks with RMB, right after the loading MsgBox I need space to be clicked (or not, if the PickUp checkbox wasn't clicked). Just run it and see scriptie.au3
-
Yeah, but you still miss the point, because it won't click the space in the right time when I want, and also, it will stop the script (it will do the loop forever 'cause it always has to click the space). By doing this I will prevent my script from continuing auto-aura proggress. Oh well, maybe if I put something like this on end of script and it would loop it 2 times then go back to beggining it could work, but it need to press space WHILE the auto-aura is running . Anyway, I think you helped me enough NegativeNrG, don't waste you're time on me Thanks Alot Sure, I'm using this function ^^ but I don't need it to run with space, I want space to work in background
-
Exactly I'm trying to set CheckBox called AutoPickUp which would (when clicked) set a func, variable, string or whatever to have Send('{SPACE}') inside (if not clicked it would be Sleep(1) ), and next in code i need to put something like Call(Loot) or $loot or anything around 20 - 30 times so it would click Space in specifical moments ONLY if the checkbox was checked. Hmm, let's look at this ;@@@@@@@@@@@STARTS def buff @@@@@@@@@@@ Send("2") Sleep(50) If GUICtrlRead ( $def1 ) = 1 OR 0 Then MouseMove ( $buff1x,$buff1y ,1 ) MouseClick("Right",$buff1x,$buff1y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) Send("2") ;@@@@@@@@@@@@DEF 2ND PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def2 ) = 1 OR 0 Then MouseMove ( $buff2x,$buff2y ,1 ) MouseClick("Right",$buff2x,$buff2y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@DEF 3RD PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def3 ) = 1 OR 0 Then MouseMove ( $buff3x,$buff3y ,1 ) MouseClick("Right",$buff3x,$buff3y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@DEF 4TH PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def4 ) = 1 OR 0 Then MouseClick("Right",$buff4x,$buff4y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@DEF 5TH PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def5 ) = 1 OR 0 Then MouseMove ( $buff5x,$buff5y ,1 ) MouseClick("Right",$buff5x,$buff5y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) This is part of script which automatically gives Defense aura to all party members in MU Online game. I must insert the function into the code everywhere you see GUICtrlRead ($loot), so I need it to be short, the function may be defined later. So, any ideas? Do..Until won't do it, it's a loop
-
Oh yeah, It's really nice idea, but if I had to put sth like if $x > $y Then _msg() Elseif $x < $y Then _msg2() Endif 100 times in my script (and I have to do that) it would be long and done by noobie way, so... any other ideas? Or maybe I misunderstood you?
-
Thanks alot, I didn't really expect you to read the whole script either, thanks alot for help with my bloody problem, I'm going to fix that now. Thanks again! It's a good feeling to be welcomed by Great Member (I'm sorry but 1500 posts is something ) on such big forum, I'm very pleased . Function? Great Idea, but how to make it vary on if I check the checkbox or not? I mean, f.ex. should i use: If $button = $GUI_CHECKED (i know it's not the same command for checkbox but let's say it's ok) Then Func Loot() Send('{SPACE}') EndFunc ElseIf $button = $GUI_UNCHECKED Then Func Loot() Sleep(1) EndFunc() EndIf Well, from my few-month experience I can say it's impossible, I discovered some problems with defining functions inside If statement before (error: autoit can't find EndIf, sometimes EndFunc too), so how should I do that? That's why I thought there could be another way of doing this, like strings, variables or anything else, but I couldn't find anything that fit. What should I use then? Oh yeah, I tried Select too, it doesn't work either. My english is actually bad, you'll find out this later PS. Is there any way to control packets using AutoIt commands? I mean... create a simple software proxy modifying packets sent to specifical server. Is that possible or I have to write it in C++ already?
-
Okay, thanks alot. I think I'll try this before: If $resauto = $res1 Then GUICtrlSetState($res1, $GUI_CHECKED) ElseIf $resauto = $res2 Then GUICtrlSetState($res2, $GUI_CHECKED) ElseIf $resauto = $res3 Then GUICtrlSetState($res3, $GUI_CHECKED) ElseIf $resauto = $res4 Then GUICtrlSetState($res4, $GUI_CHECKED) What I think about it is that the GUICtrlSetState doesn't read what is inside $resauto and it just tries to change it, that's why i'm going to replace it with this code. I think it's more clear and it doesn't make program write alot when quitting (nice on slower pcs). Anyway thanks alot for help, you gave me great ideas. Am I right, or should I rather use your code? (i'm still noob to this all)
-
Oh yeah, and don't look at these GUICtrlRead ( $loot ), I was just trying many different things to make it work and none really helped :/
-
Hi Everyone I'm new to this forum, but i'm trying to learn AutoIt as hard as I can Well, what I'm doing now is script for a game which would basically play for me And, I have problems with GUICtrlSetState function. I'm trying to make this script create config.ini and save some informations inside to read them later and paste into correct places. It worked for input box, though I have problems with Radio boxes. Please take a look at this: GUICtrlCreateGroup ("", 4, 1, 100, 107) GUICtrlCreateLabel("Game resolution", 10, 9) GUICtrlSetColor(-1, 0xFFFFFF) $res1 = GUICtrlCreateRadio ("640x480", 10, 24, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res1, "GUI_CHECKED" ) $res2 = GUICtrlCreateRadio ("800x600", 10, 44, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res2, "GUI_CHECKED" ) $res3 = GUICtrlCreateRadio ("1024x768", 10, 64, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res3, "GUI_CHECKED" ) $res4 = GUICtrlCreateRadio ("1280x1024", 10, 84, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res4, "GUI_CHECKED" ) $resauto = IniRead ("config.ini", "Config", "Res", "$res2") GUICtrlSetState($resauto, $GUI_CHECKED) GUICtrlCreateGroup ("",-99,-99,1,1) Here's part of gui with "spaced out" part where problem occurs. Here's the part saving config.ini: $file = IniWrite("config.ini", "Config", "Sleep", GUICtrlRead($sleep1)) If GUICtrlRead($res1) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res1") ElseIf GUICtrlRead($res2) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res2") ElseIf GUICtrlRead($res3) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res3") ElseIf GUICtrlRead($res4) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res4") EndIf If $file = -1 Then MsgBox(0, "Error", "Cannot open log file.") EndIf I know it's not really a good code, but it should really work O_o. I wonder if GUICtrlSetState is trying to $GUI_CHECKED on $resauto instead of reading it? Can anyone help? Please, I was trying to fix that for hours and no success Also checked $resauto, and it has the right variable inside ($res2) Well, If you don't understand what I wrote here (it's pretty complicated i guess) I'll try to explain the whole idea. This part of code is Radio group of resolution choice, and in closing gui event it's writting name of radio which was previously checked to config.ini file. Then, when i open it again, it's reading from config again and it SHOULD CHECK THE RIGHT RADIO but it doesn't T_T. Ok, one more question: I'm trying to declare a variable like this: $loot = Send("{SPACE}") then use just $loot inside the code to "call" it, and I try to run the script it tells me that the line cannot be parsed. Should I use string or something? Ok, here's the whole code of my script (sorry for length), also sorry for my bad english ^^: #include <GUIConstants.au3> Break(0) Opt("GUIOnEventMode", 1); Change to OnEvent mode $mainwindow = GUICreate("MU Afk Complex", 615, 220) GUISetBkColor (0x51606C) $menu = GUICtrlCreateMenu ( "Menu") $about = GUICtrlCreateMenuitem ("About", $menu) GUICtrlSetOnEvent ( $about, "About" ) $quit = GUICtrlCreateMenuitem ("Exit", $menu) GUICtrlSetOnEvent ( $quit, "CLOSEClicked" ) GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") ;@@@@@@@@@@@@@ Resolution Box @@@@@@@@@@@@@@@@@@ GUICtrlCreateGroup ("", 4, 1, 100, 107) GUICtrlCreateLabel("Game resolution", 10, 9) GUICtrlSetColor(-1, 0xFFFFFF) $res1 = GUICtrlCreateRadio ("640x480", 10, 24, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res1, "GUI_CHECKED" ) $res2 = GUICtrlCreateRadio ("800x600", 10, 44, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res2, "GUI_CHECKED" ) $res3 = GUICtrlCreateRadio ("1024x768", 10, 64, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res3, "GUI_CHECKED" ) $res4 = GUICtrlCreateRadio ("1280x1024", 10, 84, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $res4, "GUI_CHECKED" ) $resauto = IniRead ("config.ini", "Config", "Res", "$res2") GUICtrlSetState($resauto, $GUI_CHECKED) GUICtrlCreateGroup ("",-99,-99,1,1) ;@@@@@@@@@@@@@@@@@Afk box @@@@@@@@@@@@@@ GUICtrlCreateGroup ("", 4, 110, 240, 87) GUICtrlCreateLabel ("Choose your AFK mode.", 10, 118) GUICtrlSetColor(-1, 0xFFFFFF) $afk1 = GUICtrlCreateRadio ("Autobuff with SmartHealing (800x600 only)", 10, 133, 230) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $afk1, "Opt_Check" ) $afk2 = GUICtrlCreateRadio ("Autobuff", 10, 153, 80) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $afk2, "Opt_Check" ) GUICtrlCreateGroup ("",-99,-99,1,1) ;@@@@@@@@@@@@@@@@@Pickup and vpc box@@@@@@@@@@@@@ $autoloot = GUICtrlCreateCheckbox ("Auto PickUp", 255, 115) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetOnEvent ( $autoloot, "GUI_CHECKED" ) GUICtrlCreateLabel ("Number of people in party:", 255, 150) GUICtrlSetColor( -1, 0xFFFFFF) $number = GUICtrlCreateCombo ("", 255,170) GUICtrlSetData(-1,"2|3|4|5") GUICtrlSetColor($number, 0xFFFFFF) ;@@@@@@@@@@@@@@@@@@@Buff time box@@@@@@@@@@@@@@@@@@ GUICtrlCreateLabel ("Input the gap time between Buff cycles (in ms):", 130, 4) GUICtrlSetColor(-1, 0xFFFFFF) $sleep1 = GUICtrlCreateInput ("", 140, 25, 200, 20) GUICtrlSetLimit(-1,5) $sleepdef = IniRead("config.ini", "Config", "Sleep", "0") GUICtrlSetData ( $sleep1, $sleepdef ) $button2 = GUICtrlCreateButton ("", 120, 50, 270, 50, $BS_ICON) GUICtrlSetImage (-1, "shell32.dll",146) GUICtrlSetOnEvent ( $button2, "Button" ) ;@@@@@@@@@@@@@@@@@@@@Buff types #1@@@@@@@@@@@@@@@@@@@@@ GUICtrlCreateGroup ("Party Member #1", 400, 1, 100, 80) $def1 = GUICtrlCreateCheckbox ("Defense Buff", 408, 15) GUICtrlSetColor(-1, 0xFFFFFF) $att1= GUICtrlCreateCheckbox ("Attack Buff", 408, 35) GUICtrlSetColor(-1, 0xFFFFFF) $heal1= GUICtrlCreateCheckbox ("Heal", 408, 55) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup ("",-99,-99,1,1) ;@@@@@@@@@@@@@@@@@@@@Buff types #2@@@@@@@@@@@@@@@@@@@@@ GUICtrlCreateGroup ("Party Member #2", 400, 85, 100, 80) $def2 = GUICtrlCreateCheckbox ("Defense Buff", 408, 99) GUICtrlSetColor(-1, 0xFFFFFF) $att2= GUICtrlCreateCheckbox ("Attack Buff", 408, 113) GUICtrlSetColor(-1, 0xFFFFFF) $heal2= GUICtrlCreateCheckbox ("Heal", 408, 127) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup ("",-99,-99,1,1) ;@@@@@@@@@@@@@@@@@@@@Buff types #3@@@@@@@@@@@@@@@@@@@@@ GUICtrlCreateGroup ("Party Member #3", 400, 150, 100, 80) $def3 = GUICtrlCreateCheckbox ("Defense Buff", 408, 164) GUICtrlSetColor(-1, 0xFFFFFF) $att3= GUICtrlCreateCheckbox ("Attack Buff", 408, 178) GUICtrlSetColor(-1, 0xFFFFFF) $heal3= GUICtrlCreateCheckbox ("Heal", 408, 192) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup ("",-99,-99,1,1) ;@@@@@@@@@@@@@@@@@@@@Buff types #4@@@@@@@@@@@@@@@@@@@@@ GUICtrlCreateGroup ("Party Member #3", 505, 1, 100, 80) $def4 = GUICtrlCreateCheckbox ("Defense Buff", 513, 15) GUICtrlSetColor(-1, 0xFFFFFF) $att4= GUICtrlCreateCheckbox ("Attack Buff", 513, 29) GUICtrlSetColor(-1, 0xFFFFFF) $heal4= GUICtrlCreateCheckbox ("Heal", 513, 43) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup ("",-99,-99,1,1) ;@@@@@@@@@@@@@@@@@@@@Buff types #5@@@@@@@@@@@@@@@@@@@@@ GUICtrlCreateGroup ("Party Member #3", 505, 85, 100, 80) $def5 = GUICtrlCreateCheckbox ("Defense Buff", 513, 99) GUICtrlSetColor(-1, 0xFFFFFF) $att5= GUICtrlCreateCheckbox ("Attack Buff", 513, 113) GUICtrlSetColor(-1, 0xFFFFFF) $heal5= GUICtrlCreateCheckbox ("Heal", 513, 127) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup ("",-99,-99,1,1) Func CLOSEClicked1() GUIDelete() EndFunc Func CLOSEClicked() $file = IniWrite("config.ini", "Config", "Sleep", GUICtrlRead($sleep1)) If GUICtrlRead($res1) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res1") ElseIf GUICtrlRead($res2) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res2") ElseIf GUICtrlRead($res3) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res3") ElseIf GUICtrlRead($res4) = $GUI_CHECKED Then IniWrite("config.ini", "Config", "Res", "$res4") EndIf If $file = -1 Then MsgBox(0, "Error", "Cannot open log file.") EndIf Exit EndFunc Func GUI_CHECKED() If GUICtrlRead ( $res2 ) = $GUI_CHECKED Then Global $buff1x = 775 Global $buff1y = 42 Global $buff2x = 775 Global $buff2y = 72 Global $buff3x = 775 Global $buff3y = 92 Global $buff4x = 775 Global $buff4y = 115 Global $buff5x = 775 Global $buff5y = 140 Global $buffx = 799 Global $buffy = 599 Global $afkx = 400 Global $afky = 300 ElseIf GUICtrlRead ( $res1 ) = $GUI_CHECKED Then Global $buff1x = 620 Global $buff1y = 32 Global $buff2x = 620 Global $buff2y = 62 Global $buff3x = 620 Global $buff3y = 82 Global $buff4x = 620 Global $buff4y = 105 Global $buff5x = 620 Global $buff5y = 130 Global $buffx = 620 Global $buffy = 450 Global $afkx = 320 Global $afky = 240 ElseIf GUICtrlRead ( $res3 ) = $GUI_CHECKED Then Global $buff1x = 999 Global $buff1y = 52 Global $buff2x = 999 Global $buff2y = 83 Global $buff3x = 999 Global $buff3y = 102 Global $buff4x = 999 Global $buff4y = 125 Global $buff5x = 999 Global $buff5y = 150 Global $buffx = 999 Global $buffy = 578 Global $afkx = 512 Global $afky = 384 ElseIf GUICtrlRead ( $res4 ) = $GUI_CHECKED Then Global $buff1x = 1260 Global $buff1y = 62 Global $buff2x = 1260 Global $buff2y = 93 Global $buff3x = 1260 Global $buff3y = 112 Global $buff4x = 1260 Global $buff4y = 135 Global $buff5x = 1260 Global $buff5y = 160 Global $buffx = 1260 Global $buffy = 1200 Global $afkx = 640 Global $afky = 512 EndIf EndFunc Func Opt_Check() If GUICtrlRead ( $afk1 ) = $GUI_CHECKED Then Global $afkmode = "Autobuff" ElseIf GUICtrlRead ( $afk2 ) = $GUI_CHECKED Then Global $afkmode = "Autobuff2" EndIf EndFunc Func Pick() Send("{SPACE}") EndFunc Func HK_STOP() while 1 = 1 Sleep(1000) wend EndFunc Func Button() WinMinimizeAll() HotKeySet("{F5}", "HK_STOP") HotKeySet("{F6}", $afkmode) TrayTip("", "To run script press F6. To stop it, press F5", 5, 1) EndFunc Func About() GUICreate ("About", 300, 170) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked1") GUICtrlCreateLabel ("MU AFK Complex is a script written in AutoIt language to help MATIRA guild people leave AFK. Current options:", 2, 2, 295, 40) GUICtrlCreateLabel ("- Multi Resolution", 40, 50, 240, 250) GUICtrlCreateLabel ("- Autobuff with SmartHealing", 40, 65, 240, 250) GUICtrlCreateLabel ("- Auto PickUp", 40, 80, 240, 250) GUICtrlCreateLabel ("Current version is: 0.59. If you encounter any problems e-mail me and I'll try to fix the problem: gokkkkuuuu@poczta.fm", 2, 118, 295, 250) GUISetState() EndFunc While 1 Sleep(1000) WEnd Func Autobuff() While(1) Call ("Auto") Call ("SmartHeal") MouseMove ( $buffx,$buffy ,1 ) Sleep($sleep1 / 2) Send("1") MouseMove ( 400,300 ,1 ) MouseClick("Right", 400,300) Sleep($sleep1 / 2) Wend Endfunc Func Autobuff2() While (1) Call ("Autobuff1") Call ("HealF") $x = mod(GUICtrlRead($sleep1), 2) MouseMove ( $buffx,$buffy ,1 ) Sleep($x) Send("1") MouseMove ( 400,300 ,1 ) MouseClick("Right", 400,300) Sleep($x) Wend EndFunc ;@@@@@@@@@@@@@@@@@@@@@@@@ Resources @@@@@@@@@@@@@@@@@ ;Autobuff with checking frame Func Auto() Opt("MouseClickDownDelay", 1) Opt("MouseCoordMode", 1) Opt("SendKeyDownDelay", 70) MsgBox ( 0, "loading", "loading", 1) Opt("SendKeyDelay", 1) Opt("SendKeyDownDelay", 1) ;@@@@@@@@@@@STARTS def buff @@@@@@@@@@@ Send("2") Sleep(50) If GUICtrlRead ( $def1 ) = 1 OR 0 Then MouseMove ( $buff1x,$buff1y ,1 ) MouseClick("Right",$buff1x,$buff1y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) Send("2") ;@@@@@@@@@@@@DEF 2ND PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def2 ) = 1 OR 0 Then MouseMove ( $buff2x,$buff2y ,1 ) MouseClick("Right",$buff2x,$buff2y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@DEF 3RD PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def3 ) = 1 OR 0 Then MouseMove ( $buff3x,$buff3y ,1 ) MouseClick("Right",$buff3x,$buff3y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@DEF 4TH PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def4 ) = 1 OR 0 Then MouseClick("Right",$buff4x,$buff4y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@DEF 5TH PLAYER@@@@@@@@@@@@ Send("2") If GUICtrlRead ( $def5 ) = 1 OR 0 Then MouseMove ( $buff5x,$buff5y ,1 ) MouseClick("Right",$buff5x,$buff5y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@ATT 1ST PLAYER@@@@@@@@@@@@@ If GUICtrlRead ( $att1 ) = 1 OR 0 Then Send("3") MouseMove ( $buff1x,$buff1y ,1 ) MouseMove ( $buff1x,$buff1y ,1 ) MouseClick("Right",$buff1x,$buff1y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@ATT 2ND PLAYER@@@@@@@@@@@@ Send("3") If GUICtrlRead ( $att2 ) = 1 OR 0 Then Send("3") MouseMove ( $buff2x,$buff2y ,1 ) MouseClick("Right",$buff2x,$buff2y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@ATT 3RD PLAYER@@@@@@@@@@@@ Send("3") If GUICtrlRead ( $att3 ) = 1 OR 0 Then Send("3") MouseMove ( $buff3x,$buff3y ,1 ) MouseClick("Right",$buff3x,$buff3y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@ATT 4TH PLAYER@@@@@@@@@@@@ Send("3") If GUICtrlRead ( $att4 ) = 1 OR 0 Then Send("3") MouseMove ( $buff4x,$buff4y ,1 ) MouseClick("Right",$buff4x,$buff4y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@ATT 5TH PLAYER@@@@@@@@@@@@ Send("3") If GUICtrlRead ( $att5 ) = 1 OR 0 Then MouseMove ( $buff5x,$buff5y ,1 ) MouseClick("Right",$buff5x,$buff5y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf Send("3") MouseMove ( $buffx,$buffy ,1 ) MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndFunc ;SmartHealing Func SmartHeal() $kolor1 = PixelGetColor( 785,48 ) $kolor2 = PixelGetColor( 785,72 ) $kolor3 = PixelGetColor( 785,96 ) $kolor4 = PixelGetColor( 785,118 ) $kolor5 = PixelGetColor( 785,121 ) If $kolor1 < 10000000 Then Send("1") Sleep(300) MouseMove ( 770,48 ,1 ) MouseClick("Right", 770,48) TrayTip("Healed", "Party member #1 - Healed", 5) TrayTip("Healed", "", 2) MsgBox ( 0, "loading", "loading", 1) MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ElseIf $kolor1 > 10000000 Then TrayTip("Healed", "Party member #1 - No need heal", 5) TrayTip("Healed", "", 2) Sleep(300) GUICtrlRead ( $loot ) EndIf If $kolor2 < 10000000 Then Send("1") Sleep(300) MouseMove ( 770,72 ,1 ) MouseClick("Right", 770,72) TrayTip("Healed", "Party member #2 - Healed", 2) TrayTip("Healed", "", 2) MsgBox ( 0, "loading", "loading", 1) MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ElseIf $kolor2 > 10000000 Then TrayTip("Healed", "Party member #2 - No need heal", 2) TrayTip("Healed", "", 2) Sleep(300) GUICtrlRead ( $loot ) EndIf If $kolor3 < 10000000 AND $number = 3 OR 4 OR 5 Then Send("1") Sleep(300) MouseMove ( 770,98 ,1 ) MouseClick("Right", 770,98) TrayTip("Healed", "Party member #3 - Healed", 2) TrayTip("Healed", "", 2) MsgBox ( 0, "loading", "loading", 1) MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ElseIf $kolor3 > 10000000 AND $number >= 3 Then TrayTip("Healed", "Party member #3 - No need heal", 2) TrayTip("Healed", "", 2) Sleep(300) GUICtrlRead ( $loot ) ElseIf $number = 2 Then Sleep (1) EndIf If $kolor4 < 10000000 AND $number = 4 OR $number = 5 Then Send("1") Sleep(300) MouseMove ( 770,120 ,1 ) MouseClick("Right", 770,120) TrayTip("Healed", "Party member #4 - Healed", 2) TrayTip("Healed", "", 2) MsgBox ( 0, "loading", "loading", 1) MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ElseIf $kolor4 > 10000000 AND $number = 4 Then TrayTip("Healed", "Party member #4 - No need heal", 2) TrayTip("Healed", "", 2) Sleep(300) GUICtrlRead ( $loot ) ElseIf $number < 4 Then GUICtrlRead ( $loot ) Else GUICtrlRead ( $loot ) EndIf If $kolor5 < 10000000 AND $number = 5 Then Send("1") Sleep(300) MouseMove ( 770,144 ,1 ) MouseClick("Right", 770,144) TrayTip("Healed", "Party member #5 - Healed", 2) MsgBox ( 0, "loading", "loading", 1) MouseMove ( $buffx,$buffy ,1 ) ElseIf $kolor5 > 10000000 AND $number = 5 Then TrayTip("clearing","",0) TrayTip("Healed", "Party member #5 - No need heal", 2) Sleep(300) GUICtrlRead ( $loot ) ElseIf $number < 5 Then GUICtrlRead ( $loot ) Else GUICtrlRead ( $loot ) EndIf EndFunc ;Healing with check frame Func HealF() ;@@@@@@@@@@@@@@@@@AUTO HEAL@@@@@@@@@@ MsgBox ( 0, "loading", "loading", 1) ;@@@@@@@@@@@HEAL 1ST PLAYER@@@@@@@@@@@@@ If GUICtrlRead ( $heal1 ) = 1 OR 0 Then Send("1") MouseMove ( $buff1x,$buff1y ,1 ) MouseClick("Right",$buff1x,$buff1y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf Send("1") MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@HEAL 2ND PLAYER@@@@@@@@@@@@ If GUICtrlRead ( $heal2 ) = 1 OR 0 Then Send("1") MouseMove ( $buff2x,$buff2y ,1 ) MouseClick("Right",$buff2x,$buff2y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf Send("1") MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@HEAL 3RD PLAYER@@@@@@@@@@@@ If GUICtrlRead ( $heal3 ) = 1 OR 0 Then Send("1") MouseMove ( $buff3x,$buff3y ,1 ) MouseClick("Right",$buff3x,$buff3y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf Send("1") MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@HEAL 4TH PLAYER@@@@@@@@@@@@ If GUICtrlRead ( $heal4 ) = 1 OR 0 Then Send("1") MouseMove ( $buff4x,$buff4y ,1 ) MouseClick("Right",$buff4x,$buff4y) MsgBox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf Send("1") MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) ;@@@@@@@@@@@@HEAL 5TH PLAYER@@@@@@@@@@@@ If GUICtrlRead ( $heal5 ) = 1 OR 0 Then Send("1") MouseMove ( $buff5x,$buff5y ,1 ) MouseClick("Right",$buff5x,$buff5y) Msgbox ( 0, "loading", "loading", 1) GUICtrlRead ( $loot ) Else MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndIf Send("1") MouseMove ( $buffx,$buffy ,1 ) GUICtrlRead ( $loot ) EndFunc