ybs 3 Posted August 31, 2020 Hi guys, I'm new to scripting and writing my own scripts, How do I combine "keyboardRotateToEntity(npc)" with "getCamera().keyboardRotateToPitch(Calculations.random(238, 312))"? Basically I want to rotate to (npc) while keeping the Pitch of the camera between certain positions, any help is appreciated!
Stoned 52 Posted September 1, 2020 I'm not aware of anything in the API that would allow this, but one thing you could try is moving to a random yaw on a fixed pitch until npc.isOnScreen() returns true. Camera.keyboardRotateTo(random-yaw, fixed-pitch);
ybs 3 Author Posted September 1, 2020 3 hours ago, Stoned said: I'm not aware of anything in the API that would allow this, but one thing you could try is moving to a random yaw on a fixed pitch until npc.isOnScreen() returns true. Camera.keyboardRotateTo(random-yaw, fixed-pitch); Thank you, I'll try it that way. The reason I'm doing this is because the bot clicks on the npc through the wall when it's hidden (non-human like) and Pitch defaults to the lowest. is this correct? (replacing numbers as needed) if(npc != null) { if(!npc.isOnScreen()) { getCamera().keyboardRotateTo(Calculations.random(200,300), Calculations.random(100,300));
Realistic 20 Posted September 2, 2020 I have been messing around with writing a camera wrapper to help solve the clicking through walls or when the NPC is only slightly visible issue. Right now the wrapper is really complicated. I have a feeling I missed something. I am going to be going back over some docs later tonight and hopefully I will find a better solution. When I do end up making a good wrapper I will put it in the Dev/Scripting/Snippets forum.
NovaGTX 106 Posted September 2, 2020 Get the center of the Npc as a screen coord, get the yaw value, rotate to the npc yaw and static pitch you need.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.