[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]  if then else or do/while needed in alias

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: if then else or do/while needed in alias
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Shadowfyr   USA  (1,774 posts)  [Biography] bio
Date Fri 13 Jan 2006 04:36 PM (UTC)  quote  ]
Message
You need to use something like:

for w = 1 to %1
world.DoAfterSpecial 10 + w, "inscribe blank with %2",0
next

That would space each draw appart by one second, i.e. 10, 11, 12 and so on. The problem is that you are not telling it with your orginal:

wait for ten seconds, then do ...
wait for 20 seconds, then do ...
etc.

But rather:

wait for ten second, then do ...
wait for ten second + .00000001 seconds, then do ...
etc.

Where the .00000001 is how ever long it takes for the loop itself to execute. It doesn't queue commands with a 10 second delay "between" them, it creates %1 timers, each "exactly" 10 seconds in length.

main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
[Go to top] top

Posted by Babochka   USA  (21 posts)  [Biography] bio
Date Fri 13 Jan 2006 09:10 AM (UTC)  quote  ]
Message
Ok I've been experimenting with looping and I think I almost have it:

<alias
match="draw * *"
enabled="y"
echo_alias="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>for w = 1 to %1
world.DoAfterSpecial 10, "inscribe blank with %2",0
next</send>
</alias>

The problems is that the alias pauses for 10 seconds, then loops quickly. for example if I type draw 3 priestess, it pauses for 10 seconds then sends 3 inscribe blank with priestess so rapidly, no card get drawn.

How can I slow down the program?
[Go to top] top

Posted by Babochka   USA  (21 posts)  [Biography] bio
Date Fri 13 Jan 2006 07:39 AM (UTC)  quote  ]
Message
ok I re-read the help files and I'm rying to understand this, so bear with me.

What I want to do is draw more than one tarot card at a time. I couldnt do it, so I decided to create an alias which will draw cards in groups of 3.

I have the alias name draw.

draw *
the * is the tarot card name

then i will have a script called by the alias draw

sub drawmany (name, line, wildcards)
for w=1 to 3
inscribe blank with %1
nest
end sub

My question is how to do pass the tarot name variable to the script. and how do i call the script correctly?

Thanks in advance.

[Go to top] top

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Wed 11 Jan 2006 02:21 AM (UTC)  quote  ]
Message
The MUSHclient help is not supposed to teach VBscript. There are help files that do that. However there are examples inside the file exampscript.vbs that comes with MUSHclient.

This page lists where you can get the VBscript help files:

http://www.gammon.com.au/scripts/forum.php?bbtopic_id=2

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Babochka   USA  (21 posts)  [Biography] bio
Date Wed 11 Jan 2006 01:38 AM (UTC)  quote  ]
Message
To Life Immortal

Could someone show me an example of looping in VB Script?

How do I create a FOR-NEXT or FOR-WHILE LOOP?

How do I create a IF-THEN-ELSE?

I need the syntax for these commands and I can not find an example in the MUSHclient help.

Thanks.
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Sat 07 Jan 2006 04:18 PM (UTC)  quote  ]
Message
Well saddly I cant find the one i had done but uh. here the topic... http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4099

Everything turns around in the end
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Sat 07 Jan 2006 03:51 PM (UTC)  quote  ]
Message
I've written a tarot inscribing script once for achaea with Nick's help. If you give me till later today I'll go get it and show you what I did.

Everything turns around in the end
[Go to top] top

Posted by Babochka   USA  (21 posts)  [Biography] bio
Date Fri 06 Jan 2006 09:23 PM (UTC)  quote  ]
Message
To Life Immortal

Hello I have an occultist character on Achaea. Sometimes he needs to inscribe multiples of a tarot card. I created an alias to draw a single card:

<alias
match="draw *"
enabled="y"
echo_alias="y"
group="tarot"
sequence="100"
>
<send>inscribe blank with %1</send>
</alias>

I want to have an alias which uses either a if/then/else or a do/while so i may create multiples of a card. If there anyway I could create a variable as a counter, and that counter decreases by 1 every time it loops?

Thanks in advance.

2006 will ROCK!
[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.


7,704 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[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]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]