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
➜ Do I need to use scripting for this?
Do I need to use scripting for this?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Jeremymia
(5 posts) Bio
|
Date
| Sat 31 Mar 2007 11:43 PM (UTC) |
Message
| I don't know anything about scripting, but after a scare earlier today I wanted something like this:
You get * gold sovereigns from a canvas backpack.
Iff * > SomeNum, put %1 gold sovereigns in pack####.
How can I do this? Thanks!
| Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #1 on Sun 01 Apr 2007 12:23 AM (UTC) |
Message
| For this, I'm just picking 500 as a minimum gold. You can have a variable store what you want and replace the 500 with tonumber(getvariable(varname)). Set the "send-to" field to script, and then put this in the send field (I'm using Lua as the scripting language here):
if "%1" > 500 then
send( "put %1 gold sovereigns in pack"))
end
|
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Jeremymia
(5 posts) Bio
|
Date
| Reply #2 on Sun 01 Apr 2007 12:44 AM (UTC) |
Message
| Thanks, but there are a few wrong things with that. I tried to fix it up a bit from my knowledge of java, but I still get an error when the condition is true:
if %1 > 500 then
send ("put %1 gold sovereigns in pack")
end
But after that, send doesn't seem to be a recognized function. | Top |
|
Posted by
| Jeremymia
(5 posts) Bio
|
Date
| Reply #3 on Sun 01 Apr 2007 12:56 AM (UTC) |
Message
| Never mind. It worked when I capitalized Send.
Thanks again. I've been using mushclient for over a year, but just now it hit me how powerful a program it is. My favorie thing is that the power comes convenient: I can put it all right in the trigger window! | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #4 on Sun 01 Apr 2007 01:33 AM (UTC) |
Message
| Sorry about that. I keep forgetting to capitalize send. |
It is much easier to fight for one's ideals than to live up to them. | 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.
12,492 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top