Hi i was trying to find someone that can convert this to a different code

Posted by Serve on Tue 03 Apr 2007 06:20 PM — 5 posts, 20,267 views.

#0
I was trying to use this code for mushclient. Sorry i didnt realize there was a general board also. Sorry i didnt mean to spam the others fourms.



<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
put rare bag
else
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>
Australia Forum Administrator #1
What is the question exactly?
#2
I wasnt sure if that code would work in lau. i was trying to see if it could be written in a differen code like jbscirpt something capatable with mush 3.42 gonna try to update mushclient so i can use it also..where do i get the program to run lau script
Australia Forum Administrator #3
It is Lua, not Lau.

Lua comes with MUSHclient from version 3.52 onwards. You should probably download the latest version:

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

Quote:

I wasnt sure if that code would work in lau.


Try it and see.
USA #4
Sorry, I forgot to mention what I was using. You posted under the Lua forum, so I responded with a solution that worked in Lua. Jscript is pretty close, you just need to change the EnableTrigger to World.EnableTrigger and muck about with the if statement so it's syntactically correct.

Also, when posting code snippets, it's usually good practice to surround it in [code] [/code] tags. That way the boards will preserve the spacing.

I also did something really stupid in the send field for the rareringstop trigger. forgot to encapsulate what's sent to the mud in a Send() function. I'll fix it in the first post about it.