Skip to content

Instantly share code, notes, and snippets.

--[[
ExportScoreForIRC is something that AJ made for fun. It requires an
understanding of how StepMania views your filesystem, as well as knowledge
on how to make your IRC client play from a script file.
Since this was made for a limited purpose, it assumes you play as a single player
in non-course modes.
It spits out a string like this:
last played: $SONG by $ARTIST ($SONGGROUP) [$MODE $DIFFICULTY] $PERCENT | $W1 / $W2 / $W3 / $W4 / $W5 / $MISS | Holds: ($HELD/DROPPED) Max Combo: $MAXCOMBO
-- Format BackgroundEffects
-- Scripts edited by: Daniel Duhme
-- also known as: Danielu Yoshikoto
-- If used, give credits and not claim your own
-- Format 3+, for croping 4x3 media to fill a 16x9 screen + have it not loop.
-- www.buu-page.de
local cColor1 = color(Var "Color1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
-- OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scaletocover,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,cColor1;loop,false);
-- This is a simple example of streaming live score data to a file.
-- It is meant to be loaded as an actor in the out transition layer of
-- ScreenGameplay.
-- Save it to Graphics/live_score_report.lua in a theme and edit
-- BGAnimations/ScreenGameplay decorations.lua to load it.
-- If BGAnimations/ScreenGameplay decorations.lua doesn't exist, here is an
-- example:
-- return Def.ActorFrame{
-- LoadActor(THEME:GetPathG("", "live_score_report.lua")),
-- }
# Print hilighted messages with MSGLEVEL_PUBLIC to active window
# for irssi 0.7.99 by Kyzentun based on showhilight.pl by Pawe³ 'Styx' Chuchma³a
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "0.1";
%IRSSI = (
authors => "Kyzentun",
contact => "",
name => "kyzhilight",
local xtl_cond_a_result= not (GAMESTATE:IsPlayerEnabled(PLAYER_1) and GAMESTATE:IsPlayerEnabled(PLAYER_2)
and GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty() ~= GAMESTATE:GetCurrentSteps(PLAYER_2):GetDifficulty())
-- XML is so terrible. At least, I hope XML being terrible is the reason why this piece of code was repeated 17 times.
-- score1 = tonumber(string.sub(SCREENMAN:GetTopScreen():GetChild('ScoreP1'):GetChild('ScoreDisplayPercentage Percent'):GetChild('PercentP1'):GetText(), 1, -2))
-- And it's clumsy too, going through the actor tree, hoping those actors exist (they don't if the preferences aren't set to specific things), and then parsing the text.
-- Much better to just fetch the score from STATSMAN. -Kyz
local function get_score(pn)
-- Normally I'd cache the PlayerStageStats for each player in a local
local player= Var("Player")
local texframe= false
local texture= false
local tex_width= 128
local sprite_width= 16
local life_sprite= false
local life_poses= {}
local function redraw_lives(self)
for i, pos in ipairs(life_poses) do
life_sprite:xy(pos[1], pos[2]):Draw()
local song_position= false
local cheat_code= {
"Right", "Down", "Up", "Right", "Right", "Down", "Right", "Right", "Up",
"Up", "Down", "Down", "Left", "Right", "Left", "Right", "Right", "Down",
"Up", "Right", "Right", "Down", "Right", "Right", "Up", "Up", "Down",
"Down", "Left", "Right", "Left", "Right", "Right", "Down", "Up", "Right",
"Right", "Down", "Right", "Right", "Up", "Up", "Down", "Down"
}
local code_len= #cheat_code
local code_progress= {}
local hw= _screen.w * .5
local low_pos= _screen.h + 16
local fly_count= 200
local flies= {}
local curr_fly= 1
local function unzip_fly(offset)
local b = GAMESTATE:GetSongBeat()
if (b >= 224 and b <= 288) or b >= 422 then
-- A simple screen for showing the player how fast they're mashing a button.
-- press_history will store the times that the button was pressed.
local press_history= {}
-- Values for max_press_age, semi_recent_age, and recent_age may need twerking
-- to excite users.
-- Any button press older than max_press_age will be from history. This
-- controls the maximum possible resolution of the nps measurement. With a 10
-- second history, the nps cannot be measure more finely than two significant
-- figurines. (x.x)
-- This simple example looks at input events to set text on the screen
-- showing one button that is being pressed. Because it doesn't use a list
-- of text actors, if multiple buttons are pressed it will only show info for
-- the last one.
-- The Config Key/Joy screen lists all buttons in the current game mode.
-- button_text and game_button_text will be set to actors when those actors
-- are created. These local variables exist to skip the hassle of calling
-- GetChild.