Page 1 of 1

Tp Farming Question

Posted: Thu Dec 27, 2012 1:13 am
by Hidden
So I have a Tp farming waypoint that works, but i have a question.
How do I add to the onleave combat via the waypoint?

Code: Select all

<onLeaveCombat><![CDATA[
     if not player:hasBuff(491195) then -- Skill Potion 1hr 50%
      inventory:useItem(201610)
    end	
]]></onLeaveCombat>
That works great in my onLeaveCombat when Im farming, but when Im not tp farming it uses it to (as it should)
Wondering how i can simply add it to the onLoad section of my farming waypoint somehow without having it hard coded to my onLeave Combat.

Re: Tp Farming Question

Posted: Thu Dec 27, 2012 1:45 am
by rock5
You can change the onleavecombat from the waypoint file, either replace it or add to it. Here is the code to still execute the original onleavecombat as well as extra code. Add it to the waypoint onload.

Code: Select all

	if oldOnLeaveCombat == nil then oldOnLeaveCombat = settings.profile.events.onLeaveCombat end
	function settings.profile.events.onLeaveCombat()
		oldOnLeaveCombat()

		-- Extra code
		if not player:hasBuff(491195) then -- Skill Potion 1hr 50%
			inventory:useItem(201610)
		end   
	end

Re: Tp Farming Question

Posted: Thu Dec 27, 2012 3:55 am
by Hidden
Thanks Rock :)

Re: Tp Farming Question

Posted: Thu Jan 17, 2013 1:09 am
by CanceR
hello

i tried to use above code for changing OnleaveCombat settings and it works, but when i go to merchant my char does not want to sell green items lvl66 (mainly armor and weapons), i have following code in my profile file:

Code: Select all

		<!-- Auto selling options when used with player:merchant -->
		<option name="INV_AUTOSELL_ENABLE"	value="true" />		<!-- true | false -->
		<option name="INV_AUTOSELL_FROMSLOT" value="1" /> 			<!-- 1 = bag 1 slot 1 -->
		<option name="INV_AUTOSELL_TOSLOT"	value="180" /> 			<!-- 30 = last slot bag 1 -->
		<option name="INV_AUTOSELL_TYPES"	value="Weapons,Armor,Other" />
		<option name="INV_AUTOSELL_QUALITY"	value="white,green" /> 	<!-- white,green,blue,purple  -->
can someone gives an advice how to fix this.
thank you in advance

Re: Tp Farming Question

Posted: Thu Jan 17, 2013 3:25 am
by rock5
Try adding

Code: Select all

      <option name="DEBUG_AUTOSELL"      			value="true" />
to your profile and see what it says.

Re: Tp Farming Question

Posted: Thu Jan 17, 2013 11:19 am
by CanceR
problem found: i was updating wrong profile.
i use shortcut for fast start in style "..\micromacro\micromacro.exe scripts/rom/bot path:WP_Name1 profile:ProfileName2 character:CharName1
but ProfileName2 is different from CharName1 :), but i also have ProfileName1 == CharName1. In first WP_Name1, i am using command to load different WP with name WP_Name2, to go to merchant and sell all looted and unneeded items. But second WP_Name1 loads default ProfileName1, in which autosell options are disabled and code for changing OnLeaveCombat section is missing also. This leaded to inability to sell any item.
Problem solved, by equalizing profile and char names.
Thanks again for help, Rock5