PC Help And Information Easy Maintenance And Free Software
 
HomePortalFAQSearchRegisterLog in

Share | 
 

 Remote Trivia Off and On : By Mr Darn

View previous topic View next topic Go down 
AuthorMessage
Steve™
Management

Management
avatar

Male
Number of posts : 2447
Home : At Home
Humor : If Im Not Back Later... Wait Longer
Registration date : 2007-07-30

PostSubject: Remote Trivia Off and On : By Mr Darn   Sat Apr 19, 2008 12:23 pm

Remotely turn the trivia off or on as needed, i have tested this and it works well,

Thank You Mr Darn.

MrDarn™ wrote:
Since your using the same bot to run the command as the trivia, the one stumbling block i overlooked was how metis would know if it was already running trivia or not.

Since the first command it recieves is to turn the trivia on, we can use this to write a variable that it looks for to see the status.

i have not tested this, but off the top of my head, and from what i know of metis scripting, something like this should work:
Code:

<config>
<command type="script">
<in>!trivia on</in>
<out type="goto" extdata="3" condition="0" lvalue="on" rvalue="$trivia status$"></out>
<out condition="1" lvalue="on" rvalue="$trivia status$">Trivia is Currently Running please use the off command to stop trivia.</out>
<out type="break"/>
<out>Starting Trivia, Please wait.....</out>
<out type="push" extdata="trivia status">on</out>
<out>/mxc trivia</out>
<out delay="3000">Trivia Started!</out>
</command>

<command type="script">
<in>!trivia off</in>
<out type="goto" extdata="3" condition="1" lvalue="on" rvalue="$trivia status$"></out>
<out condition="1" lvalue="on" rvalue="$trivia status$">Trivia is NOT currently Running please use the on command to start trivia.</out>
<out type="break"/>
<out>Stopping Trivia, Please wait.....</out>
<out type="push" extdata="trivia status">off</out>
<out>/mxc trivia</out>
<out delay="3000">Trivia Stopped! Thankyou For Playing!</out>
</command>
</config>

basically, since when you first start metis up, no variables have been wrote too, you cant check for an 'off' status, so you use the condition "0" to check that the variable does NOT contain 'on'. if this variable is empty, or does not exist (as it wont during the first activation) it will bypass the 'currently running' warning and go on to start trivia, then write 'on' to the variable.

trying to turn it on when its on will result in the 'game in progress' part, and a break in the script, NOT activating the rest of the command.

the off is exactly the same, except it only runs if the variable DOES contain 'on', breaking the script with a warning message if its off.

see the way i'm thinking?

Any questions, as always, you know where i am!

(oh, and this WAS off the top of my head, but may be based on a working script i may have seen ages ago. Obviusly this could be condenced into a much smaller script, incorperating both at once, but since i no longer have winmx or metis, i cant test it, and doing it from memory would almost certainly reveal a mistake or two ;) )





Last edited by Max™ on Sat Feb 27, 2010 12:21 am; edited 3 times in total (Reason for editing : changes)
Back to top Go down
http://maxtech.youneed.us
MrDarn™
Moderator

Moderator
avatar

Male
Number of posts : 299
Home : At My PC
Humor : Dry/Sarcastic
Registration date : 2007-09-27

PostSubject: Re: Remote Trivia Off and On : By Mr Darn   Sun Apr 20, 2008 8:49 am

only thing with this script is, if you type trivia off when its off, it will switch it on, but say its off :0

been a while since i used metis trivia (or metis in general!) but i think this could be improved slightly by adding some sort of condition that will look for the status of metis trivia at the time...
Back to top Go down
http://www.mrdarn.co.uk
Steve™
Management

Management
avatar

Male
Number of posts : 2447
Home : At Home
Humor : If Im Not Back Later... Wait Longer
Registration date : 2007-07-30

PostSubject: Re: Remote Trivia Off and On : By Mr Darn   Sun Apr 20, 2008 12:06 pm

thanks Mr Darn, you are quite right, i overlooked that fact, i'll have to rethink that one



Back to top Go down
http://maxtech.youneed.us
MrDarn™
Moderator

Moderator
avatar

Male
Number of posts : 299
Home : At My PC
Humor : Dry/Sarcastic
Registration date : 2007-09-27

PostSubject: Re: Remote Trivia Off and On : By Mr Darn   Tue Apr 22, 2008 12:00 pm

Still a good script tho... many people dont know it can be done remotly
Back to top Go down
http://www.mrdarn.co.uk
Steve™
Management

Management
avatar

Male
Number of posts : 2447
Home : At Home
Humor : If Im Not Back Later... Wait Longer
Registration date : 2007-07-30

PostSubject: Re: Remote Trivia Off and On : By Mr Darn   Sun May 25, 2008 12:28 pm

i been thinking, and im not sure adding a comdition will work, it would need to be on the start as well as the stop, or starting twice is same as stopping twice,

hmm still thinking.



Back to top Go down
http://maxtech.youneed.us
MrDarn™
Moderator

Moderator
avatar

Male
Number of posts : 299
Home : At My PC
Humor : Dry/Sarcastic
Registration date : 2007-09-27

PostSubject: Re: Remote Trivia Off and On : By Mr Darn   Mon May 26, 2008 10:13 am

Since your using the same bot to run the command as the trivia, the one stumbling block i overlooked was how metis would know if it was already running trivia or not.

Since the first command it recieves is to turn the trivia on, we can use this to write a variable that it looks for to see the status.

i have not tested this, but off the top of my head, and from what i know of metis scripting, something like this should work:
Code:

<config>
<command type="script">
<in>!trivia on</in>
<out type="goto" extdata="3" condition="0" lvalue="on" rvalue="$trivia status$"></out>
<out condition="1" lvalue="on" rvalue="$trivia status$">Trivia is Currently Running please use the off command to stop trivia.</out>
<out type="break"/>
<out>Starting Trivia, Please wait.....</out>
<out type="push" extdata="trivia status">on</out>
<out>/mxc trivia</out>
<out delay="3000">Trivia Started!</out>
</command>

<command type="script">
<in>!trivia off</in>
<out type="goto" extdata="3" condition="1" lvalue="on" rvalue="$trivia status$"></out>
<out condition="1" lvalue="on" rvalue="$trivia status$">Trivia is NOT currently Running please use the on command to start trivia.</out>
<out type="break"/>
<out>Stopping Trivia, Please wait.....</out>
<out type="push" extdata="trivia status">off</out>
<out>/mxc trivia</out>
<out delay="3000">Trivia Stopped! Thankyou For Playing!</out>
</command>
</config>

basically, since when you first start metis up, no variables have been wrote too, you cant check for an 'off' status, so you use the condition "0" to check that the variable does NOT contain 'on'. if this variable is empty, or does not exist (as it wont during the first activation) it will bypass the 'currently running' warning and go on to start trivia, then write 'on' to the variable.

trying to turn it on when its on will result in the 'game in progress' part, and a break in the script, NOT activating the rest of the command.

the off is exactly the same, except it only runs if the variable DOES contain 'on', breaking the script with a warning message if its off.

see the way i'm thinking?

Any questions, as always, you know where i am!

(oh, and this WAS off the top of my head, but may be based on a working script i may have seen ages ago. Obviusly this could be condenced into a much smaller script, incorperating both at once, but since i no longer have winmx or metis, i cant test it, and doing it from memory would almost certainly reveal a mistake or two Wink )
Back to top Go down
http://www.mrdarn.co.uk
Sponsored content




PostSubject: Re: Remote Trivia Off and On : By Mr Darn   

Back to top Go down
 
Remote Trivia Off and On : By Mr Darn
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Selenium Remote Control misbehaves
» How to disable Remote Control page popping up?
» Eiffel Tower Restaurant Trivia Contest
» Costa Sunglasses Trivia Sweeps *usa only*
» Negative Testing with Selenium JUnit 4 Remote Control and Eclipse

Permissions in this forum:You cannot reply to topics in this forum
MaxTech ::  The World Of WinMX Chat :: Metis Working Scripts Centre-
Jump to: