[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  How to stop a script? Help with if_then_else, please
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

How to stop a script? Help with if_then_else, please

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Lucano   (2 posts)  [Biography] bio
Date Tue 31 May 2005 11:20 AM (UTC)  quote  ]
Message
Hello, I need to do the following: When the trigger pops up, I want to check the queue system for all the afflictions. Then, if the system finds an affliction, will eat the herb, but I need to wait for "You may eat another plant" again, so I need to stop to check for the rest of the afflictions. How do I do that?

By the way, I got the trigger to stop the timer that appears.

^You may eat another plant\.$

world.setvariable "eatcan", "1"
if world.getvariable ("confusion") = "1" then
world.setvariable "eatcan", "0"
world.setvariable "eatnow", "ash"
world.enabletimer "eatit", 1
world.execute "outr 1 ash"
world.execute "eat ash"
I NEED TO STOP FURTHER STUFF HERE
[Elseif world.getvariable ("dementia") = "1" then
world.setvariable "eatcan", "0"
world.setvariable "eatnow", "ash"
world.enabletimer "eatit", 1
world.execute "outr 1 ash"
world.execute "eat ash"
I NEED TO STOP FURTHER STUFF HERE
[MORE ELSEIF STUFF LIKE THAT ONE]
end if


Thanks in advance,

Lucano, a complete inept in coding :S
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #1 on Tue 31 May 2005 05:04 PM (UTC)  quote  ]

Amended on Tue 31 May 2005 05:05 PM (UTC) by Larkin

Message
Use EXIT SUB to leave the subroutine when you want to stop further processing.

In the case of this particular function, the if/elseif blocks should take care of what you wanted already. The first thing that evaluates to true will be executed and the rest won't even be tested.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,466 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]