target_NPC command
target_NPC command
I have been trying to find where the function is located to look at it and edit it, but when using search in function.lua i cannot find it, can anyone point me to it? thanks.
Re: target_NPC command
player.lua line 3638
Why would you need to edit it?
As a little more info, any functions that have
player:
will be found in the player.lua in classes folder.
Why would you need to edit it?
As a little more info, any functions that have
player:
will be found in the player.lua in classes folder.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: target_NPC command
If you think you will have the need for it in the future, I recommend FileSeek http://www.fileseek.ca/ for searching in files located in a folder.
But with that said, most bot functions, that are not micromacro commands, are organized in classes which are organized 1 class per file named after the class. The functions that are not part of a class are mostly found in functions.lua but there are a lot of functions all over the place.
Examples:
But with that said, most bot functions, that are not micromacro commands, are organized in classes which are organized 1 class per file named after the class. The functions that are not part of a class are mostly found in functions.lua but there are a lot of functions all over the place.
Examples:
- player:taregt_NPC is found in \classes\player.lua
mob:hasBuff is found in \classes\pawn.lua
inventory:getItemCount is found in classes\inventory.lua
bagitem:use() is found in \classes\inventoryitem.lua
waitForLoadingScreen is found in functions.lua
- 1. The objects created by the class doesn't necessarily have the same or similar name as the class. Some class objects always have the same name eg. player, inventory, bank, guild. Other class objects have temporary names and can be anything, eg. pawns, inventory items, etc. To work out which class it is you need to know what the object is.
2. Some classes have subclasses eg. 'player' is based on the pawn class so it shares all the pawn functions and values. So if you are looking for a player function, eg. player:hasBuff, you might find it in the pawn class file. Also inventoryitem, bankitem and guilditem all use the item class as a base class.
3. There are exceptions to these rules.
- 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
Re: target_NPC command
@ZZZZZ
Do you refer to http://www.solarstrike.net/phpBB3/viewt ... =21&t=5507 ?
I can give you my modification as a userfunction but I didn't added all mailboxes so if you have trouble you need add some more ID's ind target_NPC.
I also must warn you :
This will work basically every time with the new fast target_NPC
This not:
The reason is the first the new fast target_NPC did take care that the menu windows is opened after you pressed it one time nobody does, so the second time you can press buttons in the air.(This sadly apply also without any modification)
2 solutions:
I also wrote a new function PressMenu(_option) which take care but I haven't tested it until now(I added it to the file)
Please make some yrest between the code because it would see inhuman and very botish otherwise.
Do you refer to http://www.solarstrike.net/phpBB3/viewt ... =21&t=5507 ?
I can give you my modification as a userfunction but I didn't added all mailboxes so if you have trouble you need add some more ID's ind target_NPC.
I also must warn you :
This will work basically every time with the new fast target_NPC
Code: Select all
player:target_NPC("118020");
sendMacro("ChoiceOption(1);");
waitForLoadingScreen();
Code: Select all
player:target_NPC("118020");
sendMacro("ChoiceOption(2);");
sendMacro("ChoiceOption(2);");
waitForLoadingScreen();
2 solutions:
Code: Select all
repeat
player:target_NPC("118020");
yrest(500);
sendMacro("ChoiceOption(2);");
sendMacro("ChoiceOption(2);");
until waitForLoadingScreen(10);
Code: Select all
player:target_NPC("118020");
PressMenu(2)
PressMenu(2)
waitForLoadingScreen();
- Attachments
-
- userfunction_mixed.lua
- (16.84 KiB) Downloaded 99 times
Jack-of-all-trades, but master-of-only of a few
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
Re: target_NPC command
Basically I want to try something along the lines of
My net isnt always stable, so I am wanting to change the target_NPC function so that I don't have to worry about it targeting the designated and 'talking' before the Speak Frame even appears. Yeh, you could say "Put a larger yrest between target and choice option" but most of mine already have yrest(1000) after targets, even 2000 on some, and it still misses when my net is being temperamental.
I'll check out your userfunction too Blubblub and see if I can get something working, thanks.
Also thanks R5, i'll keep that noted so I have an idea of where to look if I am after something else
Code: Select all
-- target NPC
repeat
self:target(npc.Address)
Attack(); yrest(50); Attack(); -- 'click' again to be sure
yrest(500);
until RoMScript("SpeakFrame:IsVisible()");I'll check out your userfunction too Blubblub and see if I can get something working, thanks.
Also thanks R5, i'll keep that noted so I have an idea of where to look if I am after something else
Re: target_NPC command
Blubblab, with your function why don't you just do something along the lines of
So far that has worked wonders for me when using the target_NPC function. I just changed the main 1 in player.lua.
Code: Select all
repeat
RoMScript("CloseWindows()");
self:target(npc.Address)
Attack(); yrest(50); Attack(); -- 'click' again to be sure
yrest(500);
until RoMScript("SpeakFrame:IsVisible()") or RoMScript("MailFrame:IsVisible()");So far that has worked wonders for me when using the target_NPC function. I just changed the main 1 in player.lua.
Re: target_NPC command
I do take a lock in the code.
I added exceptions for the mailbox because with UMM I have no speakframe -> I would end in a infinite loop.
I added exceptions for the mailbox because with UMM I have no speakframe -> I would end in a infinite loop.
Jack-of-all-trades, but master-of-only of a few
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226