gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
76793 Posts in 13502 Topics by 1651 Members - Latest Member: Arnold99 November 23, 2024, 02:57:06 pm
*
gfx*gfx
gfx
WinMX World :: Forum  |  Metis Scripts and Help  |  Other Metis scripts  |  Trivia Loader by KiLo
gfx
gfxgfx
 

Author Topic: Trivia Loader by KiLo  (Read 3465 times)

0 Members and 1 Guest are viewing this topic.

Offline reef

  • WMW Volunteer
  • *****
  • ***
Trivia Loader by KiLo
« on: February 13, 2008, 08:08:59 pm »
Trivia Loader by KiLo

Quote
This is an improvment on a trivia loader made a while back. You need to make a file called LoadTrivia.xml in your plugins directory, in it includes to all your trivia packs, also lacated in the base plugin directory. They must all be on a separate line, exactly as shown below.

LoadTrivia.xml:
Code: [Select]
<config>
<include file="simpsons.xml"/>
<include file="startrek.xml"/>
<include file="TV.xml"/>
<include file="vidgame.xml"/>
<include file="worldcurrency.xml"/>
</config>

Quote
In your MXC.xml, include the LoadTrivia.xml:

Code: [Select]
<include file="LoadTrivia.xml"/>
Quote
Add this to your MXC.xml (change the directories where neccessary):

Code: [Select]
<command type="script" mode="thread">
<in>!listtrivia</in>
<out type="push" extdata="LineNum">1</out>
<out type="push" extdata="TrivNum">0</out>
<out type="push" extdata="TEMP"><operator type="readfile" nvalue="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" lvalue="l" rvalue="$LineNum$"/></out>
<out type="goto" extdata="12" condition="==" lvalue="$TEMP$" rvalue=""></out>
<out type="push" extdata="LineNum"><operator type="++" lvalue="$LineNum$"/></out>
<out type="goto" extdata="-3" condition="!_?" lvalue="$TEMP$" rvalue="<include"></out>
<out type="push" extdata="Loaded" condition="?" lvalue="$TEMP$" rvalue="<!--">#c58#(Not Loaded)</out>
<out type="push" extdata="Loaded" condition="!?" lvalue="$TEMP$" rvalue="<!--">#c68#(Loaded)</out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue="<!--"/></out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue="-->"/></out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue='<include file="'/></out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue='.xml"/>'/></out>
<out type="push" extdata="TrivNum"><operator type="++" lvalue="$TrivNum$"/></out>
<out>$TrivNum$] $TEMP$ $Loaded$</out>
<out type="goto" extdata="-12"></out>
<out condition="!=" lvalue="$TrivNum$" rvalue="0">Commands: !unloadtrivia # | !loadtrivia # (To [Un]load multiple packs, make seperate commands)</out>
<out condition="==" lvalue="$TrivNum$" rvalue="0">Error: No Trivia Added To Script</out>
</command>

<command type="script" mode="thread">
<in>!loadtrivia%PARAM%</in>
<out type="push" extdata="TrivToLoad"><operator type="strrem" lvalue="%PARAM%" rvalue=" "/></out>
<out>Loading $TrivToLoad$...</out>
<out type="push" extdata="LineNum">1</out>
<out type="push" extdata="TrivNum">0</out>
<out type="push" extdata="TrivName"></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" mode="t"></out>
<out type="push" extdata="TEMP"><operator type="readfile" nvalue="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" lvalue="l" rvalue="$LineNum$"/></out>
<out type="goto" extdata="15" condition="_?" lvalue="$TEMP$" rvalue="</config>"></out>
<out type="push" extdata="LineNum"><operator type="++" lvalue="$LineNum$"/></out>
<out type="goto" extdata="-3" condition="_?" lvalue="$TEMP$" rvalue="<config>"></out>
<out type="push" extdata="TrivNum"><operator type="++" lvalue="$TrivNum$"/></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" mode="a"condition="!=" lvalue="$TrivToLoad$" rvalue="$TrivNum$">$TEMP$\n</out>
<out type="goto" extdata="-6"condition="!=" lvalue="$TrivToLoad$" rvalue="$TrivNum$"></out>
<out condition="!?" lvalue="$TEMP$" rvalue="<!--">Error: Already Loaded</out>
<out type="break" condition="!?" lvalue="$TEMP$" rvalue="<!--"></out>
<out type="push" extdata="TEMP"><operator type="strrep" nvalue="$TEMP$" rvalue="<include" lvalue="<!--<include"/></out>
<out type="push" extdata="TEMP"><operator type="strrep" nvalue="$TEMP$" rvalue='"/>' lvalue='"/>-->'/></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" mode="a">$TEMP$\n</out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue='<include file="'/></out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue='.xml"/>'/></out>
<out type="push" extdata="TrivName">$TEMP$</out>
<out type="goto" extdata="-15"></out>
<out condition="==" lvalue="$TrivName$" rvalue="">Invalid Trivia Number</out>
<out type="break" condition="==" lvalue="$TrivName$" rvalue=""></out>
<out type="push" extdata="LineNum">1</out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" mode="t">&lt;config&gt;\n</out>
<out type="push" extdata="TEMP"><operator type="readfile" nvalue="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" lvalue="l" rvalue="$LineNum$"/></out>
<out type="goto" extdata="4" condition="==" lvalue="$TEMP$" rvalue=""></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" mode="a">$TEMP$\n</out>
<out type="push" extdata="LineNum"><operator type="++" lvalue="$LineNum$"/></out>
<out type="goto" extdata="-4"></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" mode="a">&lt;/config&gt;\n</out>
<out>Loaded $TrivName$</out>
<out type="control">/mxc load</out>
</command>

<command type="script" mode="thread">
<in>!unloadtrivia%PARAM%</in>
<out type="push" extdata="TrivToUnLoad"><operator type="strrem" lvalue="%PARAM%" rvalue=" "/></out>
<out>UnLoading $TrivToUnLoad$...</out>
<out type="push" extdata="LineNum">1</out>
<out type="push" extdata="TrivNum">0</out>
<out type="push" extdata="TrivName"></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" mode="t"></out>
<out type="push" extdata="TEMP"><operator type="readfile" nvalue="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" lvalue="l" rvalue="$LineNum$"/></out>
<out type="goto" extdata="15" condition="_?" lvalue="$TEMP$" rvalue="</config>"></out>
<out type="push" extdata="LineNum"><operator type="++" lvalue="$LineNum$"/></out>
<out type="goto" extdata="-3" condition="_?" lvalue="$TEMP$" rvalue="<config>"></out>
<out type="push" extdata="TrivNum"><operator type="++" lvalue="$TrivNum$"/></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" mode="a"condition="!=" lvalue="$TrivToUnLoad$" rvalue="$TrivNum$">$TEMP$\n</out>
<out type="goto" extdata="-6"condition="!=" lvalue="$TrivToUnLoad$" rvalue="$TrivNum$"></out>
<out condition="?" lvalue="$TEMP$" rvalue="<!--">Error: Already UnLoaded</out>
<out type="break" condition="?" lvalue="$TEMP$" rvalue="<!--"></out>
<out type="push" extdata="TEMP"><operator type="strrep" nvalue="$TEMP$" lvalue="<include" rvalue="<!--<include"/></out>
<out type="push" extdata="TEMP"><operator type="strrep" nvalue="$TEMP$" lvalue='"/>' rvalue='"/>-->'/></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" mode="a">$TEMP$\n</out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue='<!--<include file="'/></out>
<out type="push" extdata="TEMP"><operator type="strrem" lvalue="$TEMP$" rvalue='.xml"/>-->'/></out>
<out type="push" extdata="TrivName">$TEMP$</out>
<out type="goto" extdata="-15"></out>
<out condition="==" lvalue="$TrivName$" rvalue="">Invalid Trivia Number</out>
<out type="break" condition="==" lvalue="$TrivName$" rvalue=""></out>
<out type="push" extdata="LineNum">1</out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" mode="t">&lt;config&gt;\n</out>
<out type="push" extdata="TEMP"><operator type="readfile" nvalue="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.tmp" lvalue="l" rvalue="$LineNum$"/></out>
<out type="goto" extdata="4" condition="==" lvalue="$TEMP$" rvalue=""></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" mode="a">$TEMP$\n</out>
<out type="push" extdata="LineNum"><operator type="++" lvalue="$LineNum$"/></out>
<out type="goto" extdata="-4"></out>
<out type="file" extdata="C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml" mode="a">&lt;/config&gt;\n</out>
<out>UnLoaded $TrivName$</out>
<out type="control">/mxc load</out>
</command>

Quote
Commands are:
!listtrivia
!loadtrivia # (# is the number off the load trivia list)
!unloadtrivia # (# same as above)

Offline macleod

  • Forum Member
Re: Trivia Loader by KiLo
« Reply #1 on: February 14, 2008, 05:20:52 am »
ty works like a charm 

one note to this script it will not run in metis 2.8   1.6.0.168   says they is no trivia loaded prolly just a bug but i thought i would post it.

thanks guys for the script.

Offline macleod

  • Forum Member
Re: Trivia Loader by KiLo
« Reply #2 on: February 14, 2008, 09:21:03 am »
question would it be posible to make a scrip to tally the scores for the trivia and maybe posible to set a random score to win the game just an idea

Offline Røçkåfë££ë® §kåñK

  • WANABE WINMX CHAT SERVER HACKER
  • Forum Member
    • The Rebelion
Re: Trivia Loader by KiLo
« Reply #3 on: February 15, 2008, 12:24:44 pm »
perhaps the directories have not been changed?
Quote
C:\Program Files\Metis 2.6\Add-Ons\LoadTrivia.xml
[ìíÍIí¯Iì·´¯ìÍ]Íì•íÌí¯`·íI¯ìIÌì í]¡í¯ìIÎ Røçkåfë££ë® §kåñK ÎIí¯ì¡[ì íÍIí¯Iì·´¯ìÍì•íÌ[Ìí¯`·íI¯ìIÌìí]

WinMX World :: Forum  |  Metis Scripts and Help  |  Other Metis scripts  |  Trivia Loader by KiLo
 

gfxgfx
gfx
©2005-2024 WinMXWorld.com. All Rights Reserved.
SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
Page created in 0.009 seconds with 23 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!