/* * $VER: shuffle_info.amirx 1.0 (28.06.2007) © 2007 Christian Rosentreter * * Prints out statistical information about Shuffle to AmIRC. * * usage: * use AmIRC's trigger.plugin and add following line to its database: * * shuffle /rx shuffle_info %a %c %n %N * * Now you can show shuffle stats with !shuffle or !shuffle to * current channel. */ signal on syntax; options results; PARSE ARG level " " channel " " nick " " mynick; /* get arguments */ port = ADDRESS(); ADDRESS VALUE port; IF nick~=mynick THEN EXIT; IF SHOW("P", "SHUFFLE") THEN DO ADDRESS SHUFFLE; IF level=='' THEN DO QueryStats 'TOTALSOLVED'; totalsolved = result; QueryStats 'TOTALPLAYED'; totalplayed = result; QueryStats 'TOTALSLIDES'; totalslides = result; QueryStats 'LEVELTOTAL'; leveltotal = result; QueryStats 'LEVELAVAILABLE'; levelavail = result; QueryStats 'LEVELSOLVED'; levelsolved = result; QueryStats 'SOLVERATIO'; solveratio = result; QueryStats 'STARS'; stars = result; QueryStats 'GOLDSTARS'; goldstars = result; QueryStats 'PROGRESS'; progress = result; QueryStats 'POINTS'; points = result; Output( BOLD('[Shuffle]') ' level available: 'levelavail' of 'leveltotal', level solved: 'levelsolved' of 'leveltotal', total times played: 'totalplayed', total times solved: 'totalsolved', solve ratio: 'solveratio', total number of slides: 'totalslides', stars: 'stars' ('goldstars' of them gold), points: 'points', game progress: 'progress); END ELSE QueryStats 'NAME' level; name = result; QueryStats 'SOLVED' level; solved = result; QueryStats 'PLAYED' level; played = result; QueryStats 'BESTTIME' level; besttime = result; QueryStats 'SLIDERECORD' level; record = result; OUTPUT( BOLD('[Shuffle, level #'level': 'name']') ' times played: 'played' · times solved: 'solved' · best time: 'besttime' · slide record: 'record); END /* END */ ELSE ACTIONOUTPUT("has Shuffle not running."); END EXIT; /* ---- subs ------------------------------------ */ OUTPUT: ADDRESS /* AMIRC.1 */ "SAY /msg" channel ARG(1) '· http://www.binaryriot.org/shuffle' EXIT; ACTIONOUTPUT: ADDRESS /* AMIRC.1 */ codeone = D2C(1) "say" '/RAW PRIVMSG 'channel' :'codeone'ACTION 'ARG(1)''codeone EXIT; /* * function: BOLD() * description: returns formated text (bold) */ BOLD: RETURN '02'x||arg(1)||'02'x /* * function: SYNTAX * description: triggered on syntax error, prints * error and quits the script */ SYNTAX: ADDRESS VALUE port "ECHO" ERRORTEXT( RC ) "on line" SIGL EXIT