mudlet curing table

Post Reply
patrick1
Posts: 1
Joined: Tue Sep 30, 2014 6:15 am

mudlet curing table

Post by patrick1 »

hello everyone I'm having trouble working out how to send multiple affliction names from my curing table so far i can get the script to send sip unravel guilt if i'm afflicted with that but not for multiple afflictions such as if i'm afflicted with guilt and mindhaze i can't seem to figure out how to get it to send sip unravel guilt mindhaze here is the script i have any help would be appreciated and hopefully that's enough info

function cure()
for _,v in pairs(afflictionlist) do
if afflictQueue[v.name] and elixbal == 1 then
send(v.cure .. v.name);elixbal = 0.5
end
end
end

afflictionlist = {

{name = "mindhaze", cure = "sip unravel "},
{name = "guilt", cure = "sip unravel "},
{name = "aethercage", cure = "sip unravel "},
{name = "aetherwave", cure = "sip unravel "},
{name = "aurora", cure = "sip unravel "},
{name = "bafflement", cure = "sip unravel "},

}

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: mudlet curing table

Post by icesteruk »

is ' afflictQueue ' the table you track if you have an affliction or not?

If thats the case I use something like this
Code: [show] | [select all] lua
function cure()


		for i,v in pairsByKeys(afflictionlist) do

if afflictQueue[v.name] and elixir == 1 then
send(v.cure)
elixbal = 0.5
				break
			end
		end
	end

or something like that . I've not tested it so, have fun :P

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: mudlet curing table

Post by Akaya »

You'll want to create a local table to store the names. Then concatenate the table with a space at the end of your send function.
Code: [show] | [select all] lua
function cure()
  local names = {}
  for _,v in pairs(afflictionlist) do
    if afflictQueue[v.name] and elixbal == 1 then
      table.insert(names, v.name)
    end
  end
  send(v.cure..table.concat(names, " ") )
end
Written from my phone fyi

Post Reply