DoD first boss script problems

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
runegolemsentry
Posts: 10
Joined: Mon Sep 03, 2012 1:07 pm

DoD first boss script problems

#1 Post by runegolemsentry »

Hello, this is my first post but i've been following this site for a while :D
So, i've a problem with a DoD first boss farm script, which i made myself mixing different codes i've found around there.
I'd like to have some answers about how to make my bot do the following things, which at the moment i can't make work:
-use 15 minutes buffs like food, poison etc only every 15 minutes, when the old one is finished.
-kill the trash without looting them, go down the stairs, use available buffs (it will be ok to use them just when they're ready, to spead up some runs) and decide the combo to use on the boss after have pulled him with combo throw (without moving to the center of the room).
-loot only the mementos from the boss.
-check the items durability and repair only when items are at 80% dura.
-also i don't know to make it use slash too, since i'm r/w.

I have a waypoint made by myself, right now my bot leaves team/invites the character and sets the difficulty on normal; then it goes to the boss, kills him and restart the route.

Here is my waypoint (i know it has much wrong things, but i'm new in this :) )

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>

 
      
      settings.profile.options.AUTO_ELITE_FACTOR = 9999;
      settings.profile.options.MAX_FIGHT_TIME = 15;
      settings.profile.options.MAX_TARGET_DIST = 300
      settings.options.MELEE_DISTANCE = 55;


   function LootTargetSolo()
      timeout = os.time();
      while true do
         player:update();
         target = player:getTarget();
         if target == nil then
            break;
         end
         target:update();
         Attack();
         yrest(100);
         if target.Lootable == false or os.difftime(os.time(), timeout) > 1 then
            break;
         end
      end
   end;

</onLoad>
  
	<!-- #  1 --><waypoint x="1667" z="-4861" y="777">	</waypoint>
	<!-- #  2 --><waypoint x="1664" z="-5026" y="785"> 
        sendMacro("LeaveParty();"); 
        yrest(1000);
        sendMacro('InviteByName("[color=#FF0040]my character name[/color]")'); 
        yrest(1000); 
        sendMacro('SetInstanceLevel("normal")');
	                                                        </waypoint>
	<!-- #  3 --><waypoint x="1662" z="-5102" y="784">	</waypoint>
	<!-- #  4 --><waypoint x="1688" z="-5154" y="782">	</waypoint>
         
          keyboardHold(settings.hotkeys.MOVE_FORWARD.key)
          yrest(1000);
          keyboardRelease(settings.hotkeys.MOVE_FORWARD.key)
          waitForLoadingScreen(10)

	<!-- #  5 --><waypoint x="1793" z="2880" y="433">	</waypoint>

          keyboardHold(settings.hotkeys.MOVE_FORWARD.key)
          yrest(1000);
          keyboardRelease(settings.hotkeys.MOVE_FORWARD.key)
          waitForLoadingScreen(10)

	<!-- #  6 --><waypoint x="1834" z="2877" y="433">	</waypoint>
	<!-- #  7 --><waypoint x="1906" z="2835" y="433">	</waypoint>
	<!-- #  8 --><waypoint x="2023" z="2722" y="433">	</waypoint>

        local target = player:getTarget()
        changeProfileOption("MAX_TARGET_DIST", 300);
              changeProfileOption("LOOT", true);
              player:target_Unit(Okander "Mad Man" Mallen);
                 local _tb = false
                 local spawnboss = player:findNearestNameOrId("Okander \"Mad Man\" Mallen")
                 if spawnboss then
                    Boss_buff()
                    player:target(spawnboss)
                    Boss_buff()
                 if target.HP > 0 then
                    player:update();
                    player:cast("ROGUE_COMBO_THROW");
                    yrest(500);
                    player:cast("ROGUE_SHADOWSTAB");
                    yrest(500);
                 if( arg1.Name == "MAGE_FLAME" ) then
                    player:cast("ROGUE_LOW_BLOW");
                    end
                    player:cast("ROGUE_WOUND_ATTACK");
                    yrest(500);
                    player:cast("ROGUE_COMBO_THROW");
                    yrest(500);
                    keyboardPress( key.VK_1 );
                      _tb = false
                    else
                        _tb = true
                    end
                    else
                      _tb = true
                    end
                      return _tb
                    end
              end
              player:target_Unit(Okander "Mad Man" Mallen);
              LootTargetSolo();
           end           
           changeProfileOption("LOOT", false);

	<!-- #  9 --><waypoint x="2204" z="2513" y="401">	</waypoint>
	<!-- # 10 --><waypoint x="2155" z="2565" y="419">	</waypoint>
	<!-- # 11 --><waypoint x="1887" z="2882" y="433">	</waypoint>
	<!-- # 12 --><waypoint x="1699" z="2892" y="433">	</waypoint>
	<!-- # 13 --><waypoint x="1645" z="-4908" y="752">	</waypoint>
</waypoints>
and here is my profile

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<profile>
	<options>
		<!-- Try the bot with a new char mage                   -->
		<!-- At the pioneer village. Use demo.xml waypoint file -->
		<option name="HP_LOW"			value="70" />
		<option name="MP_LOW_POTION"		value="50" />
		<option name="HP_LOW_POTION"		value="70" />
		<option name="USE_HP_POTION"		value="best" />			<!-- potion select strategy: best|minstack -->
		<option name="USE_MANA_POTION"		value="best" />			<!-- potion select strategy: best|minstack -->
		<option name="USE_PHIRIUS_POTION"	value="false" /> 		<!-- false | true if you want to use the Phirus Potions -->
		<option name="PHIRIUS_MP_LOW"		value="40" />
		<option name="PHIRIUS_HP_LOW"		value="40" />

		<!-- Rest if HP or Mana is below that level -->
		<option name="HP_REST" 				value="40" />
		<option name="MP_REST" 				value="15" />

		<!-- Shopping options, how many of what do you want to keep in your inventory -->
		<option name="HEALING_POTION" 		value="10" />
		<option name="MANA_POTION" 			value="0" />			<!-- set to "0" if not required to buy -->
		<option name="ARROW_QUIVER" 		value="0" /> 			<!-- set to "0" if not required to buy -->
		<option name="THROWN_BAG" 			value="0" />			<!-- set to "0" if not required to buy -->
		<option name="POISON" 				value="20" />			<!-- set to "0" if not required to buy -->

		<!-- either false or arrow or thrown -->
		<option name="RELOAD_AMMUNITION" 	value="false" />		<!-- false|arrow|thrown -->

		<!-- Combat options -->
		<option name="COMBAT_TYPE"        	value="melee" />				<!-- leave empty or choose ranged/melee if not using class default -->
		<option name="COMBAT_RANGED_PULL" 	value="true" /> 		<!-- only important for melees -->
		<option name="COMBAT_DISTANCE"    	value="50" />			<!-- Distance at which it starts using skills -->
		<option name="COMBAT_STOP_DISTANCE" value="200" />			<!-- Distance at which it stops moving towards the target -->
		<option name="MAX_FIGHT_TIME"     	value="15" />			<!-- Max time without damage before break -->
		<option name="DOT_PERCENT"        	value="90" />
		<option name="ANTI_KS"            	value="true" />
		<option name="MAX_TARGET_DIST"    	value="300" />
		<option name="PRIORITY_CASTING"		value="true" />		<!-- If you want to cast attack skills by 'priority' or 'sequencially' -->
		<option name="COUNT_AGGRO_ONLY"		value="false" />		<!-- If you want to count only aggro mobs within range of aoe skills  -->
                <option name="AUTO_ELITE_FACTOR"        value="1000" />

		<!-- Attack monsters 3 levels above or 10 below your level -->
		<option name="TARGET_LEVELDIF_ABOVE" value="3" />
		<option name="TARGET_LEVELDIF_BELOW" value="20" />

		<!-- Waypoint and movement settings -->
		<option name="WAYPOINTS"			value="" />  			<!-- leave empty to show a list -->
		<option name="RETURNPATH"			value="" />
		<option name="PATH_TYPE"			value="waypoints" />	<!-- waypoints | wander -->
		<option name="WANDER_RADIUS"		value="500" />
		<option name="WAYPOINT_DEVIATION"	value="0" />
		<option name="QUICK_TURN" 			value="true" />

		<!-- Loot settings -->
		<option name="LOOT"               	value="false" />
		<option name="LOOT_ALL"			  	value="false" />  		<!-- Loot all nearby dead mobs after combat -->
		<option name="LOOT_IN_COMBAT"     	value="false" />
		<option name="LOOT_DISTANCE"      	value="100" />
		<option name="LOOT_PAUSE_AFTER"   	value="0" />			<!-- probability in % for a short rest -->
		<option name="LOOT_SIGILS"			value="" />				<!-- Loot sigils or not. If ommitted, will depend on "LOOT" value -->
		<option name="SIGILS_IGNORE_LIST"	value="" />				<!-- List of any sigils you wish to ignore, in language of client -->

		<!-- Auto selling options when used with player:merchant -->
		<option name="INV_AUTOSELL_ENABLE"	value="false" />		<!-- true | false -->
		<option name="INV_AUTOSELL_FROMSLOT" value="1" /> 			<!-- 1 = bag 1 slot 1 -->
		<option name="INV_AUTOSELL_TOSLOT"	value="60" /> 			<!-- 30 = last slot bag 1 -->
		<option name="INV_AUTOSELL_QUALITY"	value="white,green" /> 	<!-- white,green,blue,purple  -->

		<!-- Harvest options -->
		<option name="HARVEST_DISTANCE"		value="120" />
		<option name="HARVEST_WOOD"			value="true" /> 		<!-- Choose which types to harvest. -->
		<option name="HARVEST_HERB"			value="true" /> 		<!-- "true" = harvest, "false" = do not harvest -->
		<option name="HARVEST_ORE"			value="true" />

		<!-- Eggpet options -->
		<option name="EGGPET_ENABLE_CRAFT"	value="false" />		<!-- If using same slot for assist and craft, onlt 1 can be enabled. -->
		<option name="EGGPET_CRAFT_SLOT"	value="1" />
		<option name="EGGPET_ENABLE_ASSIST"	value="false" />
		<option name="EGGPET_ASSIST_SLOT"	value="1" />
		<option name="EGGPET_CRAFT_RATIO"	value="1:1:1" /> 		<!-- mining:woodworking:herbalism ratio to produce. -->
		<option name="EGGPET_CRAFT_INDEXES"	value="" /> 	 		<!-- override auto craft index for mining,woodworking,herbalism eg. "2,,"-->


		<!-- Log out and resurrect settings -->
		<option name="LOGOUT_TIME" 			value="0" />			<!-- in minutes, 0 = timer disabled -->
		<option name="LOGOUT_SHUTDOWN"		value="false" />
		<option name="LOGOUT_WHEN_STUCK"	value="false" />
		<option name="CLOSE_WHEN_STUCK"		value="false" />
		<option name="RES_AFTER_DEATH" 		value="false" />
		<option name="MAX_DEATHS" 			value="10" /> 			<!-- Log out after this many deaths -->

		<!-- Party Bot options  -->
		<!-- <option name="PARTY"			value="true" /> -->
		<!-- <option name="PARTY_ICONS"		value="true" /> -->
		<!-- <option name="PARTY_INSTANCE"	value="true" /> -->

		<!-- Healing options -->
		<!-- <option name="HEALER_FIGHT"		value="true" /> --> 	<!-- For party bot if you want healer to also fight -->

		<!-- pvp -->
		<!--option name="PVP"			value="true" /> --> 		<!-- To enable PVP, with this set to true it will auto attack any players with red names -->

		<!-- For more options and documentation see the RoM Bot Wiki:  -->
		<!-- http://www.solarstrike.net/wiki/index.php5?title=RoM_Bot  -->

	</options>

	<friends>
		<!-- names of friends we help fighting or enemys we don't want to attack -->
		<!-- for umlauts use \129 (ue),\132 (ae),\148 (oe) e.g. K\132fer         -->
		<friend name="MyOtherCharacter1" />
		<friend name="MyOtherCharacter2" />
		<friend name="Elite_Mob_Name1" />
		<friend name="Elite_Mob_Name2" />
	</friends>

	<mobs>
		<!-- names of mobs we want to attack 				-->
		<!-- if no names defined we will attack all mobs	-->
		<mob name=" " />
		<mob name="" />
		<mob name="" />
	</mobs>

	<hotkeys>
    	<!-- to communicate with the RoM API / define ingame dummy macro at place 1 -->
		<hotkey name="MACRO"          key="VK_0" />
	</hotkeys>

	<!-- define your skills depending from your actual primary class -->
	<!-- see the example for a priest/mage                           -->
	<!-- delete skills you don't have or don't want to use.          -->
	<!-- For more skills to use see /database/skills.xml             -->
	<!-- demo skills for LvL 1 character for all classes             -->
	<!-- to use a specific key instead of MACRO then use hotkey="VK_1" this example is for hotkey 1 -->
	
	<skills_rogue>
		<skill name="ROGUE_SHADOWSTAB"    		hotkey="MACRO" priority="120" />
		<skill name="ROGUE_LOW_BLOW"      		hotkey="MACRO" priority="100" />
		<skill name="ROGUE_HIDE"    			hotkey="MACRO" priority="10" autouse="false" />
		<skill name="ROGUE_INFORMER"    		hotkey="MACRO" priority="50" autouse="false" />
		<skill name="ROGUE_ASSASSINS_RAGE"    	hotkey="MACRO" priority="30" autouse="false" />
		<skill name="ROGUE_WOUND_ATTACK"    	hotkey="MACRO" priority="80" />
                <skill name="ROGUE_COMBO_THROW"         hotkey="MACRO" priority="120" />
                <skill name="ROGUE_UNKNOWN_CHOICE"      hotkey="MACRO" priority="100" autouse="false" />
                <skill name="ROGUE_THROW"               hotkey="MACRO" priority="50" />    
	</skills_rogue>


	<onLoad><![CDATA[
		-- Additional Lua code to execute after loading the profile
		-- and before the bot starts. e.g. You could overwrite profile settings here
		-- like: changeProfileOption("HP_REST", 60);
	]]></onLoad>

	<onDeath><![CDATA[
		-- Additional Lua code to execute on death
		-- pauseOnDeath(); -- Stop the script
		-- player:logout();	-- logout
	]]></onDeath>

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
	]]></onLeaveCombat>

	<onLevelup><![CDATA[
		-- Additional Lua code to execute after having a levelup
		-- and levelup the skills for a new character (mage or priest recommended)
		-- e.g. sendMacro("SetSpellPoint(_tabnr, _skillnr);"); would levelup a skill
	]]></onLevelup>

	<onSkillCast><![CDATA[
		-- Additional Lua code to execute when casting a skill
		-- Note: arg1 contains the skill being used.
		-- i.e. arg1.Name will be the name of the skill being cast
		-- e.g.:
		--if( 15 > player.HP/player.MaxHP*100 ) then
		--    player:cast("PRIEST_SOUL_SOURCE");
		--elseif( 25 > player.HP/player.MaxHP*100 ) then
		--    player:cast("PRIEST_HOLY_AURA");
		--    player:cast("PRIEST_URGENT_HEAL");
		--    player:cast("PRIEST_URGENT_HEAL");
	]]></onSkillCast>

	<onHarvest><![CDATA[
		-- Additional Lua code to execute directly before the actual harvesting takes place.
		-- Note: arg1 contains the object to be harvested.
		-- i.e. arg1.Name will be the name of the node you are about to harvest
		-- If this snippet returns 'false', the node will *not* be harvested.
		-- All other return values result in the player attempting to harvest the node.
		-- Note that returning 'false' here breaks out of harvesting completely;
		-- You will not attempt to harvest other nearby nodes instead.
	]]></onHarvest>

	<onUnstickFailure><![CDATA[
		-- Lua code to execute when MAX_UNSTICK_TRIALS is reached.
	]]></onUnstickFailure>
</profile>
Thanks a lot :P
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: DoD first boss script problems

#2 Post by rock5 »

Firstly, please use [ code] tags around code, not [ quote] tags as quote tags don't indent properly which makes it hard to read. I've changed it for you.

Here is a list of errors or things I would change.
  • 1. Make the 'timeout' variable local. (not so important)

    Code: Select all

    local timeout = os.time();
    2. You don't need "target:update()" in LootTargetSolo() because getTarget returns a fresh, newly created and updated pawn.
    3. I would add a variable for easy access in the onload section, eg.

    Code: Select all

    InviteName = "charname" -- Change this value to the character to invite
    • and then write the invite like this

    Code: Select all

    sendMacro("InviteByName(\""..InviteName.."\")");
    4. I'm not sure what you are doing with the moving forward bit. It looks like you have it move forward and then wait for the loading screen before and after the teleport. If it's a normal portal I'd probably use my GoThroughPortal userfunction.
    http://www.solarstrike.net/phpBB3/viewt ... 916#p37916
    5. There are a too many things wrong with your attack sequence. First question, why can't you use the bots normal attack? Especially as it can "pull" the mob like you want.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
runegolemsentry
Posts: 10
Joined: Mon Sep 03, 2012 1:07 pm

Re: DoD first boss script problems

#3 Post by runegolemsentry »

Ok during this night i worked some hours on it, and made something which is good enough for me :D

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
 
      settings.profile.options.AUTO_ELITE_FACTOR = 9999;

   function BossPotion()
      if (not player:hasBuff("506684")) then   <!-- Gouv Speed Potion -->
         inventory:useItem(207200);
      end
      if (not player:hasBuff("506273")) then   <!-- Phy Damage food codex -->
         inventory:useItem(206876);
      end
      if (not player:hasBuff("Poisonous")) then   <!-- poison -->
         player:cast("ROGUE_POISON");
         yrest(500); 
      end
   end

</onLoad>

	<!-- #  1 --><waypoint x="1717" z="-4775" y="752">

        sendMacro("LeaveParty();"); 
        yrest(1000);
        sendMacro('InviteByName("[color=#FF0000]ASD[/color]")'); 
        yrest(1000); 
        sendMacro('SetInstanceLevel("normal")');
        BossPotion()
                                                                </waypoint>
        <!-- #  2 --><waypoint x="1668" z="-4790" y="752">	</waypoint>
	<!-- #  3 --><waypoint x="1688" z="-5156" y="758">	
	
        if not GoThroughPortal() then
              __WPL:setWaypointIndex(__WPL.LastWaypoint - 1)
        end                                                     
                                                                </waypoint>
	<!-- #  4 --><waypoint x="1926" z="2874" y="433">       </waypoint>	
	<!-- #  5 --><waypoint x="2044" z="2709" y="433">	
        
        player:cast("ROGUE_INFORMER");
        yrest(500);
        player:cast("ROGUE_ASSASSINS_RAGE");
        yrest(500);
        player:cast("ROGUE_UNKNOWN_CHOICE");
        yrest(500);    
        player:cast("ROGUE_PREMEDITATION");
        yrest(500);    
                                                                </waypoint>
	<!-- #  6 --><waypoint x="2208" z="2516" y="401">       </waypoint>
	<!-- #  7 --><waypoint x="1886" z="2883" y="433">	</waypoint>
	<!-- #  8 --><waypoint x="1702" z="2890" y="433">
	
        if not GoThroughPortal() then
              __WPL:setWaypointIndex(__WPL.LastWaypoint - 1)
        end                                                     
                                                                </waypoint>
	<!-- #  9 --><waypoint x="1645" z="-4909" y="752">	</waypoint>
</waypoints>
So it does almost all i wanted, buffs looting etc. Just, some minor problems i'd like to fix:
- I have to use Lootomatic, it does his work indeed but still i pick the green weapons/armors the trash leaves since memento are green too. Is there a way to disable loot after have entered the portal, activate it after boss fight and deativate it again? The problem is these green stuffs i pick and that lootmatic takes the loot window opened for 5-6 seconds everytime filtering the loot.

- I found a code to check weapon's durability and repair if necessary.. but how to check average gear's durability?

Last question, this night i left the bot working.. after i woke up i realized it worked only for 2 hours and then went to "Sleep" without errors or messages.. why? :|
Post Reply