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
➜ VBscript
➜ more vb script help
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Mon 03 May 2010 10:42 PM (UTC) Amended on Tue 04 May 2010 12:07 AM (UTC) by Shou
|
Message
| ok, i have heard, but not too sure about this, that you can start a timer off of a trigger. how would i do this?
another thing is this:
trigger
"You suddenly perceive the vague outline of an aura of rebounding around (whoever)"
send
"world.SetVariable "rebounding", "on" "
this is getting set off each time the message pops up.
is there a way to make the trigger set off when the (whoever) part is my variable @npc?
also (although this one can wait if need be) i need a little help on making a trigger, umm, start a timer after a message goes through the server, then disable it after the timer fires. erm, and i know it is asking alot, but is it possible to make the action carried out by the timer check to see if i have balance or equilibrium? |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 04 May 2010 06:20 AM (UTC) |
Message
|
Shou said:
ok, i have heard, but not too sure about this, that you can start a timer off of a trigger. how would i do this?
Send to script, and in the script see DoAfter, AddTimer and similar.
Shou said:
this is getting set off each time the message pops up.
is there a way to make the trigger set off when the (whoever) part is my variable @npc?
Check "expand variables" and the npc name will be substituted in the trigger match text.
Shou said:
also (although this one can wait if need be) i need a little help on making a trigger, umm, start a timer after a message goes through the server, then disable it after the timer fires. erm, and i know it is asking alot, but is it possible to make the action carried out by the timer check to see if i have balance or equilibrium?
In the trigger, it can disable itself, see EnableTrigger function.
As for balance and equilibrium, you can have other triggers to check for that (eg. from your prompt) so that the first trigger will know if you have them or not (by saving if you have balance, or not, in a variable). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #2 on Tue 04 May 2010 10:40 PM (UTC) |
Message
| wow, thanks alot! |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #3 on Wed 05 May 2010 02:07 AM (UTC) |
Message
| ok, in enable trigger, when it says:
world.EnableTrigger "(whatever", TRUE '
is the (whatever) part of it what the trigger fires off of? like the like "you are hungry" would it be
world.enabletrigger "you are hungry", true' ? |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #4 on Wed 05 May 2010 05:09 AM (UTC) |
Message
| No, it is the trigger name. When editing a trigger you can give it a name (label). That is what you use. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #5 on Wed 05 May 2010 10:31 PM (UTC) |
Message
| oooh, ok. i never knew what label was for so i never put anything in it. thanks again |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #6 on Sun 16 May 2010 02:36 AM (UTC) |
Message
| ok, new problem.
i have set up a trigger. this trigger already had a function to change a variable for me. I used the DoAfterSpecial function with it as a second task. i want it to execute my alias "a", but i cannot seem to get it to work, as of now, i have
world.DoAfterSpecial 2.3, "world.execute "a", 12
what am i doing wrong?
also, how would i make it do different things inside one DAS?
would i need to put the /n? |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #7 on Sun 16 May 2010 05:57 PM (UTC) |
Message
| ok sorry that i have many questions, but i also have many problems, including the one before this, i have a problem with the EvaluateSpeedwalk function.
(im not going to lie here..)
this is what i have
world.note world.EvaluateSpeedwalk ("s(se)n(agree viannos)s(nw)2n(ne)e(drop ladder)(take pomegranate)(take pomegranate)(take pomegranate)e(sw)2s(se)n(give pomegranate to viannos)(give pomegranate to viannos)(give pomegranate to viannos)s(nw)nd")
whenever i try to fire it, it gives me
*Invalid direction "r" in speedwalk, must be N, S, E, W, U, D, F, or (something)
i don't know where it is finding "r" in there, other than inside the (agree viannos) and (take pomegranate) among other (somethings)
i am sending this to Speedwalk, with only enable checked off. |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #8 on Mon 17 May 2010 12:40 AM (UTC) |
Message
| That is a script, not a speedwalk. In the first word "world" it is accepting "w" for west, "o" for open, and then objects to "r".
Change it to "send to script". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #9 on Mon 17 May 2010 12:45 AM (UTC) |
Message
|
Shou said:
world.DoAfterSpecial 2.3, "world.execute "a", 12
what am i doing wrong?
You have quotes within quotes there (that is, only three quotes - you aren't closing the quote for "world.execute").
Anyway, it would be simpler to send to execute, rather than doing world.execute. That is:
DoAfterSpecial 2.3, "a", 10
That re-evaluates "a" as a command (so it will pick up the alias "a").
To do multiple things you could probably add line breaks with vbCrLf, or just call a script and in the script do multiple things. eg.
DoAfterSpecial 2.3, "Call myfunc", 12
And in your script file have:
Function myfunc ()
Send "say hello"
Send "say my friend"
End Function
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #10 on Mon 17 May 2010 04:13 AM (UTC) |
Message
| ok, wow. i am sorry to have wasted your time, but i seem to have misunderstood what the Evaluatespeedwalk function does. i am looking for something that will actually DO the speedwalk, not just show me what it is, would this be DoAfter(special?)Speedwalk, or something else entirely.
oh, and the send to script made it work though, thanks for that! |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #11 on Mon 17 May 2010 05:56 AM (UTC) |
Message
| In that case just put the speedwalk there (not the EvaluateSpeedwalk or the quotes) - just the raw speedwalk. Then change it to "send to speedwalk". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #12 on Mon 17 May 2010 05:59 AM (UTC) |
Message
| As for pausing, you are probably better off using Lua rather than VBscript (they are fairly similar for beginners) and then see this post:
That lets you send things, pause, send other things, loop, etc. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Shou
USA (30 posts) Bio
|
Date
| Reply #13 on Sat 22 May 2010 04:17 AM (UTC) |
Message
| ok first of all, i would like to say thank you Nick for all the help you have given me.
i have decided to stay with VBscript for now.
the problem this time, is that if my target has a really long name, i would like to be able to make it recognize what i have as my @npc+ letters or not.
an example would be something like :
npc= diak
trigger: diaktoros touches a small tree.
what i have @npc touches a small tree.
what would i put after @npc to recognize the 'toros' but still work if there is nothing after my @npc? |
My computer once beat me at chess, but it was no match for me at kickboxing. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #14 on Sat 22 May 2010 04:53 AM (UTC) |
Message
|
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="@npc* touches a small tree."
send_to="2"
sequence="100"
>
<send>matched!</send>
</trigger>
</triggers>
 |
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
|
|
- 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.
81,220 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top