Help (is this Lua script, if not can anyone convert it to Lua)

Posted by Shaun Biggs on Tue 18 Sep 2007 04:32 PM — 10 posts, 39,570 views.

USA #0
Well, it's certainly a Lua script...ish. Some parts are still pseudo code. In the "rareringstop" trigger, the put rare bag should be Send( "put rare bag" ), and the line two lines down from that should be modified in the same way. Also, you will need to open the script file (the one listed when you press ctrl-shift-6) and add in lines that say:

stats = 0
highstat = 0


I know I've seen this ring test somewhere in the forums before at some point earlier this year. Might want to search the forums for the earlier thread, as it might give you more information.
#1
Also I am also kasata I forgot my user name because it had been so long so I posted a new topic under tk.
Yeah you actually helped me with this, please take a look at your previous post and help me figure out what to fix please. thanks

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


I am also receiving and error

[string "Script file"]:1: unexpected symbol near '<'
USA #2
Did you copy everything into the script file instead of putting them in with the triggers and aliases? That's the only thing I can think of which would cause that error. Just follow the directions that Nick posted at the end of the other thread.
#3
also in your reply regarding the stat= 0, highstat= 0, do i need to input any number to replace the 0 with?
USA #4
No, the 0s are just there to make the variables contain something. This way they are preserved instead of getting discarded after each trigger. They are just counters making sure that the total stats on a ring are 60, and that one of those stats is either a +35 or a +25.
#5
okay so when i copy and try to paste the below text using shift+ctrl+8 I get the following errors

There was a problem parsing the XML on the clipboard. See the error window for more details
-error window
Line 19: Unexpected end-of-file while looking for </triggers> (problem in this file)




<triggers>
<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>
<triggers>
USA #6
look carefully at the last line and the error again.
#7
okay I am getting it little by little. so I got this error when trying to paste the 2nd trigger

error-
Line 14: Element name must start with letter or underscore, but starts with " " (problem in this file)

this is what I was copy pasting

<triggers>
<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>
</triggers>
Australia Forum Administrator #8
Quote:

error-
Line 14: Element name must start with letter or underscore, but starts with " " (problem in this file)
Quote:



Line 14: if highstat < %2 then


You are mixing systems a bit here. If you look inside the trigger window (in the send box), this is OK. However inside the XML part the "<" symbol is being interpreted as the start of an element (like <trigger> or <send>). Hence the message.

Inside the XML, you need to make it:


if highstat &lt; %2 then

USA #9
I fixed this error up in the thread here: http://www.gammon.com.au/forum/?id=8194

Again, this is why it becomes difficult when a question is spread over several threads.