Register forum user name Search FAQ

Gammon Forum

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 ➜ Delay?

Delay?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Dele   (8 posts)  Bio
Date Fri 13 Oct 2006 12:08 AM (UTC)
Message
I was wondering what the command for a delay in a script is... Basically i need it to delay for a few seconds before the command and am not sure how to do this...

You feel a fish nibbling on your hook.

Delay 2.7 seconds

Tease line


You feel a fish make a small strike at your bait.

Delay 2.5 seconds

Jerk Pole



Can anyone help me figure this out?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 13 Oct 2006 12:13 AM (UTC)
Message
Use DoAfter. Here is an example with Lua as the scripting language, make sure you enable scripting.


<triggers>
  <trigger
   custom_colour="4"
   enabled="y"
   match="You feel a fish nibbling on your hook."
   send_to="12"
   sequence="100"
  >
  <send>DoAfter (2.7, "Tease line")</send>
  </trigger>
</triggers>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dele   (8 posts)  Bio
Date Reply #2 on Fri 13 Oct 2006 12:16 AM (UTC)

Amended on Fri 13 Oct 2006 12:51 AM (UTC) by Dele

Message
<triggers>
<trigger
custom_colour="4"
enabled="y"
match="You feel a fish nibbling on your hook."
send_to="12"
sequence="100"
>
<send>DoAfter (2.7, "Tease line")</send>
</trigger>
</triggers>

So I understand the do after part but whats the Enabled and send _TO stuff for? Sorry am really new at this kind of stuff. i tried to read the introduction to scripting but its very confusing

Edit: Also do i save the trigger as a .lua and load it as a script?

Edit edit: ok so i saved it as a .lua and i importeted it but am not sure how to enable scripting all take a look around the forums though maybe all find it

Okay I found it but the problem is i imported the script so when i go to scripts and then try and load it it says there is an error in the >

Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 13 Oct 2006 01:07 AM (UTC)
Message
Read this, you just paste it into the trigger list:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4777

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dele   (8 posts)  Bio
Date Reply #4 on Fri 13 Oct 2006 02:04 AM (UTC)
Message
Send-to-script cannot execute because scripting is not enabled.

How do i enable this? I am still unsure
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Fri 13 Oct 2006 02:31 AM (UTC)
Message
World options->Scripting, and there should be a check box.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Dele   (8 posts)  Bio
Date Reply #6 on Fri 13 Oct 2006 07:32 PM (UTC)
Message
When i clip the check box and then ok i get this

Untrusted world Achaea, ID: 7d4718a967a99bbdb1ab63d1
Lua sandbox created, some functions disabled.
Loading of DLLs in scripts is disabled.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 13 Oct 2006 08:56 PM (UTC)

Amended on Fri 13 Oct 2006 08:58 PM (UTC) by Nick Gammon

Message
It is a warning, you can ignore it. Your triggers should work now.

However what it is telling you is that the Lua "script sandbox" has disabled some things that potentially can be used to cause problems for you. Probably not by yourself directly, but if you installed a plugin that did things like delete files. There have been no reported cases of such things but we are being cautious.

You can do one of three things to make the warning message go away. Go to the File menu -> Global Preferences -> Lua tab, and:


  1. Suppress the warnings

    Change the line (right near the top):


    warn_if_not_trusted = true -- change to false to suppress warnings


    to:


    warn_if_not_trusted = false -- no warning messages


    That suppresses the warnings themselves.

  2. Trust all worlds

    Change the line (right near the top):


    trust_all_worlds = false -- change to true to trust all the worlds


    to:


    trust_all_worlds = true -- trusting scripts in all worlds


    This lets "dangerous" scripts be executed directly by world files (eg. triggers) but not plugins. There is a potential issue if you do this that a script that you or someone else writes (using "send to script") may cause a problem.

  3. Trust this particular world

    You know your world "ID" (identifier) which in your case is "7d4718a967a99bbdb1ab63d1". That was in the warning message.

    A little further down in the edit box on the Lua tab is a list of trusted worlds. Click the Edit button to see it more clearly. It looks like this:

    
      local trusted_worlds = {
     --    ["a4a1cc1801787ba88cd84f3a"] = true,  -- example world A
     --    ["cdc8552d1b251e449b874b9a"] = true,  -- example world B
     --    ["1ec5aac3265e472b97f0c103"] = true,  -- example world C
          }  -- end of trusted_worlds 
    


    You can change that to trust this particular world, by add a line similar to the ones shown, with your world ID in it:

    
      local trusted_worlds = {
           ["7d4718a967a99bbdb1ab63d1"] = true,  -- Achaea
     --    ["a4a1cc1801787ba88cd84f3a"] = true,  -- example world A
     --    ["cdc8552d1b251e449b874b9a"] = true,  -- example world B
     --    ["1ec5aac3265e472b97f0c103"] = true,  -- example world C
          }  -- end of trusted_worlds 
    



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dele   (8 posts)  Bio
Date Reply #8 on Fri 13 Oct 2006 09:23 PM (UTC)

Amended on Fri 13 Oct 2006 09:30 PM (UTC) by Dele

Message
I get this error when i load the script

Error number: 0

Event: Compile error

[string "Script file"]:2: unexpected symbol near '<'

Called by: Immediate execution
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #9 on Sat 14 Oct 2006 01:02 AM (UTC)
Message
The trigger I suggested does not use a script file. Please follow the method in this post for copying and pasting the trigger into your world file:

http://www.gammon.com.au/forum/?id=4777

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dele   (8 posts)  Bio
Date Reply #10 on Sun 15 Oct 2006 01:23 AM (UTC)
Message
Alrght i got this to work! Now onto the next problemm

I am not sure what this is called but i have heard people refer to it as Gaging Text

basically i see

You have recovered balance on all limbs.

I want to see something like

|GO TIME! GO GO GO!!| < in RED And the size of two lines

Is this possible in mush?
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.


25,681 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.