Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Mon Nov 17, 2003 9:38 pm   

OnOff Switch
 
This very small but it can turn Help you to turn On and Off all kinds of things.

new=0
#if @new=0 {new=1} {new=0}

You can use it in trigs or buttons or menu or Etc......
Examples of use:

Want to turn on and off classes
class {help}
#if @new=0 {#t- help;new=1} {#t+ help;new=0}

triggers
#trig {someone says (*)} {#win new {%1}}
id your trigger window
#menu Say {#if @new=0 {#T- window;#close Says;new=1} {#t+ window;#win Says;new=0}

I use it mostly for menu items for diffent programs so i don't have to turn on and off class;buttons;triggers manually
Reply with quote
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Thu Jul 15, 2004 4:33 am   
 
An easier one that will turn your triggers on and off with out using a varable.
#trig (#if (%class( drop)=1) {#t- drop} {#t+ drop}}
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sat Jul 17, 2004 5:59 pm   
 
Phanku, What?
A Trig cannot be used as you stated and will only serv to confuse people.
please do not leave posts with bad information and poorly writen trig's.

Most importantly take time to read the post.
My trig example is just one of many ways my on-off switch can work, to date I have found over 3 dovens uses ranging from macros to buttons and even keys. I incorporate this into almost all of my scripts if you need furter exampls of it,s use.

The correct way of using this whould be
#trig {put your trig here} {(#if (%class(drop)=1) {#t- drop} {#t+ drop}}
Where "drop" is the name of a class or trig you want to turn on or off.

This does not work for macros, buttons, keys, vars, guages.
Refer to my above example for those.
_________________
megamog75 Smile
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment. Raistlin Majere
Reply with quote
worlo
Newbie


Joined: 20 Jul 2004
Posts: 8

PostPosted: Tue Jul 20, 2004 8:35 am   
 
I use that kind of system to enable and disable sets of triggers all the time. An example that may clarify this type of system:
I have an alias called ratter that checks if it's on, if on turn of else turn on. Triggers is a subclass containing all triggers.
Code:

#IF {@ratter} {
  #ECHO Ratter has been turned off
  ratter=0
  #T- triggers} {
  #ECHO Ratter has been turned on *grin*
  ratter=1
  #T+ triggers}


In the if statement I just put @ratter not @ratter=1 because I think that looks cleaner, so I would do the first example as follows:

Code:

#if @new {new=0} {new=1}


a subtle difference I know but I think it makes it just a little bit more logical, if you want to test if @new is false i would put it like

Code:

#if {not @new} {new=0} {new=1}


Anyway nice way to put things on and off
Reply with quote
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Fri Jul 23, 2004 4:41 pm   correction
 
Yes i know i made a mistake on the syntax when i was writing it out. I also know this is only for turning on and off class and or id's or things related to it. The coding was wrong, I will admit it, but the idea is solid. I only use this for 5 aliases, 4 macros, 3 buttons and a few other things. So telling me it won't work was the biggest insalt.

So try this, make a folder named test

then put this in your command bar and hit enter, then type test...see what happens..

#alias {test} {#if (%class(test)) {#t- test;#echo off} {#t+ test;#echo on}}

hmm that would be in an alias I believe.. next lets do macros

#key {F12} {#if (%class(test)) {#t- test;#echo off} {#t+ test;#echo on}}

that would be a macro. press f12

#bu {Test} {#if (%class(test)) {#t- test;#echo off} {#t+ test;#echo on}}

I think this would be a button. And finally

#trigger {hi} {#if (%class(test)) {#t- test;#echo off} {#t+ test;#echo on}}

There is your trigger.

So I believe that I have done it, I think a trigger can be used this way.
Thank you
Reply with quote
worlo
Newbie


Joined: 20 Jul 2004
Posts: 8

PostPosted: Fri Jul 23, 2004 4:56 pm   
 
Nice, that saves me another variable. Thanks
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Aug 05, 2004 12:04 am   
 
Phanku, I am done arguing semantics with you, you are still only shutting on and off a CLASS.
Your just incorporating it with buttons and macro's.

I agree that the:
#if (%class(test)) {#t- test;#echo off} {#t+ test;#echo on}
Is a good way to do some things.

I just find that I can manipulate this on off switch with other things that have id's
that string you wrote will ONLY work with a CLASS

Sorry if I was a bit rude in the other post, it's just that I give this idea freely to others to learn and then to have someone come and say it is not as good a a simple CLASS #if string, was just a bit to much for me.

Now if you need any further assistance or if you are still finding it hard to grasp this concept please post back, If not Please remember that this is not a group discussion and a place for putting down FINISHED scripts, thank you. JOE
_________________
megamog75 Smile
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment. Raistlin Majere
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net