thing is i dont know code, if i did i wouldnt be asking for help. I just had a warrior i grouped with have a doom gs macro and i found it more helpful then looking at tiny icons to see if it was removed and thought it would be nice to add.
This is the problem. You're not asking for help, you're asking for someone to write the code for you. Spend 5 minutes looking at lua syntax for string concatenation and read about what tables are and how to use them.
I didn't write it out to be taken as a full implementation. When you're trying to communicate a point about how code should be written from an algorithmic standpoint you write pseudo code. No programmer is going to write out your whole code block, fully test it, and send it over. Have to do the work on your part to learn the material and implement the concepts provided. Ternary operators like used in my pseudo-code don't exist in lua so they should be converted to the correct if/else statements.
Code
send_command('input /p "Status "..spell.en.." "..(gain ? "Gained" : "Removed" '))
You're almost there. You're trying to concatenate a string inside of a string - which isn't going to work.
The final command you're trying to send looks like this
Code
input /p 'This is party chat'
So if you have to break it down like this so it makes sense you should.
Code
command = "input /p "
-- Append the first quotation mark
command = command.."'"
-- Append the spell name
command = command..spell.en
-- Append the space between spell name and gain/loss
command = command.." "
-- Append whether the spell was gained/lost
if gained then command = command .. "Gained" else command = command .. "Removed" end
-- Append the final closing quotation
command = command .. "'"
-- Send the Command
send_command(command)
The one-line version
Code
send_command("input /p " .. "'" .. spell.en .. " " .. (function() if gained then return "Gained" else return "Removed" end end)() .. "'")
This code is validated working using this:
https://repl.it/repls/FilthyEarnestMonads