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 ➜ VERY basic Scripting problem

VERY basic Scripting problem

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


Posted by Lippa   (11 posts)  Bio
Date Wed 22 Feb 2012 12:01 AM (UTC)

Amended on Wed 22 Feb 2012 12:02 AM (UTC) by Lippa

Message
Im sorry to post such a basic problem, but I have searched and searched without finding a solution.

Im trying to learn the basics of scripting in LUA but am facing an uphill battle fro the start as I cant seem to work out how to send commands through scripting :/

Ive tried several ways but all result in the same error

attempt to call global 'send' (a nil value)

I know this is saying that send isnt a recognised command but I dont know why??


with the trigger - "A hopping frog drifts *."

Ive tried :-

-
direction = %1
send(direction)
-
send %1
-
send "%1"
-
world.send %1


but none of them seem to work. Once I learn the basics, Im sure I can work the rest out but this is really stumping me. Thanks in advance for your help.
Top

Posted by Dontarion   USA  (62 posts)  Bio
Date Reply #1 on Wed 22 Feb 2012 02:20 AM (UTC)
Message
For lua the correct syntax would be Send("%1").
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 22 Feb 2012 03:54 AM (UTC)
Message
This video about the introduction to scripting might help:

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

- Nick Gammon

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

Posted by Lippa   (11 posts)  Bio
Date Reply #3 on Wed 22 Feb 2012 08:30 AM (UTC)
Message
OK, I worked it out - and I must be an idiot - I didnt realise that I had to use a capital S for send!

Thanks
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.


14,601 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.