RGL
Joined: 7/13/2017
Posts: 57
I am currently playing Super Princess Peach and wondered if it would be possible to make a LUA script that will press on a specific touch screen position when you press a button on your controller. This would make games easier to play where the touchscreen is mostly just used for extra buttons. Something like if RB is pressed on controller, touch screen at 176 / 108
YoshiRulz
Any
Editor, Emulator Coder
Joined: 8/30/2020
Posts: 111
Location: Sydney, Australia
Download peachy.lua
Language: lua

while true do local buttons_down = input.get(); local to_set = {}; local to_set_axes = {}; if buttons_down["X1 RightShoulder"] then to_set["Touch"] = true; to_set_axes["Touch X"] = 176; to_set_axes["Touch Y"] = 98; else client.clearautohold(); end joypad.set(to_set); joypad.setanalog(to_set_axes); emu.frameadvance(); end
I contribute to BizHawk as Linux/cross-platform lead, testing and automation lead, and UI designer. This year, I'm experimenting with streaming BizHawk development on Twitch. nope Links to find me elsewhere and to some of my side projects are on my personal site. I will respond on Discord faster than to PMs on this site.
Hey look buddy, I'm an engineer. That means I solve problems. Not problems like "What is software," because that would fall within the purview of your conundrums of philosophy. I solve practical problems. For instance, how am I gonna stop some high-wattage thread-ripping monster of a CPU dead in its tracks? The answer: use code. And if that don't work? Use more code.
Spikestuff
They/Them
Editor, Publisher, Expert player (2656)
Joined: 10/12/2011
Posts: 6449
Location: The land down under.
I'm curious about a right stick for directional input for games that require constant touching of the button for aiming-- like Call of Duty.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
RGL
Joined: 7/13/2017
Posts: 57
YoshiRulz wrote:
Download peachy.lua
Language: lua

while true do local buttons_down = input.get(); local to_set = {}; local to_set_axes = {}; if buttons_down["X1 RightShoulder"] then to_set["Touch"] = true; to_set_axes["Touch X"] = 176; to_set_axes["Touch Y"] = 98; else client.clearautohold(); end joypad.set(to_set); joypad.setanalog(to_set_axes); emu.frameadvance(); end
Absolute MVP. Thanks bro.
RGL
Joined: 7/13/2017
Posts: 57
while true do
	local buttons_down = input.get();
	local to_set = {};
	local to_set_axes = {};
	if buttons_down["X1 RightShoulder"] then
		to_set["Touch"] = true;
		to_set_axes["Touch X"] = 213;
		to_set_axes["Touch Y"] = 47;
	else
		client.clearautohold();
	end
	if buttons_down["X1 LeftShoulder"] then
		to_set["Touch"] = true;
		to_set_axes["Touch X"] = 48;
		to_set_axes["Touch Y"] = 48;
	else
		client.clearautohold();
	end
	if buttons_down["X1 LeftTrigger"] then
		to_set["Touch"] = true;
		to_set_axes["Touch X"] = 42;
		to_set_axes["Touch Y"] = 152;
	else
		client.clearautohold();
	end
	if buttons_down["X1 RightTrigger"] then
		to_set["Touch"] = true;
		to_set_axes["Touch X"] = 217;
		to_set_axes["Touch Y"] = 142;
	else
		client.clearautohold();
	end
	joypad.set(to_set);
	joypad.setanalog(to_set_axes);
	emu.frameadvance();
end
For Super Princess Peach with all 4 emotions mapped to the 4 shoulderbuttons :) Thanks again