Hello,
i made some modifications in order to avoid to edit romlist and for saving servo motor
///////////////////////////////////////////////////
//
// Attract-Mode Frontend - JoyTray plugin
//
// For use with the Ultimarc ServoStik
//
///////////////////////////////////////////////////
//
// The UserConfig class identifies plugin settings that can be configured
// from Attract-Mode's configuration menu
//
class UserConfig </ help="Integration plug-in for use with the JoyTray software provided by Ultimarc: http://www.ultimarc.com" /> {
</ label="Command", help="Path to the JoyTray executable", order=1 />
command="C:/Program Files (x86)/JoyTray/JoyTray.exe";
}
local config=fe.get_config(); // get user config settings corresponding to the UserConfig class above
local i=0;
//
// Copy the configured values from uconfig so we can use them
// whenever the transition callback function gets called
//
fe.add_transition_callback( "joytray_plugin_transition" );
function joytray_plugin_transition( ttype, var, ttime ) {
if ( ScreenSaverActive )
return false;
switch ( ttype )
{
case Transition.ToGame:
if ((fe.game_info( Info.Control ).find("joystick (4-way)") != null) && (i != 4))
{
fe.plugin_command_bg( config["command"], "-servo joy4way" );
i = 4;
}
if ((fe.game_info( Info.Control ).find("joystick (2-way)") != null) && (i != 4))
{
fe.plugin_command_bg( config["command"], "-servo joy4way" );
i = 4;
}
if ((fe.game_info( Info.Control ).find("joystick (vertical2-way)") != null) && (i != 4))
{
fe.plugin_command_bg( config["command"], "-servo joy4way" );
i = 4;
}
if ((fe.game_info( Info.Control ).find("joystick (8-way)") != null) && (i != 8))
{
fe.plugin_command_bg( config["command"], "-servo joy8way" );
i = 8;
}
if ((fe.game_info( Info.Control ).find("joystick (4-way)") == null) && (fe.game_info( Info.Control ).find("joystick (2-way)") == null) && (fe.game_info( Info.Control ).find("joystick (vertical2-way)") == null) && (fe.game_info( Info.Control ).find("joystick (8-way)") == null) && (i != 8))
{
fe.plugin_command_bg( config["command"], "-servo joy8way" );
i = 8;
}
break;
// case Transition.FromGame:
// fe.plugin_command_bg( config["command"], "-servo joy8way" );
// break;
}
return false; // must return false
}
I put a check in order to avoid to stress servostik, so commands will be sent only when necessary (after 1st AM boot, command will be sent anyway, because there's no way to easily know the starting position).
I'm not a programmer and i just edited this for my purposes, thanks to zpaolo11x for hints and people that created this plugin. Happy if can help.