For anyone else finding this thread: there are no compound conditionals (if x and y then...) so you'll have to use nested if statements for "and" and elseif for "or". In the latter case, you can avoid repeating code by using a custom event handler. [Bad advice; see next comment from Shaun]
// "and"
if event.px == 5 then
if event.py == 5 then
say "You're at row AND column 5!"
end
end
// "or"
if event.px == 5 then
say "You're at row OR column 5!"
elseif event.py == 5 then
say "You're at row OR column 5!"
end
A common PulpScript-ism is something like the following:
pass = 0
if x==5 then
pass += 1
end
if y==5 then
pass += 1
end
// AND
if pass==2 then
// both
end
// OR
if pass>=1 then
// one or the other
end
if pass==0 then
// neither
end
(I’d avoid using a custom handler for this as there’s a lot of overhead associated with triggering an event.)
Also for anyone else finding this thread, there is a way to simulate multiple AND conditionals in one if statement. Imagine we have 4 different variables and we want to check that all of them are equal:
checkMultipleAnd = "{var1}{var1}{var1}{var1}"
if checkMultipleAnd == "{var1}{var2}{var3}{var4}" then
// do something
end
Although I don't know if this is better in terms of performance