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
➜ Lua
➜ Hi I am new to scripting ( wanted to see if anyone out there could help me)
Hi I am new to scripting ( wanted to see if anyone out there could help me)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Serve
(28 posts) Bio
|
Date
| Tue 03 Apr 2007 02:42 PM (UTC) |
Message
| Well i will try to describe what i would like the script todo.
I would like it to cast a this spell " cast id rare"
after that this is what it will show me
Your eyes glow bright yellow for a moment.
Object 'ring rare Eagle Circle armor' is type armor, extra flags none.
Weight is 2, value is 0, level is 30.
Armor class is 115.
Affects strength by 35.
Affects intelligence by 5.
Affects wisdom by 5.
Affects dexterity by 5.
Affects constitution by 5.
Affects agility by 5.
at this point if the equipment is perfect (meaning it has 35 in one and five in all of the rest or 25 in one stat fifteen in another stat and five in all of the rest) I would like it to automatically put the rare in a bag.
The commands are the following:
Cast id rare
(If it is perfect)
put rare bag
(if it is not perfect)
drop rare
I hope this is enough information if you need more information or if you can help me in anyway please post a reply or catch me on msn kjourneejr@msn.com or aim kjournee. Thanks
another example of perfect equipment would be
Your eyes glow bright yellow for a moment.
Object 'ring rare Eagle Circle armor' is type armor, extra flags none.
Weight is 2, value is 0, level is 30.
Armor class is 115.
Affects strength by 25.
Affects intelligence by 5.
Affects wisdom by 5.
Affects dexterity by 5.
Affects constitution by 15.
Affects agility by 5.
| Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #1 on Tue 03 Apr 2007 04:58 PM (UTC) Amended on Wed 04 Apr 2007 02:45 AM (UTC) by Shaun Biggs
|
Message
| Not terribly hard to do, it will just be a very strange script. I had a similar one for the hallowed lights on the mud I play on.
<trigger
enabled="n"
group="rarestat"
match="Armor class is 115."
name="rareringstart"
send_to="12"
sequence="10"
other_text_colour="black"
other_back_colour="black"
>
<send>EnableTrigger("rareringstat", true)
EnableTrigger("rareringstop", true)
EnableTrigger("rareringstart", false)
stats = 0
highstat = 0
</send>
</trigger>
<trigger
enabled="n"
group="rarestat"
match="^Affects (strength|intelligence|wisdom|dexterity|constitution|luck) by (\d)\.$"
name="rareringstats"
regexp="y"
send_to="12"
sequence="9"
other_text_colour="black"
other_back_colour="black"
>
<send>stats = stats + %2
if highstat < %2 then
highstat = %2
end
</send>
</trigger>
<trigger
enabled="n"
keep_evaluating="y"
match="^.*$"
name="rareringstop"
regexp="y"
script="rarestat"
send_to="12"
sequence="11"
other_text_colour="black"
other_back_colour="black"
>
<send>EnableTrigger("rareringstat", false)
EnableTrigger("rareringstop", false)
if (stats==60) and ((highstat==35) or (highstat==25)) then
Send( "put rare bag" )
else
Send( "drop rare" )
end
</send>
</trigger>
and for the alias:
<alias
match="rareid"
enabled="y"
send_to="12"
>
<send>EnableTrigger("rareringstart", true)
Send("cast id rare")
</send>
</alias>
|
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #2 on Tue 03 Apr 2007 05:04 PM (UTC) |
Message
| And now for the explanation. Sorry, but that post was getting to be too long for my tastes. The alias just enables the first trigger and then identifies the item. The first trigger enables the other two triggers once it's just about to get to the point where the stats will be listed. The second trigger adds the bonus of whatever attribute to the stat total, and then checks to see if it's the highest. The last trigger turns off the remaining triggers and compares the high stats and the total stats to see if it's one of those perfect items.
Yeah, it's messy, but it should work. I just changed around the names and a few of the numbers from my hallowed light script which did roughly the same thing, but with lower numbers. |
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Serve
(28 posts) Bio
|
Date
| Reply #3 on Tue 03 Apr 2007 05:14 PM (UTC) |
Message
| Thank you very much I will try it out and let you know how it works. Thanks again | Top |
|
Posted by
| Serve
(28 posts) Bio
|
Date
| Reply #4 on Tue 03 Apr 2007 05:20 PM (UTC) |
Message
| Ok sorry but I am a complete newbie to this stuff and sometimes trying to figure it out can be overwhelming.
I am trying to figure out where in the triggers i need to place the str,int,con,agi values and where I need to input the word/words that will set of the first trigger if I am understanding this correct.
| Top |
|
Posted by
| Serve
(28 posts) Bio
|
Date
| Reply #5 on Tue 03 Apr 2007 05:31 PM (UTC) |
Message
| Also another thing is i copy paste the file into mirco word and i am trying to figure out how to save it so when i chose browse to find the script i am able to locate it. | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #6 on Tue 03 Apr 2007 11:08 PM (UTC) |
Message
| Well, the easiest way to do it is to open up the saved world file with a text editor and just copy the triggers in with the trigger section, and the alias in with the alias section. Aside from that, I could repost it as a plugin, I suppose. That way you can just copy it into notepad or whatever.
Oh, and woot! 100 posts by me. |
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #7 on Wed 04 Apr 2007 02:11 AM (UTC) Amended on Wed 04 Apr 2007 02:14 AM (UTC) by Nick Gammon
|
Message
| Copy the triggers above to the clipboard, go to the File menu -> Import, and click Clipboard.
See this post:
http://www.gammon.com.au/forum/?id=4777
Shaun has posted them without the <triggers> tags around them. You need those or that won't work.
For example, instead of:
<alias
match="rareid"
enabled="y"
send_to="12"
>
<send>EnableTrigger("rareringstart", true)
Send("cast id rare")
</send>
</alias>
Use:
<aliases>
<alias
match="rareid"
enabled="y"
send_to="12"
>
<send>EnableTrigger("rareringstart", true)
Send("cast id rare")
</send>
</alias>
</aliases>
Then you can import them, or use the "Paste" button described in the post I mentioned. |
- 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.
21,392 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top