Your if statement should have == in it. And all the assignments need simply a =.
You (at least what you pasted) have a == in your second assignment (when you subtract 100).
Not sure if this matters or not, but it doesn't even look like the error message was for this trigger. I mean, this trigger has errors in it, too, but the message appears to be for a "Hunger" trigger.
In Lua (as in C), you use "==" for logical comparison and "=" for variable assignment. The main difference is that in Lua you'll get an error when you try to swap them around. In C, it's legal, though the logic may not be what you wanted.
Your for statement should also have a = instead of a ==, since it's an assignment, not a comparison.
Why do you have the else statement?
And your end should be an "end if".
The difference between == and = is not trivial, use = when youre assigning a value, use == when you're comparing them. You had this same problem in the other script you posted, why that hasn't given you problems is just luck.
With all these syntax errors, you should download the VBScript scriptdocs (alright, so its really called Windows Script docs, but still) and reference it often (especially when debugging).
You would've seen that it says 'for counter = start to end' and that if statements have optional elses and require an 'end if' instead of merely an 'end'. So download that (you can download it from the same section as the 'script functions you can download' on the first inbuilt function page).
It's also quite possible that your trigger is wrong, or that you have leading/trailing spaces in the variable.
You also don't need to use getvariable to get the contents of aaHunger, since you have it as %4 already, that will save you time in your script. But check your hunger variable (MC variable, or even just note %4) and see if it is indeed H T or HT (without other whitespace or anything else) when you think it should be firing.
Oh yeah, and it just occured to me that we're in VBscript, and we dont ever use ==. So change all those (comparisons and assignments) to =. That's probably the problem that started this all.
We're all just confused as to what language we're actually writing in.
The error is still clearly pointing at the "==" operator. So change:
hunger == GetVariable ("aaHunger")
to:
hunger = GetVariable ("aaHunger")
As Meerclar already said. Next, your for loop looks fishy, I think you are confusing vbs and Lua here. According to the Lua docs it should be:
for count=1,2 do
...
end
Not what you have:
for count == 1 to 2
...
next
So the script should be:
SetVariable ("aaHP", "%1")
SetVariable ("aaMana", "%2")
SetVariable ("aaMove", "%3")
SetVariable ("aaHunger", "%4")
hunger = GetVariable ("aaHunger")
if (hunger == "H") or (hunger == "T") or (hunger == "HT") then
for count=1,2 do
SendImmediate ("drink soup")
end
end
Or better yet:
SetVariable ("aaHP", "%1")
SetVariable ("aaMana", "%2")
SetVariable ("aaMove", "%3")
SetVariable ("aaHunger", "%4")
hunger = "%4"
if (hunger == "H") or (hunger == "T") or (hunger == "HT") then
for count=1,2 do
SendImmediate ("drink soup")
end
end