Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ About variable in the DoAfter .
About variable in the DoAfter .
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Leera2008
(9 posts) Bio
|
Date
| Fri 18 Jun 2004 04:37 AM (UTC) |
Message
| my trigger like these:
exe = int(kee - max_kee/2-800)
world.note exe
world.doafter 4, "exercise exe"
cant execute right.
How to send the variable in "DoAfter"£¿ | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 18 Jun 2004 05:49 AM (UTC) |
Message
| Concatenate them together, like this:
exe = int(kee - max_kee/2-800)
world.doafter 4, "exercise " & exe
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Leera2008
(9 posts) Bio
|
Date
| Reply #2 on Fri 18 Jun 2004 06:09 AM (UTC) |
Message
| Thank You.
So earlier U get up?
*admire
and I fell the variable in the mushclient and the variable in Scripts are 2 kinds of things. right?
Variable "A" in mushclient and variable "A" in the script are not equal, right? | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Fri 18 Jun 2004 06:16 AM (UTC) |
Message
| yes, one is only in the script, and it goes away if you reload the script, or restart Mushclient. Also, if you CREATE it inside of a sub, it only sticks around for as long as the sub.
Mushclient variables stick around in your world file.
However, you can use
world.getvariable ("variable")
and
world.setvariable "variable", "value"
to get and set mushclient variables so you can use them in scripts, and then store them for later usage.
|
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #4 on Fri 18 Jun 2004 06:39 AM (UTC) |
Message
|
Quote:
So earlier U get up?
*admire
Well, as I live in Australia, it is around 4 pm. So, I got up quite a while ago. :) |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Leera2008
(9 posts) Bio
|
Date
| Reply #5 on Fri 18 Jun 2004 11:07 AM (UTC) |
Message
| hehe.
Many Questions I have .(sorry)
foods = world.getvariable("foods")
I want this line happen at 1 second later .
How to put this line in DoAfterSpecial?
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #6 on Fri 18 Jun 2004 09:40 PM (UTC) |
Message
| It sounds a strange thing to want to do, but to do it you would:
DoAfterSpecial 1, "foods = world.getvariable(""foods"")", 12
That sends that command to "script" which executes it as a script.
However I'm doubtful why you would do that, perhaps you should explain the reason for it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Leera2008
(9 posts) Bio
|
Date
| Reply #7 on Sat 19 Jun 2004 01:34 AM (UTC) Amended on Sat 19 Jun 2004 01:36 AM (UTC) by Leera2008
|
Message
| :)
I m doing a Auto Recover robot.
1."hp " get the varibles from a mutiline trigger.
2. Wait some second until hp trigger get right variables
3. Do recover according to the variables just get.
If there is no the 2nd step "wait some second", the 3th step will execute at once after the 1st step which use the variables got last time . | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #8 on Sat 19 Jun 2004 02:27 AM (UTC) |
Message
| Yes, but all that does is move a MUSHclient variable into a script variable. It doesn't do anything really useful.
This business of waiting a few seconds is a bit unreliable, what if the trigger fires after 1 second? After 10 seconds?
You are better having the trigger (which matches on the HP) doing itself what needs to be done, not putting something into a variable and testing the variable 5 seconds later. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
22,118 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top