Actionscript Name: News Changer
Author: flattspott - edited by LarryX
Version: 3.1
Purpose: Allows user to change newsfeed on the xbox
Instructions: Included in the script file
For Q&A's about this script visit this thread: NewsChanger
NewsFeeds.xml is the same as Version:3 above
This version is still not compatable with 0.9n.6
Save As - NewsChanger.xas
CODE |
;########################################################### ;# Name: News Changer ;# Author: flattspott - edited by LarryX ;# Date: 03-11-2004 ;# Version: 3.1 ;# FileName: NewsChanger.xas ;# ;# Purpose: ;# Allows you to change your current newsfeed to any one of ;# almost 50 predfined ones. ;# ;# Installation: ;# Upload both, the NewsChanger.xas file and the NewsFeeds.xml files ;# to your Xbox,(Both files should go into your scripts folder) ;# then add something like this somewhere in your Menu.xml. ;# $ActualPath$ is where MXM starts from. ;# ;# Change Log 03-11-2004: ;# you can now edit NewsFeeds.xml to add or subtract as you like ;# included newsfeedname in mxm.xml for skinners ;# ;# ;# NewsChanger ;# Callfile $ActualPath$\Scripts\NewsChanger.xas ;# ;############################################################ ;---------------- Check if NewsFeeds.xml Exist Start -------- SETFUNC FeedXML FILEEXISTS $ActualPath$\Scripts\NewsFeeds.xml IF# %FeedXML% == "0" GOTO ERROR ;---------------- Check if NewsFeeds.xml Exist End ---------- ;---------------- XML Loading Start --------------------- SET index 1 SET indexa 1 SET indexb 0 XMLOPEN NewsXML $ActualPath$\Scripts\NewsFeeds.xml XMLSetNodePtr NewsXML !.NewsList XMLGetNodeCount NewsXML totalcount XMLSetNodePtr NewsXML !.NewsList.Feed :STARTLOOP IF# %Indexa% > %totalcount% GOTO ENDLOOP XMLGetValue NewsXML FeedName%indexa% !.NewsList.Feed:%indexb%.Name XMLGetValue NewsXML FeedURL%indexa% !.NewsList.Feed:%indexb.URL ADD indexa 1 ADD indexb 1 GOTO STARTLOOP :ENDLOOP XMLClose NewsXML GOTO DISPLAY ;---------------- XML Loading End ----------------------- ;---------------- Message Output Start ------------------ :ERROR CallScript _DisplayMessageBox "NewsFeeds.xml not found, unable to proceed" GOTO DONE :DISPLAY BeginDraw UseCurrent MessageBox "Name: %FeedName{index}%$eol$NewsFeed # %index%$eol$ (A) to Save (B) to Exit (White) for Help " GOTO GETINPUT :RESULTS CallScript _RenderMessageBox "Newsfeed Changed to: $eol$ %FeedName{index}% $eol$ Changes will occur after rebooting" EndDraw DELAYMS 1500 GOTO DONE :HELP MsgBox "::DEFAULT GAMEPAD CONTROLS::$eol$Up or Right - moves forward 1 feed$eol$Down or Left - moves back 1 feed$eol$RTrig + Up or Right - moves forward 5 feeds$eol$RTrig + Down or Left - moves back 5 feeds$eol$A - saves the current feed$eol$B - exits out of NewsChanger$eol$White - displays this help screen" RETURN ;---------------- Message Output End -------------------- ;---------------- Gamepad Input Start ------------------- :GETINPUT IQWaitMsg UI_LF UI_UP UI_DN UI_RT UI_SELECT UI_BACK SYS_HELP SYS_GAMEHELP KEY_LF KEY_RT KEY_UP KEY_DN If %MSG_ID% == "UI_LF" GOTO BACKFEED If %MSG_ID% == "UI_DN" GOTO BACKFEED If %MSG_ID% == "UI_UP" GOTO NEXTFEED If %MSG_ID% == "UI_RT" GOTO NEXTFEED If %MSG_ID% == "KEY_LF" GOTO BACK5 If %MSG_ID% == "KEY_RT" GOTO NEXT5 IF %MSG_ID% == "KEY_DN" GOTO BACK5 IF %MSG_ID% == "KEY_UP" GOTO NEXT5 If %MSG_ID% == "UI_SELECT" GOTO CHANGEFEED If %MSG_ID% == "UI_BACK" GOTO DONE If %MSG_ID% == "SYS_HELP" GOTO HELP GOTO GETINPUT ;---------------- Gamepad Input End --------------------- ;---------------- Next Feed Start ----------------------- :NEXTFEED IF# %index% == "49" THEN SET index 1 ELSE ADD index 1 ENDIF GOTO DISPLAY ;---------------- Next Feed End ------------------------- ;---------------- Back Feed Start ----------------------- :BACKFEED IF# %index% == "1" THEN SET index 49 ELSE SUB index 1 ENDIF GOTO DISPLAY ;---------------- Back Feed End ------------------------- ;---------------- Next 5 Feeds Start ----------------------- :NEXT5 IF# %index% >= "45" THEN SET index 4 ELSE ADD index 5 ENDIF GOTO DISPLAY ;---------------- Next 5 Feeds End ------------------------- ;---------------- Back 5 Feeds Start ----------------------- :BACK5 IF# %index% <= "4" THEN SET index 48 ELSE SUB index 5 ENDIF GOTO DISPLAY ;---------------- Back 5 Feeds End ------------------------- ;---------------- Save Start ---------------------------- :CHANGEFEED XMLOPEN mxmXML ::MXM XMLGetValue mxmXML mxmnewsname !.Newsfeed.Name IF "%mxmnewsname%" != "" GOTO CONTINUE IF "%mxmnewsname" == "" GOTO CREATENODE :CONTINUE XMLSetNodePtr mxmXML !.Newsfeed XMLSetNodePtr mxmXML !.Newsfeed.URL XMLSetValue mxmXML !.Newsfeed.URL %FeedURL{index}% XMLSetNodePtr mxmXML !.Newsfeed XMLSetNodePtr mxmXML !.Newsfeed.Name XMLSetValue mxmXML !.Newsfeed.Name %FeedName{index}% XMLSave mxmXML ::MXM XMLClose mxmXML GOTO RESULTS :CREATENODE XMLSetNodePtr mxmXML !.Newsfeed XMLCreateNode mxmXML Name XMLSetValue mxmXML !.Newsfeed.Name "Name" GOTO CONTINUE ;---------------- Save End ------------------------------ :DONE QUIT
|
This post has been edited by LarryX: Mar 12 2004, 11:37 PM <