Lol, That was easy, looked again and it popped right out at me,
Needed caps on Note and Send
Needed caps on Note and Send
This forum is a read-only archive of the Gammon Software forum (2000–2026). No new posts can be made. Search the archive.
Posted by Crea3644 on Tue 06 Jun 2006 03:42 PM — 14 posts, 54,736 views.
<triggers>
<trigger
name="start_roll"
enabled="n"
match="^\s*New\s+Previous\s*$"
regexp="y"
sequence="100"
send_to="12"
><send>EnableTrigger("start_roll", false)
EnableTriggerGroup("CountRoll", true)
</send></trigger>
<trigger
enabled="n"
match="^\s*(Strength|Dexterity|Intelligence|Wisdom|Charisma|Constitution|Luck)\s+(\d+)\s+(\d+)\s*$"
regexp="y"
send_to="12"
sequence="1"
group="CountRoll"
><send>if stats == nil then stats = {} end
stats["%1"] = %2
</send></trigger>
<trigger
enabled="n"
match="^\s*Luck\s+\d+\s+\d+\s*$"
regexp="y"
group="CountRoll"
sequence="2"
send_to="12"
><send>EnableTriggerGroup("CountRoll", false)
res = true
for k,v in pairs(stats) do
if v < tonumber(GetVariable("Z" .. k)) then
Note(k .. " not good.")
res = false
end
end
if res == false then
Send("reroll")
EnableTrigger("start_roll", true)
end
</send></trigger>
</triggers>
'VB can't pull multiple variables from an array, like Lua,
'so we need to create a temporary variable that already
'has more than one. In theory it should work, in practice
'... I have never actually tried this.
type vk
v int
k string
end type
dim temp as vk
for each vk in pairs(stats)
if ...
next
if stats == nil then
stats = {}
end
stats["%1"] = %2
EnableTriggerGroup("CountRoll", false)
res = true
for k,v in pairs(stats) do
if v < tonumber(GetVariable("Z" .. k)) then
Note(k .. " not good.")
res = false
end
end
if res == false then
Send("reroll")
EnableTrigger("start_roll", true)
end
keep_evaluating="y"
if stats == nil then
stats = {}
end
stats = stats or {}
for k,v in pairs(stats) do
if v < tonumber(GetVariable("Z" .. k)) then
Note(k .. " not good.")
res = false
end
HUH :P
Kinda looks like a for, next statement to me
k,v in pairs?
t =
{ name = "Nick",
str = 16,
dex = 14,
agi = 17
}
for k, v in pairs (t) do
print (k, v)
end -- for loop
Output
str 16
name Nick
dex 14
agi 17
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6036