Debuff Calls

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » Windower » Support » Debuff calls
Debuff calls
Offline
Posts: 570
By dustinfoley 2019-04-14 10:11:30
Link | Quote | Reply
 
Ive seen it a few times on and off in the past but i cant seem to find it.

Does anyone have the script you add to GS to call in party when debuffed? Slow, paralyze, doom, silence, etc.

EG

If buff gain = "paralyzed", then /p "Paralyze"
on buff loss = "paralyzed", then /p "Paralyze gone"
Offline
By DanielH 2019-04-14 11:11:07
Link | Quote | Reply
 
Code
function buff_change(name, outcome)
  if name == "Paralyzed" then
    if outcome then
      windower.send_command("input /p Paralyze")
    else
      windower.send_command("input /p Paralyze gone")
    end
  end
end
[+]
Offline
Posts: 694
By Wotasu 2019-04-14 11:27:15
Link | Quote | Reply
 
A good way to drive your whm insane and stop playing whm..
[+]
Offline
Posts: 570
By dustinfoley 2019-04-14 15:44:21
Link | Quote | Reply
 
Its actually for me as a WHM so i can see when my second/third character have ailments...
 Asura.Meliorah
Offline
Server: Asura
Game: FFXI
user: DatGoose
Posts: 576
By Asura.Meliorah 2019-04-14 17:11:56
Link | Quote | Reply
 
Party Buffs saves a lot of the hassel of this being a problem.


[+]
 Bahamut.Shozokui
Offline
Server: Bahamut
Game: FFXI
user: Shozokui
Posts: 460
By Bahamut.Shozokui 2019-04-14 18:28:30
Link | Quote | Reply
 
PartyBuffs is a requirement for my whms/rdms/brds. You just can't have people sitting there with paralyze/sleep/petrify for long periods of time or missing buffs for long periods fo time. It has to be dealt with immediately.
Offline
Posts: 570
By dustinfoley 2019-04-14 19:50:09
Link | Quote | Reply
 
Thats nice will help some, but id still like to get my 2 mules to call in party chat when they get debuffed/cured. This is what i currently have, but it doesnt seem to be calling anything in party chat.
Code
function job_buff_change(buff, gain)
 if buff == "doom" then
        if gain then
            	send_command('@input /p Doomed.')
        else
		send_command('@input /p Doom Removed!')
        end
    end
 if buff == "Petrified" then
        if gain then
            	send_command('@input /p Petrified, need stona.')
        else
		send_command('@input /p Petrification Removed!')
        end
    end
 if buff == "Paralyze" then
        if gain then
            	send_command('@input /p Paralyzed , need paralyna.')
        else
		send_command('@input /p Paralyze removed!')
        end
    end
 if buff == "Slow" then
        if gain then
            	send_command('@input /p Slowed , need erase.')
        else
		send_command('@input /p Slow Removed!')
        end
    end
 if buff == "Sleep" then
        if gain then
            	send_command('@input /p Sleep toss me a cure.')
        else
		send_command('@input /p I am awake Removed!')
        end
    end
 if buff == "Poison" then
        if gain then
            	send_command('@input /p Poisoned , need poisona.')
        else
		send_command('@input /p Poison Removed!')
        end
    end
 if buff == "Blind" then
        if gain then
            	send_command('@input /p Blind need blindna.')
        else
		send_command('@input /p Blind Removed!')
        end
    end
 if buff == "Silence" then
        if gain then
            	send_command('@input /p Silenced.')
        else
		send_command('@input /p Silence Removed!')
        end
    end
 if buff == "Plague" then
        if gain then
            	send_command('@input /p Plagued need viruna.')
        else
		send_command('@input /p Plague Removed!')
        end
    end
end
 Bahamut.Shozokui
Offline
Server: Bahamut
Game: FFXI
user: Shozokui
Posts: 460
By Bahamut.Shozokui 2019-04-15 02:02:57
Link | Quote | Reply
 
@input is incorrect syntax. It's just input.
Code
send_command('input /p {status}')

Use correct indentation and formatting or your code because a dumpster fire. Also, instead of having 30 if/else statements, just check if the debuff name is in a map, if it is, output the name of the spell to the chat.

We're not neanderthals, don't write code like cave paintings.
Code
debuffs = {"Sleep","Plague","Petrified"}
if debuffs[spell.en] then 
  send_command("Status "..spell.en.." "..(gain ? "Gained" : "Removed"))
end


Also, it looks a lot like you're trying to use that HELP I AM TRAPPED IN 2006 PLEASE SEND A TIME MACHINE cureplease program to auto-whm and remove your debuffs automatically. Don't be another auto-whm, they're bad.
[+]
Offline
Posts: 570
By dustinfoley 2019-04-15 18:34:41
Link | Quote | Reply
 
Not using cure please.

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.

the @ symbol came from here, where i found an example of a doom call

https://fr.ffxiah.com/forum/topic/41580/gearswap-support-thread/123/


For your send line, would i need to add the input /p (and quotes)
Code
send_command('input /p "Status "..spell.en.." "..(gain ? "Gained" : "Removed" '))


Also does it matter if i say "paralze" or does it have to be "paralysis"
Offline
Posts: 570
By dustinfoley 2019-04-15 18:53:09
Link | Quote | Reply
 
Bahamut.Shozokui said: »
Code
debuffs = {"Sleep","Plague","Petrified"}
if debuffs[spell.en] then 
  send_command("Status "..spell.en.." "..(gain ? "Gained" : "Removed"))
end


ok well that code does nothing but return an error about a missing ")"

and if i try to add 'input /p ' to the line it gives an error saying its trying to index a global spell.
 Bahamut.Shozokui
Offline
Server: Bahamut
Game: FFXI
user: Shozokui
Posts: 460
By Bahamut.Shozokui 2019-04-15 21:20:28
Link | Quote | Reply
 
dustinfoley said: »
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
[+]
Offline
Posts: 570
By dustinfoley 2019-04-16 05:52:16
Link | Quote | Reply
 
Code
debuffs ={"Sleep","Plague","Petrified","Paralysis","Silence","Blindness"}
if debuffs[spell.en] then 
send_command("input /p " .. "'" .. spell.en .. " " .. (function() if gained then return "Gained" else return "Removed" end end)() .. "'")
end


Okay, but if i use it all together, i still get an error saying 'attempt to index a global spell' whenever i receive any buff. I assume if i just use the 'one line' version it will just post in party chat any buff/debuff i gain.