LuaFunction_Int( X##ToString, Lua##X##ToString(a1) );
LuaFunction_Str( StringTo##X, LuaStringTo##X(str) );

LuaFunction_NoArgs( CoinMode,   		CoinModeToString(PREFSMAN->m_CoinMode) )
LuaFunction_NoArgs( Premium,    		PremiumToString(PREFSMAN->m_Premium) )
LuaFunction_PlayerNumber( IsPlayerEnabled,	GAMESTATE->IsPlayerEnabled(pn) )
LuaFunction_PlayerNumber( IsHumanPlayer,	GAMESTATE->IsHumanPlayer(pn) )
LuaFunction_PlayerNumber( IsPlayerUsingProfile,	PROFILEMAN->IsUsingProfile(pn) )
LuaFunction_PlayerNumber( IsWinner,		GAMESTATE->GetStageResult(pn)==RESULT_WIN )
LuaFunction_NoArgs( IsCourseMode,		GAMESTATE->IsCourseMode() )
LuaFunction_NoArgs( IsDemonstration,		GAMESTATE->m_bDemonstrationOrJukebox )
LuaFunction_NoArgs( StageIndex,			GAMESTATE->GetStageIndex() )
LuaFunction_NoArgs( NumStagesLeft,		GAMESTATE->GetNumStagesLeft() )
LuaFunction_NoArgs( IsFinalStage,		GAMESTATE->IsFinalStage() )
LuaFunction_NoArgs( IsExtraStage,		GAMESTATE->IsExtraStage() )
LuaFunction_NoArgs( IsExtraStage2,		GAMESTATE->IsExtraStage2() )
LuaFunction_NoArgs( CourseSongIndex,		GAMESTATE->GetCourseSongIndex() )
LuaFunction_NoArgs( PlayModeName,		PlayModeToString(GAMESTATE->m_PlayMode) )
LuaFunction_NoArgs( CurStyleName,		CString( GAMESTATE->m_pCurStyle == NULL ? "none": GAMESTATE->GetCurrentStyle()->m_szName ) )
LuaFunction_NoArgs( GetNumPlayersEnabled,	GAMESTATE->GetNumPlayersEnabled() )
LuaFunction_NoArgs( PlayerUsingBothSides,	GAMESTATE->PlayerUsingBothSides() )
LuaFunction_NoArgs( GetEasiestNotesDifficulty, 	GAMESTATE->GetEasiestNotesDifficulty() )
LuaFunction_Str( GetEnv,			GAMESTATE->m_mapEnv[str] )
LuaFunction_StrStr( SetEnv,			GAMESTATE->m_mapEnv[str1] = str2 )
LuaFunction_NoArgs( CurSong,			GAMESTATE->m_pCurSong )
LuaFunction_PlayerNumber( CurSteps,		GAMESTATE->m_pCurSteps[pn] )
LuaFunction_NoArgs( MonthOfYear, 		GetLocalTime().tm_mon+1 );
LuaFunction_NoArgs( DayOfMonth, 		GetLocalTime().tm_mday );
LuaFunction_NoArgs( Hour, 			GetLocalTime().tm_hour );
LuaFunction_NoArgs( Minute, 			GetLocalTime().tm_min );
LuaFunction_NoArgs( Second, 			GetLocalTime().tm_sec );
LuaFunction_NoArgs( Year, 			GetLocalTime().tm_year+1900 );
LuaFunction_NoArgs( Weekday, 			GetLocalTime().tm_wday );
LuaFunction_NoArgs( DayOfYear, 			GetLocalTime().tm_yday );
LuaFunction_NoArgs( IsAnyPlayerUsingMemoryCard,	IsAnyPlayerUsingMemoryCard() )
LuaFunction_NoArgs( IsNetConnected,		NSMAN->useSMserver )
LuaFunction_NoArgs( IsNetSMOnline,		NSMAN->isSMOnline )
LuaFunction_PlayerNumber( IsSMOnlineLoggedIn,	NSMAN->isSMOLoggedIn[pn] )
LuaFunction_Str( Song, 				SONGMAN->FindSong( str ) );
LuaFunction_Song( SongFullDisplayTitle, 	p->GetFullDisplayTitle() );
LuaFunction_Steps( StepsMeter, 			p->GetMeter() );
LuaFunction_NoArgs( GetStagesPlayed,		(int) g_vPlayedStageStats.size() );
LuaFunction_NoArgs( GetBestGrade,		GetBestGrade() );
LuaFunction_NoArgs( GetWorstGrade,		GetWorstGrade() );
LuaFunction_NoArgs( OnePassed,			g_CurStageStats.OnePassed() );
LuaFunction_PlayerNumber( FullCombo,		g_CurStageStats.m_player[pn].FullCombo() )
LuaFunction_PlayerNumber( MaxCombo,		g_CurStageStats.m_player[pn].GetMaxCombo().cnt )
LuaFunction_PlayerNumber( GetGrade,		g_CurStageStats.m_player[pn].GetGrade() )
LuaFunction_Str( Grade,				StringToGrade(str) );
LuaFunction_IntInt( OneGotGrade, 		OneGotGrade( a1, (Grade) a2 ) );
LuaFunction_PlayerNumber( GetFinalGrade, 	GetFinalGrade(pn) );
LuaFunction_NoArgs( GetBestFinalGrade, 		GetBestFinalGrade() );
