[Achaea] Domination Pact View

Share your scripts and packages with other Mudlet users.
Post Reply
Mosr
Posts: 30
Joined: Wed Jul 21, 2010 1:24 pm

[Achaea] Domination Pact View

Post by Mosr »

Just check pacts like you normally would.
Attachments
pacts3.xml
(7.99 KiB) Downloaded 273 times

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: [Achaea] Domination Pact View

Post 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 |
|------------------|

Mosr
Posts: 30
Joined: Wed Jul 21, 2010 1:24 pm

Re: [Achaea] Domination Pact View

Post by Mosr »

Need more information than that. Posting the debug window when you try to run it would be ideal.

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: [Achaea] Domination Pact View

Post by Manni »

LUA: ERROR running script pactshow (Trigger167) ERROR:[string "pacts = {..."]:60: attempt to call
global 'pairsByKeys' (a nil value)new line arriv

Mosr
Posts: 30
Joined: Wed Jul 21, 2010 1:24 pm

Re: [Achaea] Domination Pact View

Post 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

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: [Achaea] Domination Pact View

Post by Manni »

That fixed it, thank you!

charysis
Posts: 10
Joined: Sun Apr 17, 2011 7:34 am
Contact:

Re: [Achaea] Domination Pact View

Post 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. :)

Mosr
Posts: 30
Joined: Wed Jul 21, 2010 1:24 pm

Re: [Achaea] Domination Pact View

Post by Mosr »

I never remember because I have it declared globally on my profile.

Post Reply