; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; before starting, Ctrl+F for every instance of Send/ControlSend; update the hotkeys to the hotkeys you have set; Set your zoom, then never adjust it, or else the macro will click the wrong coordinates.; ==========================================================================================; -=KEYS YOU MUST SET UP=-;; win+p ===> POPULATE vars with saved values; win+s ===> SAVE vars to an ini file, that way next run only needs to do win+p;;; ctrl+1 TOP LEFT NARROW ; ctrl+2 BOTTOM RIGHT NARROW ; ctrl+3 TOP LEFT WIDE ; ctrl+4 BOTTOM RIGHT WIDE; ctrl+7 BLACK FLY WING IN A HOTKEY BAR, See http://i.imgur.com/HoOge.jpg or http://puu.sh/bbVpg/b1f83532fa.jpg for visual instructions; Storage update (only if you need to use storage!!) - Open your inventory and select a point on the upper left of the window. the script drags items out of your inventory to the right and up *LEAVE YOUR INVENTORY OPEN!!*; ctrl+8 UPPER LEFT; win+h healer ; win+w warper ; win+t tool dealer ; win+b buy button to open tool dealer; win+d down arrow in the dealer; ctrl+m set target map id to where you're at; -=EXECUTE=-; Set your last warp to the desired destination, start off in town and press Home. Press End to pause the script.PACKETVER :=20151104#SingleInstance Force#MaxThreadsPerHotkey1#NoEnv#Warn #UseHook#InstallKeybdHook#InstallMouseHookSetWorkingDir%A_ScriptDir%SetKeyDelay-1,-1,-1SetBatchLines-1#Include ragaddr.ahk#Include classMemory.ahk; for iaras;targetMap :=1600221794;targetMap :=1600942195; TIME SPENT (IN MS) WAITING FOR MAPS TO LOADmapChangeDelay :=1500; TIME BETWEEN SENDING STUFF TO NPCnpcDelay :=650; YOUR ASPD DELAYaspdDelay :=0; RETURN TO TOWN TIMER (AGI/BLESS)returnTime :=235000; !!!LAST WARP ENTER AMOUNT (CHANGES DEPENDING ON SERVER)!!!lastWarpEnterCount :=1; DON'T CHANGEpurchaseWings :=0; HEAL AFTER BUFFING?rehealAfterBuffs :=0; this is set for AC on F9, TS on F2, and awakes on F6buffs := Array("{F5}","{F2}","{F6}")buffTimers := Array(4*60*1000,30*1000,30*60*1000)buffAlwaysInTown := Array(1,1,1)Tick_buffTimers := Object()for idxvalue, keyvalue in buffTimers{ Tick_buffTimers.Insert(0)}searchColors := Object()searchColors.Insert(0x00FF00) ;GREEN; ENEMY COLOR SEARCH ; jokers = 0x8894F9, porings = 0x8C94FF, (ADD NEW COLOR REMINDERS HERE)Tick_LastFood :=A_TickCount- foodTime*2g_addrMapNameRsw := 0xE48608 ;0x00814268 ; 0x00D1805C October 20, 2014 client addresses g_addrWeightMax := 0x00E492BC ; 0x0083C54C ; 0x00D18DA8 g_addrWeightMax := 0x00E492BC ;0x0083C54C ; 0x00D18DA8 g_addrWeight := 0x00E492C8 ;0x0083C558 ; 0x00D18DB4g_addrCHP := 0xE4CAF4 ;0x0083E1B4 ; 0x00D1CA6C;g_addrMHP := ;0x0083E1B8 ; 0x00D1CA70 ;g_addrCSP := ;0x0083E1BC ; 0x00D1CA74;g_addrMSP := ;0x0083E1C0 ;g_addrMHP := g_addrCHP+4g_addrCSP := g_addrMHP+4g_addrMSP := g_addrCSP+4;skillinitial :=10; ==========================================================================================; YOU DON'T NEED TO CHANGE ANYTHING HERE^1::{MouseGetPos tl_n_xpos, tl_n_yposreturn}^2::{MouseGetPos br_n_xpos, br_n_yposreturn}^3::{MouseGetPos tl_w_xpos, tl_w_yposreturn}^4::{MouseGetPos br_w_xpos, br_w_yposreturn}^7:: ; FLY WINGS{MouseGetPos fwing_xpos, fwing_ypos purchaseWings :=0return}^8:: ; INVENTORY (UPPER LEFT){MouseGetPos tl_inventory_xpos, tl_inventory_ypos br_inventory_xpos := tl_inventory_xpos +120 br_inventory_ypos := tl_inventory_ypos +40return}^M::{WinGet mPID, PID, A targetMap := ReadMemory(g_addrMapNameRsw, mPID)}#H:: ; HEALER{MouseGetPos hxpos, hyposreturn}#W:: ; WARPER{MouseGetPos wxpos, wyposreturn}#T:: ; TOOL DEALER{MouseGetPos txpos, typosreturn}#B:: ; TOOL DEALER BUY WINDOW{MouseGetPos bxpos, byposreturn}#D:: ; DOWN ARROW{MouseGetPos dxpos, dyposreturn}#Q:: ; Tool dealers BUY confirm button{MouseGetPos qxpos, qyposreturn}#S::{ SaveVariables()return}#P::{ LoadVariables()return}; ==========================================================================================Home::{SetKeyDelay-1,-1,-1WinGet mPID, PID, A maxWeight := ReadMemory(g_addrWeightMax, mPID); ==========================================================================================; ACTION; ==========================================================================================loop{Sleep%mapChangeDelay% wingAttempts :=0 skillAttempts :=0 UseHealer() ;Selfbuff() ;EquipGear()if( rehealAfterBuffs =1){ UseHealer()} UseWarper(lastWarpEnterCount)Sleep%mapChangeDelay%Loop{Sleep50if((A_TickCount- Tick_LastBuff)>= returnTime ){ ReturnToTown()Break} result := ReadMemory(g_addrMapNameRsw, mPID)if( result != targetMap ){ ReturnToTown()Break}; if ( CheckFlyWings() = 0); {; ReturnToTown(); BuyFlyWings(100); Break; }if( CheckHPSP()=0){ ReturnToTown()Break}if( CheckWeight()>=84){ ReturnToTown() UseStorage()Break} for idxvalue, keyvalue in Tick_buffTimers{if((A_TickCount- keyvalue)>= buffTimers[idxvalue]){ControlSend,,% buffs[idxvalue], ahk_pid %mPID% Tick_buffTimers[idxvalue]:=A_TickCountSleep getASPDDelay()+200 ;300}}if( skillAttempts >=18){ControlSend,,{F1}, ahk_pid %mPID%Sleep380 ;500 wingAttempts := wingAttempts +1 skillAttempts :=0}if( wingAttempts >=300){ ReturnToTown()Break}else{ for idxvalue, colorvalue in searchColors{ ;ErrorLevel:=5PixelSearch FoundX, FoundY,%tl_n_xpos%,%tl_n_ypos%,%br_n_xpos%,%br_n_ypos%,%colorvalue%,0, Fast if(ErrorLevel=0){ Cast(FoundX, FoundY)}else{PixelSearch FoundX, FoundY,%tl_w_xpos%,%tl_w_ypos%,%br_w_xpos%,%br_w_ypos%,%colorvalue%,0, Fast if(ErrorLevel=0){ Cast(FoundX, FoundY)}else{ControlSend,,{F1}, ahk_pid %mPID%; teleport hotkeySleep580 ;700 skillAttempts :=0 wingAttempts := wingAttempts +1}}}}}}return; ==========================================================================================UseFood(){ global; FOOD HOTKEYControlSend,,{F6}, ahk_pid %mPID%Sleep100 Tick_LastFood :=A_TickCountreturn}; ==========================================================================================EquipGear(){ globalSleep200ControlSend,,{F5}, ahk_pid %mPID%Sleep200return}; ==========================================================================================UseStorage(){ globalSetMouseDelay20ControlSend,,{F11}, ahk_pid %mPID%Sleep%npcDelay% itemColors := Object() ;itemColors.Insert(0x949CF7) ;witherless rose ;itemColors.Insert(0xEEC5CE) ;crystal shitmirror ;itemColors.Insert(0xBD8C9C) ;crystal shitmirror (AGAIN) itemColors.Insert(0x0000FF) ;fuckin everything itemColors.Insert(0x0000FF) ;fuckin everything ;itemColors.Insert(0x00FFFF) ;YELLOW ;itemColors.Insert(0x00FF00) ;GREEN ;itemColors.Insert(0xFFFF00) ;CYAN ;itemColors.Insert(0x00FFA5) ;ORANGE ; doubled up on leaf colors ;itemColors.Insert(0x94d6c5) ;itemColors.Insert(0x94d6c5) for idxvalue, colorvalue in itemColors{PixelSearch FoundX, FoundY,%tl_inventory_xpos%,%tl_inventory_ypos%,%br_inventory_xpos%,%br_inventory_ypos%, colorvalue,0, Fastif(ErrorLevel=0){Sleep500MouseMove%FoundX%,%FoundY%Sleep1000 ;MouseClickDrag L,0,0,300,50,10, RMouseClickDrag L,0,0,0,-80,10, RSleep1000ControlSend,,{Enter}, ahk_pid %mPID%Sleep1000}}SetMouseDelay-1 ReturnToTown()return}; ==========================================================================================CheckWeight(){ global currentWeight := ReadMemory(g_addrWeight, mPID)returnround(currentWeight *100/ maxWeight)}; ==========================================================================================ReadMemory(MADDRESS, PROGRAM){ cm_exe := new _ClassMemory(PROGRAM,"", proccopy)if(ErrorLevel)MsgBox % "ClassMemory errorlevel: ".ErrorLevelif(A_LastError)MsgBox % "ClassMemory LastError: ".A_LastErrorif !isObject(cm_exe){MsgBox % "Failed to open a handle"if(proccopy =0)MsgBox % "The program isn't running (not found) or you passed an incorrect program identifier parameter. In some cases _ClassMemory.setSeDebugPrivilege() may be required. "elseif(proccopy ="")MsgBox % "OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. _ClassMemory.setSeDebugPrivilege() may also be required. Consult A_LastError for more information."ExitApp}return cm_exe.read(MADDRESS)}; ==========================================================================================CheckHPSP(){ global current := ReadMemory(g_addrCHP, mPID) maximum := ReadMemory(g_addrMHP, mPID)If(Floor( current *100/ maximum )<=25){return0} ;read sp, pot if needed current := ReadMemory(g_addrCSP, mPID) maximum := ReadMemory(g_addrMSP, mPID)If(Floor( current *100/ maximum )<=25){return0}return1}; ==========================================================================================BuyFlyWings(amount){ globalSetMouseDelay20 ;MorningROMouseMove%txpos%,%typos%,10; Tool DealerSleep500Click%txpos%,%typos%Sleep%npcDelay%Loop3{Send{Enter}Sleep%npcDelay%}MouseMove%dxpos%,%dypos%,1; to click arrow downSleep400MouseClickDrag L,0,0,75,60,30, R ; Fl ywing Drag & Drop Choose amount and choose it. Make sure the y between both is CONSTANT r you will buy other shitSleep1000SendInput%amount%Sleep500Send{Enter}MouseMove%qxpos%,%qypos%,1Sleep%npcDelay%Click%qxpos%,%qypos%Sleep500SetMouseDelay-1if(CheckWeight()>=85){ UseStorage()}return}; ==========================================================================================CheckFlyWings(){ globalPixelGetColorcolor,%fwing_xpos%,%fwing_ypos%,10; position of flywings in your hotkey bar if(color= 0xFFFFFF){return0}return1}; ==========================================================================================ReturnToTown(){ globalSleep getASPDDelay()ControlSend,,{Insert},ahk_pid %mPID% ;@go town hotkey--> set it to a single key (eg `), because alt sends are completely unreliableSleep%mapChangeDelay%}; ==========================================================================================UseWarper(lastWarpEnterCount) ;lwEnterCount{ globalSleep%npcDelay%MouseMove%wxpos%,%wypos%Sleep300Click%wxpos%,%wypos%Sleep%npcDelay%Loop%lastWarpEnterCount% ;lwEnterCount{Sleep%npcDelay%ControlSend,,{Enter},ahk_pid %mPID%}}; ==========================================================================================UseHealer(){ global Sleep%npcDelay%MouseMove%hxpos%,%hypos%Sleep300Click%hxpos%,%hypos%Sleep%npcDelay% Tick_LastBuff :=A_TickCount}; ==========================================================================================; ==========================================================================================Selfbuff(){ globalWinGetActiveStats windowName, windowWidth, windowHeight, winX, winY winCenterX := windowWidth >>1 winCenterY := windowHeight >>1Sleep250 for idxvalue, keyvalue in buffAlwaysInTown{if( keyvalue ==0)continueControlSend,,% buffs[idxvalue], ahk_pid %mPID%Sleep GetASPDDelay()+300 Tick_buffTimers[idxvalue]:=A_TickCount}} ;=================================================================; ==========================================================================================Cast(x, y){ global Loop3{ControlSend,,{F3},ahk_pid %mPID%; skill hotkeySleep10Click%x%,%y%Sleep10} skillAttempts := skillAttempts +1return}; ==========================================================================================LoadVariables(){ globalIniRead tl_n_xpos, autofarm.ini, search_position, tl_n_x,0IniRead tl_n_ypos, autofarm.ini, search_position, tl_n_y,0IniRead br_n_xpos, autofarm.ini, search_position, br_n_x,0IniRead br_n_ypos, autofarm.ini, search_position, br_n_y,0IniRead tl_w_xpos, autofarm.ini, search_position, tl_w_x,0IniRead tl_w_ypos, autofarm.ini, search_position, tl_w_y,0IniRead br_w_xpos, autofarm.ini, search_position, br_w_x,0IniRead br_w_ypos, autofarm.ini, search_position, br_w_y,0IniRead fwing_xpos, autofarm.ini, wnd_position, fwing_x,0IniRead fwing_ypos, autofarm.ini, wnd_position, fwing_y,0IniRead tl_inventory_xpos, autofarm.ini, wnd_position, tl_inv_x,0IniRead tl_inventory_ypos, autofarm.ini, wnd_position, tl_inv_y,0IniRead br_inventory_xpos, autofarm.ini, wnd_position, br_inv_x,0IniRead br_inventory_ypos, autofarm.ini, wnd_position, br_inv_y,0IniRead hxpos, autofarm.ini, npc_position, healer_x,0IniRead hypos, autofarm.ini, npc_position, healer_y,0IniRead txpos, autofarm.ini, npc_position, dealer_x,0IniRead typos, autofarm.ini, npc_position, dealer_y,0IniRead wxpos, autofarm.ini, npc_position, warper_x,0IniRead wypos, autofarm.ini, npc_position, warper_y,0IniRead bxpos, autofarm.ini, npc_position, buy_x,0IniRead bypos, autofarm.ini, npc_position, buy_y,0IniRead dxpos, autofarm.ini, npc_position, down_x,0IniRead dypos, autofarm.ini, npc_position, down_y,0IniRead qxpos, autofarm.ini, npc_position, button_x,0IniRead qypos, autofarm.ini, npc_position, button_y,0; ENEMY COLOR SEARCH ; jokers = 0x8894F9, porings = 0x8C94FF, (ADD NEW COLOR REMINDERS HERE) ;IniRead searchColor, autofarm.ini, search_setting, enemy_color, 0x8C94FF ;IniRead searchTolerance, autofarm.ini, search_setting, color_tolerance,0IniRead targetMap, autofarm.ini, search_setting, target_map}; ==========================================================================================SaveVariables(){ global; SEARCH WINDOWIniWrite%tl_n_xpos%, autofarm.ini, search_position, tl_n_xIniWrite%tl_n_ypos%, autofarm.ini, search_position, tl_n_yIniWrite%br_n_xpos%, autofarm.ini, search_position, br_n_xIniWrite%br_n_ypos%, autofarm.ini, search_position, br_n_yIniWrite%tl_w_xpos%, autofarm.ini, search_position, tl_w_xIniWrite%tl_w_ypos%, autofarm.ini, search_position, tl_w_yIniWrite%br_w_xpos%, autofarm.ini, search_position, br_w_xIniWrite%br_w_ypos%, autofarm.ini, search_position, br_w_y; FLY WINGSIniWrite%fwing_xpos%, autofarm.ini, wnd_position, fwing_xIniWrite%fwing_ypos%, autofarm.ini, wnd_position, fwing_y; STORAGEIniWrite%tl_inventory_xpos%, autofarm.ini, wnd_position, tl_inv_xIniWrite%tl_inventory_ypos%, autofarm.ini, wnd_position, tl_inv_yIniWrite%br_inventory_xpos%, autofarm.ini, wnd_position, br_inv_xIniWrite%br_inventory_ypos%, autofarm.ini, wnd_position, br_inv_y ;HEALERIniWrite%hxpos%, autofarm.ini, npc_position, healer_xIniWrite%hypos%, autofarm.ini, npc_position, healer_y ;TOOL DEALERIniWrite%txpos%, autofarm.ini, npc_position, dealer_xIniWrite%typos%, autofarm.ini, npc_position, dealer_y; WARPERIniWrite%wxpos%, autofarm.ini, npc_position, warper_xIniWrite%wypos%, autofarm.ini, npc_position, warper_y; BUY BUTTON / to open the shopIniWrite%bxpos%, autofarm.ini, npc_position, buy_xIniWrite%bypos%, autofarm.ini, npc_position, buy_y; Buy buttin to buy the itemIniWrite%qxpos%, autofarm.ini, npc_position, button_xIniWrite%qypos%, autofarm.ini, npc_position, button_y; DOWN ARROWIniWrite%dxpos%, autofarm.ini, npc_position, down_xIniWrite%dypos%, autofarm.ini, npc_position, down_yIniWrite%targetMap%, autofarm.ini, search_setting, target_map ;IniWrite%searchColor%, autofarm.ini, search_setting, enemy_color ;IniWrite%searchTolerance%, autofarm.ini, search_setting, color_tolerancereturn}; ==========================================================================================getASPDDelay(){ Global tick, aspdDelay, g_addrDelayASPD, mPID ;Return500If((A_TickCount- tick)>=2000) ;update interval of 2 sec{ tick :=A_TickCount aspdDelay :=2* ReadMemory(g_addrDelayASPD, mPID)+10}Return aspdDelay}; ==========================================================================================}End::Pause