Page 1 of 1

[Achaea] Domination Pact View

Posted: Tue Jul 05, 2011 2:03 am
by Mosr
Just check pacts like you normally would.

Re: [Achaea] Domination Pact View

Posted: Mon Jul 18, 2011 6:57 am
by Manni
not working for me. mine is coming out like....

You have formed a pact, 12 summons remaining, with Xenophage, keeper of the
chaos gate
You have formed a pact, 25 summons remaining, with Lycantha, Keeper of the
Hounds
You have formed a pact, 31 summons remaining, with Scrag, tender of the
bloodleech pool
You have formed a pact, 19 summons remaining, with Palpatar, the Glutton of
Glaaki
__________________
| |
|Entity Pacts |
|------------------|

Re: [Achaea] Domination Pact View

Posted: Fri Jul 22, 2011 12:38 am
by Mosr
Need more information than that. Posting the debug window when you try to run it would be ideal.

Re: [Achaea] Domination Pact View

Posted: Mon Jul 25, 2011 12:45 am
by Manni
LUA: ERROR running script pactshow (Trigger167) ERROR:[string "pacts = {..."]:60: attempt to call
global 'pairsByKeys' (a nil value)new line arriv

Re: [Achaea] Domination Pact View

Posted: Mon Jul 25, 2011 6:09 pm
by Mosr
I must have forgotten to include the pairsByKeys function.
Code: [show] | [select all] lua
function pairsByKeys (t, f) --table sorting function
  local a = {}
  -- build temporary table of the keys
  for n in pairs (t) do 
    table.insert (a, tostring(n)) 
  end
  table.sort (a, f)  -- sort using supplied function, if any
  local i = 0        -- iterator variable
  return function () -- iterator function
    i = i + 1
    return tonumber(a[i]) or a[i], t[tonumber(a[i]) or a[i]]
  end  -- iterator function
end -- pairsByKeys

return pairsByKeys

Re: [Achaea] Domination Pact View

Posted: Mon Jul 25, 2011 6:18 pm
by Manni
That fixed it, thank you!

Re: [Achaea] Domination Pact View

Posted: Tue Jul 26, 2011 7:34 am
by charysis
Actually Mosr, you included the pairsByKeys function in the package but you declared it a local function. It is called from script as a global (which was returning nil). I love this pact list though. :)

Re: [Achaea] Domination Pact View

Posted: Tue Jul 26, 2011 4:11 pm
by Mosr
I never remember because I have it declared globally on my profile.