Inside this variable contains information on all the members in your group, their position and status. We can set an event handler on this variable to run a function every time the contents of this variable changes. This can be done in mudlet by creating a new script and entering "msdp.GROUP" under Add User Defined Event Handler box and pressing the + button to add it to the list of "Registered Event Handlers."
Once that has been setup, you can now program your function to run every time this variable changes... What this function does, is finds the person in the group who is the tank... if that person is not you, it checks that persons status to see if they are fighting. If that condition is true, and your status is not fighting, then it will assist the tank.
- Code: Select all
function AssistTank()
if msdp.TANK_NAME ~= msdp.CHARACTER_NAME then
for key,value in pairs(msdp.GROUP) do
if msdp.GROUP[key]["NAME"] == msdp.TANK_NAME then
if msdp.GROUP[key]["STATUS"] == "Fighting" and msdp.POSITION ~= "Fighting" then
send("assist "..msdp.TANK_NAME)
end
end
end
end
end
This function is basic, and there are many ways to improve it... for example, you could add a check to see if you are "Absent" from the group, so you don't try and assist when you are absent, or you could provide a set variable to define who the tank is, so all the members of the group are not looped each time the variable changes to increase efficiency. Furthermore instead of assisting, you could call a further function which completes some functions on the fight initiation such as web, damn, blind etc. Or you could continue being a tosser and do nothing... in which case enjoy the xp at continent recall at least in my groups.