Page 1 of 3

player:target_NPC not working? :S

Posted: Wed Jun 29, 2011 6:04 pm
by hamstaaa
hi i have the problem that my bot won't "find" a NPC, that is already in range!?! the strange thing is that the code SOMETIMES work...without opening the npc window :D (btw player:merchant command wont work too) the bot doesn't take the npc as target.

im talking about the NPC "Sturobold" (the Dog-guy from the Teleporters) ;)

code should be fine,cause MM dont give me an error.

WP code:

Code: Select all

	
		yrest(4000)	
		player:target_NPC("Sturobold");
		yrest(600);
		sendMacro("ChoiceOption(3);");
		yrest(600);
		sendMacro("StaticPopup_OnClick(StaticPopup1, 1);");
		yrest(4000)
		waitForLoadingScreen(); 
		player:update();
MM output:

Code: Select all

Wir gehen zum Wegpunkt #15, (-xxx, xxx)
Wir versuchen den NPC Sturobold zu finden:
Wir können den NPC Sturobold nicht finden!
Drücke MACRO: RoMScript ausführen "ChoiceOption(4);".
Drücke MACRO: RoMScript ausführen "StaticPopup_OnClick(StaticPopup1, 1);".

do somebody have that problem too? is there a macro to see the npc's arround me in MM?

thanks a lot 4 help :)

Re: player:target_NPC not working? :S

Posted: Wed Jun 29, 2011 6:33 pm
by rock5
If it can't find the npc, are there any special characters in his name?

Re: player:target_NPC not working? :S

Posted: Wed Jun 29, 2011 7:03 pm
by rock5
I thought of 2 things. You might need to run a "player:update()" before you target the npc. If that doesn't help, try using the npcs id.

Code: Select all

player:target_NPC(111256)

Re: player:target_NPC not working? :S

Posted: Wed Jun 29, 2011 10:30 pm
by hamstaaa
thx rock i try the player:update() command and write the results here tomorrow ;)

Re: player:target_NPC not working? :S

Posted: Fri Jul 01, 2011 9:04 pm
by hamstaaa
i tried both ...with ID and the update command in front of target npc...but nothing work :(
i think that can cause by other things? or how can i get the Npc's around me with a macro or else? so i can see if the bot "detects" the npc cause the bot say "cand FIND npc" so no repair or autosell works for me :(

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 2:24 am
by MiesterMan
hamstaaa wrote:do somebody have that problem too? is there a macro to see the npc's arround me in MM?
Object Viewer in my signature will show you the objects (and NPCs) that are currently around you.


Obviously you're using the German client so I have no idea what NPC you're talking about :D .

Is that a teleporter? I have another userfunction in my signature that works with teleporters.

Assuming the name is right, after you install the userfunction you would use this in your waypoint script:

Code: Select all

isTeleport("next","Sturobold",3);
I just added my latest updates to it (had been thinking on changing the name for a while, this topic pushed me over the edge though ;) ).

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 6:43 am
by hamstaaa
ty but befor the patch i think it worked fine... now ne target NO npc...he dont even get the target, but ill try try your addon for the npcs :) and i will see if its a micromacro error or anything else.

btw normally i run ks script but target npc or merchant wps dont work anymore :(

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 8:57 am
by MiesterMan
Ah, if that's the case then it might just be the version of the bot you're using. Try doing an SVN update. My addon won't fix anything if the basic function of the bot isn't working.

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 9:54 am
by hamstaaa
no dude i do a svn update nearly once a day :)

and BTW your ingame function show me a list of npc's in my range.
funny is that my repair vendor is in that list too ;) also sturobold, that i cant target too.

so MM should target the mob but he dont target it. what else can cause this problem? :( all is same as before. I only updated MM and the Game.

ehm... what function or file in the MM or BOT folder is for interact with npc's? maybe i dont have it anymore?!? but i think svn-update do a check for that,dont it?

maybe someone can help me :) i trust in admins, they are good coders too ;)

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 11:18 am
by MiesterMan
From what you've wrote above, MM sees all the NPCs around you so that's not the broken part. Try deleting your addresses.lua and do another SVN update.

I wouldn't reccomend changing it but all functions in the player class (prefixed by player: ) are in the scripts\rom\classes\player.lua file. The function itself is just functionality so there can't really be anything wrong with it unless RW changes the way the interface works.

This sounds like a case of addresses being off to me but I could be wrong.

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 11:30 am
by rock5
I just tested in German and it work.

Here's the reasons I can think off why it wouldn't work.
1. You are stopping out of range.
2. You are doing more than 1 teleport in the one waypoint without doing a player:update().
3. You've been messing around with the rombot files and now they don't work properly anymore.

Actually, that's it. Can't think of anything else at the moment

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 7:42 pm
by hamstaaa
hmm i try to delete the adresses.lua file and the files in /classes...then i make a svn update

after it i will test again and give a feedback here...
I just tested in German and it work.

Here's the reasons I can think off why it wouldn't work.
1. You are stopping out of range.
--I stay 1m away from npc

2. You are doing more than 1 teleport in the one waypoint without doing a player:update().
--funktion already in waypoint file directly in front of npc code



3. You've been messing around with the rombot files and now they don't work properly anymore.
-- maybe the last svn update causes errors?
Actually, that's it. Can't think of anything else at the moment


but what i find strange is it target mobs without any error but no npc :S

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 7:51 pm
by MiesterMan
Sorry, could you post the contents of your waypoint file in code tags? It's looking less and less like a bot issue and more like a "script somehow broke" issue.

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 8:04 pm
by hamstaaa
Sorry, could you post the contents of your waypoint file in code tags? It's looking less and less like a bot issue and more like a "script somehow broke" issue.
of course :)

Code: Select all

		
player:update();
player:merchant("Fadiya Royil")
	if player:openStore("Fadiya Royil") then
      		 for i, item in pairs(inventory.BagSlot) do
      		  if (item.Worth > 333) then
       		     item:use()
    		     end
     		 end
	   end
thats my waypoint code-tag for npc

-15106 39558 513 nil 111074 false 2465aa00
-15322 39594 544 nil Soldat des Außenpostens 118803 false 246c0000
-15178 39888 606 nil Sequoia-Setzling 118491 false 246c6400
-15162 39901 608 nil Waldschabe des Geheimen 105673 true 2473b400
-15040 40325 618 nil Ameisenbär des Geheimen 105675 true 2968a000
-15139 40281 599 nil Ameisenbär des Geheimen 105675 true 2968b400
-15279 40289 609 nil 118616 false 2968b900
-15388 40293 612 nil Purpurner Achat-Kristall 560080 false 2968be00
-15449 40245 604 nil Waldschabe des Geheimen 105673 true 2968c800
-15636 40288 609 nil 117545 false 2968cd00
-15649 40283 611 nil 116053 false 2968d200
-15779 40257 615 nil 117913 false 2968e100
-15772 40247 616 nil Landwirtin 118590 false 2968eb00
-15502 39882 725 nil Feuerstiefelwachmann 118588 false 2a690a00
-15755 39738 614 nil Rastender Soldat 118830 false 2a691400
-15705 39697 590 nil Briefkasten 118670 false 2a691900
-15666 40024 606 nil Felsgalidun 105676 true 2a692300
-15528 39821 606 nil Fadiya Royil 118307 false 2a692800
-15509 39800 607 nil "Diener" Yalila 118304 false 2dc51400
-15321 39444 557 nil Außenposten-Patrouille 118752 false 2dc5a000
-15782 40254 615 nil Sequoia-Setzling 118491 false 2dc5a500
-14992 40072 577 nil Ameisenbär des Geheimen 105675 true 2dc5b400
-15234 39808 611 nil Waldschabe des Geheimen 105673 true 3183af00
-15676 39470 571 nil Außenposten-Patrouille 118752 false 346d3200
-15676 39470 571 nil Außenposten-Patrouille 118752 false 346d3200
-15771 39470 566 nil Kakano Donnerbüchse 118810 false 35460000
-15287 39483 558 nil 118716 false 35466900
-15179 39441 509 nil Soldat des Außenpostens 118802 false 3546a500
-15159 39879 606 nil 116053 false 3546d700
-15323 39528 549 nil Malin Kupferring 118300 false 3546e100
-15664 39731 596 nil Außenposten-Patrouille 118752 false 3546eb00
-15204 39864 606 nil 118612 false 3546f000
-15174 39888 607 nil 117913 false 3546f500
-15223 39880 606 nil 117545 false 3546fa00

code-snippet from your function output...green is the npc he should use..


MM output in German:

Code: Select all

Lösche Ziel.
Wir gehen zum Wegpunkt #10, ()
Wir versuchen den NPC Fadiya Royil zu finden:
Wir können den NPC Fadiya Royil nicht finden!
Wir versuchen den NPC Fadiya Royil zu finden:
Wir können den NPC Fadiya Royil nicht finden!
Wir gehen zum Wegpunkt #11, ()
Wir gehen zum Wegpunkt #12, ()
can it be an ingame-macro problem? i dont know when i update it last time in RoM folder :? ^^

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 8:30 pm
by MiesterMan
Using http://translation.babylon.com/german/to-english/ I get:

Code: Select all

We go to the waypoint #10, ()
We try to find the NPC Fadiya Royil: 
we can not find the NPC Fadiya Royil! 
We try to find the NPC Fadiya Royil: 
we can not find the NPC Fadiya Royil! 
We go to the waypoint #11, () 
we go to the waypoint #12, ()
So, again, not finding the NPC.

No, this can't be an IGF thing. If it isn't opening the store it's not going to sell anything no matter what.

Try using the object ID of the NPC instead. You can get it using the Object Viewer you used before.
ex:

Code: Select all

player:target_NPC(123456)

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 8:37 pm
by hamstaaa
i tried it yesterday with the ID numbers....then comes cant find npc (123456) :(

next what i try is completely new romb*t folder with pasted configs :S lets see :( :(

or do you have some more ideas miester? :)

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 9:55 pm
by Administrator
hamstaaa wrote:i tried it yesterday with the ID numbers....then comes cant find npc (123456) :(

next what i try is completely new romb*t folder with pasted configs :S lets see :( :(

or do you have some more ideas miester? :)
I'm pretty sure he intended for you to find the correct ID, not use 123456.

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 10:14 pm
by lisa
Fadiya Royil 118307

Code: Select all

player:target_NPC(118307)

Re: player:target_NPC not working? :S

Posted: Sat Jul 02, 2011 10:41 pm
by MiesterMan
Ah, thank you lisa. I couldn't tell what that text he posted was. It's missing the header :oops: .
(I also couldn't read the green text, too bright on my screen)

hamstaa, you already deleted most of your files and reloaded them from SVN, if anything just delete the rest of your main directory files and reload them but I really think this is just a matter of finding the right text to use. Try lisa's code and let us know.

Re: player:target_NPC not working? :S

Posted: Sun Jul 03, 2011 8:54 am
by hamstaaa
Changes in Code:

Code: Select all

player:update();
player:merchant(118307)
	if player:openStore(118307) then....
ty lisa but know how to handle with ID :)

ill give u a result in approx. 30 min


BTW i tried it with my "old" rom folder and a completely new one(svn update)...same result


here is the result of changing wp file...MM output ;)

Code: Select all

Wir versuchen den NPC 118307 zu finden:
Wir können den NPC 118307 nicht finden!
Wir versuchen den NPC 118307 zu finden:
Wir können den NPC 118307 nicht finden!