Forum › Forums › Grids and Presets › Need help sendKey function
This topic contains 5 replies, has 3 voices, and was last updated by henlo 3 years, 2 months ago.
-
AuthorPosts
-
August 24, 2021 at 12:51 am #31950
Hey im trying to write a script that turns in white scrips. Im using F12 to target the furthest npc and deliver the collectables. After that i want to spend the scrips by pressing num4 to switch to the npc next to the appraiser. For some reason the target swapping with num4 is super inconsistent(it only works like 1 out of 4 times). I tried changing the keybind, several different delay timers and switching window modes, but I get the same result. All the other keys are working fine but the swap doesnt work, any ideas what i can do?
August 24, 2021 at 2:25 am #31954August 24, 2021 at 1:24 pm #31993August 24, 2021 at 2:10 pm #31998August 24, 2021 at 2:17 pm #31999I’m not 100% sure this works in your case but you can set a hotkey to target your Focus. If you set the Exchange NPC in your Focus and it doesnt reset inbetween runs you could use that. It does mean you would need to set the focus target at the start of each run tho.
Alternatively i’ve used the NPCs in Eulmore and made 2 waypoints in a position where each of the NPC is clearly closest. Then you use waypoint(x) inbetween the turnin and exchange and just target the NPCs using F12.
Actually i thought i can just attach my turn in scenario (its yellow scrips tho) and the edited Eulmore grid. Heres a paste if you just want to look it over: https://paste2.org/fd2jN5DD
Maybe you can find something useful in there, i wouldn’t recommend running it though since i haven’t used it in ages. Can’t guarantee it still works.- This reply was modified 3 years, 2 months ago by derm.
Attachments:
You must be logged in to view attached files.August 24, 2021 at 3:41 pm #32007Ah i see. Then its probably because its not being registered without holding. Some actions must be held for at least one frame to trigger and sendKey() doesnt do any holding. Try holdKey() instead:
holdKey(num4, 0.2)
holdKey is working. Thank you!
-
AuthorPosts
You must be logged in to reply to this topic.