Page 1 of 1

Research Expert - Loose Target

Posted: Fri Mar 04, 2016 4:14 am
by Buh
HEy some ppl here..

Someone know, if and how i can change it, that i dont loose the NPC target, while making this Dailyquest?

Also there must be an macro for harvesting as an ingame function......... i saw that at other players -.-

Greetings

me

Re: Research Expert - Loose Target

Posted: Sat Mar 05, 2016 4:24 am
by Bot_romka
Buh wrote:HEy some ppl here..

Someone know, if and how i can change it, that i dont loose the NPC target, while making this Dailyquest?

Also there must be an macro for harvesting as an ingame function......... i saw that at other players -.-

Greetings

me

Code: Select all

function Player_Target_NPC(_npcname)
	-- number to string conversations
	local tonumbernpcname = tonumber(_npcname)
	if( type(tonumbernpcname) == "number" ) then
		_npcname = TEXT(string.format('Sys%s_name', tonumbernpcname));
		--CHAT_msg(_npcname);
	end
	-- find NPS
	for i = 1, 40 do
		local BBFrame = _G["OBloodBar"..i];
		local BBID = BBFrame:GetID();
		local BBname = _G[BBFrame:GetName().."Title"]:GetText();
		if( (BBname == _npcname or string.find(BBname,_npcname)) and BBID ~= 0 ) then
			--CHAT_msg(_npcname..", "..BBID);
			-- target NPC
			OBB_ChangeTraget(BBID);
			return true
		end
	end
	return false
end;

Code: Select all

/run Player_Target_NPC(120577)	-- NPC Id
or use NPC name.

Re: Research Expert - Loose Target

Posted: Sun Mar 06, 2016 7:59 am
by wiedzmin97

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
function fastTarget(_objid, waittime)
      obj = player:findNearestNameOrId(_objid)
      player:target(obj.Address)
      yrest(100)
      Attack()
      yrest(waittime)
   end

function Player_Target_NPC(_npcname)
   -- number to string conversations
   local tonumbernpcname = tonumber(_npcname)
   if( type(tonumbernpcname) == "number" ) then
      _npcname = TEXT(string.format('Sys%s_name', tonumbernpcname));
      --CHAT_msg(_npcname);
   end
   -- find NPS
   for i = 1, 40 do
      local BBFrame = _G["OBloodBar"..i];
      local BBID = BBFrame:GetID();
      local BBname = _G[BBFrame:GetName().."Title"]:GetText();
      if( (BBname == _npcname or string.find(BBname,_npcname)) and BBID ~= 0 ) then
         --CHAT_msg(_npcname..", "..BBID);
         -- target NPC
         OBB_ChangeTraget(BBID);
         return true
      end
   end
   return false
end;

</onLoad>	

<!-- #  1 --><waypoint x="15381" z="35837" y="688">	
Player_Target_NPC(123561);
         yrest(200)

         fastTarget(123369,200);
         fastTarget(123368,200);
         fastTarget(123508,200);
         yrest(200)
Player_Target_NPC(123561); 
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
      if 10 == dailyQuestCount then
   if inventory:itemTotalCount(202434) > 0 then
                 inventory:useItem(202434)
   end
end
</waypoint>
</waypoints>
Have i something wrong here? Because im getting error:

Code: Select all

2016-03-06 13:52:53 - [string "..."]:14: attempt to call global 'TEXT' (a nil value)

Re: Research Expert - Loose Target

Posted: Thu Mar 10, 2016 1:26 pm
by Buh
Hey

Sorry for this late answer but i thank you very much and i will try this in a few hours and give you feedback.

Thanks!!

Greetings

Me

Re: Research Expert - Loose Target

Posted: Thu Mar 10, 2016 3:52 pm
by Buh
Hey

I tried it out and it dont works. Noo much nil-Value methods.

Once there is this "TEXT" idk for what it is. And after that BBFrame makes issues.

Greetings

Me

Re: Research Expert - Loose Target

Posted: Mon Mar 14, 2016 8:09 am
by Bot_romka
This code for game client addon, not for Bot. Create addon and use

Code: Select all

RoMCode("Player_Target_NPC(123561);")