**************PLEASE DO NOT USE THIS IN A QUEST AREA OR ANY AREA THAT GETS A LOT OF TRAFFIC*******
to repair i made 2 files, yourmacropath.xml and yourrepairpath.xml
my macro path runs around a circle counting each mob, when it gets to 300 if runs the code below the counter, which i have set as calling the window to the foreground and keyboard presses of my recall button, it waits 20secs while the screen loads from recalling and then loads yourrepairpath.xml
yourmacropath.xml:
<waypoints>
<!-- # 1 --><waypoint x="" z="">
if( player.Fights-player.free_counter1 > 300 ) then <!--recall at 300 monsters-->
player.free_counter1 = player.Fights; <!--this code counts each mob-->
showWindow(getWin(), sw.show); <!--calls the window to foreground need for mouseclicks-->
player:rest(2);
keyboardPress(key.VK_7); <!--my recall button is in the position on spellbar #7-->
player:rest(20); <!--we wait while the screen loads from recalling-->
load_paths("yourrepairpath.xml"); <!--loads a repair path-->
end
</waypoint>
<!-- # 2 --><waypoint x="" z=""></waypoint> <!--macro path-->
<!-- # 3 --><waypoint x="" z=""></waypoint>
<!-- # 4 --><waypoint x="" z=""></waypoint>
<!-- # 5 --><waypoint x="" z=""></waypoint>
<!-- # 6 --><waypoint x="" z=""></waypoint>
<!-- # 7 --><waypoint x="" z=""></waypoint>
<!-- # 8 --><waypoint x="" z=""></waypoint>
<!-- # 9 --><waypoint x="" z=""></waypoint> <!--macro path-->
</waypoints>
obviously the recall has an 1 hr timer, so youll need to adjust how many mobs you kill before it tries to recall, or you can try this code to recall after a certain amount of time
replace:
Code: Select all
if( player.Fights-player.free_counter1 > 300 ) then <!--recall at 300 monsters-->
player.free_counter1 = player.Fights; <!--this code counts each mob-->
with:
Code: Select all
if( os.difftime(os.time(), player.BotStartTime) > 3660 ) then <!-- runs code after 1 hr 1min of macroing-->
if you do it by time, youll also need to add a timer reset in the code, i suggest right after teleporting, so it would liike like this:
Code: Select all
<!-- # 1 --><waypoint x="" z="">
if( os.difftime(os.time(), player.BotStartTime) > 3660 ) then <!-- runs code after 1 hr 1min of macroing-->
showWindow(getWin(), sw.show); <!--calls the window to foreground need for mouseclicks-->
player:rest(2);
keyboardPress(key.VK_7); <!--my recall button is in the position on spellbar #7-->
player.BotStartTime = 0; <!--RESTARTS TIMER-->
player:rest(20);
if your nearest town doesnt have a teleporter you can run there instead of teleport
remove this from code:
Code: Select all
showWindow(getWin(), sw.show); <!--calls the window to foreground need for mouseclicks-->
player:rest(2);
keyboardPress(key.VK_7); <!--my recall button is in the position on spellbar #7-->
player:rest(20); <!--we wait while the screen loads from recalling-->
------------------------------------------------------------------------------------------------------------------------------
yourrepairpath.xml runs from teleporter to merchant, if you arent using a teleporter option, youll need to make waypoints from your macropath to the npc, instead of teleporter to npc
at the merchant i call the window to the foreground, needed for mouseclicks, you can download other addons that auto repair, but this works just aswell, youll need to adjust your mouseclicks to aim them at the right icons/chat options on screen, after it presses repair icon,
i have it set to buy potions too, this is tricky for now, we have it set to press a keyboard button (VK_6), which has an ingame macro, so youll need to go ingame and make a macro with this:
and place it in the correct keyslot, mines 6
this ingame macro will buy 99 items of whatever item is in position 3 on the merchant window, change these according to merchant, and how many items you want. if you need more pots than 99, just copy the keyboardpress code
Code: Select all
player:rest(.4);
keyboardPress(key.VK_6);
and duplicate it
after that mine runs back toward yourmacropath and then loads that macro
yourrepairpath.xml:
Code: Select all
<waypoints>
<!-- # 1 --><waypoint x="" z="" type="RUN"></waypoint> <!-- run from teleporter to merchant -->
<!-- # 2 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- # 3 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- # 4 --><waypoint x="" z="" type="RUN"> <!-- make this waypoint aim at merchant -->
showWindow(getWin(), sw.show); <!-- calls window to foreground, needed for mouseclicks -->
player:rest(2)
player:target_NPC("YOUrNPCName"); <!-- this will open the chat dialog for merchant -->
player:rest(1)
player:mouseclickL(150, 220, 825, 582); <!-- opens the shop window, youll have to run this and see where you clicks need to go -->
player:rest(.4); <!-- ^^ the 150 is left and right, left is low right is higher, the 220 is up and down lower towards the top of screen-->
player:mouseclickL(250, 380, 825, 582); <!-- presses repair again you will need to adjust this, let the macro run once and see where it clicks-->
player:rest(.4);
keyboardPress(key.VK_6); <!-- this presses your spellbar button #6, in your slot 6 you need your buy macro-->
</waypoint>
<!-- # 5 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- # 6 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- # 7 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- # 8 --><waypoint x="" z="" type="RUN"></waypoint> <!-- i have mine set to run through mobs i dont want to kill -->
<!-- # 9 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- #10 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- #11 --><waypoint x="" z="" type="RUN"></waypoint>
<!-- #12 --><waypoint x="" z="" ></waypoint> <!-- we get to my mobs here i do want to kill so i turn run off -->
<!-- #13 --><waypoint x="" z="" ></waypoint> <!-- but we arent at my macro spot so we keep going -->
<!-- #13 --><waypoint x="" z="" ></waypoint>
<!-- #13 --><waypoint x="" z="" ></waypoint>
<!-- #13 --><waypoint x="" z="" ></waypoint>
<!-- #30 --><waypoint x="-35400" z="-17851"> <!-- we're close enough here to my macro spot, so ill reload the macro script -->
load_paths( "yourmacropath.xml"); <!-- macro path -->
</waypoint>
</waypoints>