Page 1 of 1

targeting/killing mob that is infight with NPC (for a quest)

Posted: Tue Jul 05, 2011 1:26 am
by stessiberti
Hi all!
First off all i must say i m really impressed about the progress rom bot made the last moths as i made a break with runes for some month.
Great Work ALL !

well and then back to my topic :

i got a quest where i have to run to a certain area , where a npc is fighting a mob , i need to target this mob and kill it to complete the quest

what i want to do :
1) accept quest from npc ( done and no problem )
2) run to place where the action is ( done )
3) here is my problem - i m standing infront on the npc and the mob that is he fighting and need to target and kill this mob
but rombot just ignores tha mob
what i tried so far is :
* set ANTI_KS on false
* waypoint is defined as normal ( no TRAVEL and no RUN )
* i got MAX_TARGET_DIST on 200
* i tried player:findTarget("mobname");


but all i tried , as i said , my charakter just ignores the mob and goes on to next waypoint

hope someone can help me with that

THX in advance

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 1:33 am
by lisa
try this, change mobname to what ever the mob is called, or it's ID.

Code: Select all

player:clearTarget();
player:target(player:findNearestNameOrId("mobname"))
if player:haveTarget() then player:fight(); end

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 1:38 am
by rock5
What Lisa said but ANTI_KS should have worked so there must be some other reason why it didn't attack. Try using debug to find out why? Just start the bot with

Code: Select all

rom/bot debug

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 1:45 am
by lisa
Yeah I just assumed it has to do with party bot settings, if those settings are messed up then the anti_ks doesn't work properly

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 2:18 am
by stessiberti
THX lisa / Rock for fast reply !


here my test script :


<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>changeProfileOption("ANTI_KS", "false");
changeProfileOption("MAX_TARGET_DIST", 200);
</onLoad>


<!-- # 1 --><waypoint x="1166" z="-31" y="140"> </waypoint>
<!-- # 2 --><waypoint x="1283" z="111" y="141">
player:clearTarget();
player:target(player:findNearestNameOrId(105341))
if player:haveTarget() then player:fight();
end </waypoint>
</waypoints>




*i used lisas idea for get the target
*i checked the party settings and all disabled them
*i did rocks debug thing , but still char is going from waypoint 1 to 2 in loop without hitting anything


maybe some got time to see over ther script


ps : i got no clue how to post scripts in boxes like you guys do , so sorry for bad layout

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 3:46 am
by rock5
The reason to use debug is to see the extra info it prints in the micromacro window. Did it print any extra messages that might explain why it's not targeting?

To display boxed code, select the code after pasting it, and click the "Code" button at the top of the edit box.

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 4:13 am
by stessiberti
ok

what i did now

startet waypointpath with debug command ( didn t know that debugmod exists )

i used

Code: Select all

rom\bot debug path:test22

and yeah i got additional messages

Code: Select all

(debug) playerAddr:0x28BA5F00
(debug) player classes 6/2
(debug) palyer pet:0x0
(debug) Player target:0x0
(debug) player in battle: false
(debug) mousePawn:0x0
(debug)mousePawn id:0
(debug) camAddress:0xFCD800
(debug) camx...........
(debug) camxu........
Loading Profile xxxxxxxx.xml
commandMacro set to 1.
resultMacro set to 2.
actionKey set to 10.
The macro hotkey is 0.

Macro Test: ok 
Ranged skill found ........
(debug) CPU Frequency.........
We changed the option "anti_ks" from true to false
We changed the poption "max_target_dist.............

Loaded waypoint path test22.xml now.

Moving to waypoint #1,(1166,-31)
Moving to waypoint #2,(1283,111)
Clearing target.
clearing target.
Clearing target.
Moving to waypoint #1,(1166,-31)
Moving to waypoint #2,(1283,111)



and so on 

for me i found no hidden clue why bot doesnt even think about hit this mob


so thx again so far

btw i would try any suggestions or other ways, if there is some to get this mob down

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 5:06 am
by rock5
It toom me awhile but I figured it out. ANTI_KS = false allows you to attack your friends enemies but the bot never attacks mobs that are attacking strangers. Try adding the npcs name to your friend list in your profile then ANTI_KS = false will work.

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 5:27 am
by stessiberti
seriously , i m close to begin to cry !

was thinking about this problem now for 3 days !!!!

and now it works !!!!!!!!!!
it was the friendlist , man i would never have had that idea


THX so much ROCK5
and lisa ofc !
not just for spending time in my solutions , for all the work you do here, always a pleasure to read this forum and see the progress

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 5:48 am
by stessiberti
so i got one last question about this issue


is there a command like

Code: Select all

changeProfileOption("MAX_TARGET_DIST", 200);
as

Code: Select all

changeProfileFriend ("mobname");
doesnt seem to work

thx :-)

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Tue Jul 05, 2011 6:16 am
by lisa
short answer is

Code: Select all

table.insert(settings.profile.friends, "name");
change name to the name of the mob

Another is to use a userfunction I made a little while back.

changeOptionFriendMob(arg1, arg2, arg3)
arg1 = "mob" or "friend"
arg2 = name of what ever your adding or removing from list
arg3 = "Add" or "Remove"

Code: Select all

changeOptionFriendMob("mob", "Wolf", "Add") 
changeOptionFriendMob("friend", "Hokeypokey", "Remove")
Add file to rom/userfunctions/

Re: targeting/killing mob that is infight with NPC (for a qu

Posted: Thu Jul 07, 2011 1:54 am
by stessiberti
Thx lisa your tool works perfect !

btw if some other has same problem at some point , i had my best results when i had my waypoint mode on TRAVEL !