PDA

View Full Version : <Request> Multi combo type script



callumbagshaw
06-02-2016, 12:27 PM
Hi all,
is it possible to have multiple combo attack options?

This could either work on:
Leader attack - if leader uses SD on target, combo followers use SD on target, if leader uses avalanche, combo followers also use avalanche.

Leader say - leader can say "sd", at which point combo followers will shoot SD at the leader's target, leader can say "ava" and they shoot avalanche etc...

Any ideas?
If someone can give me anything helpful I can try making it myself and I'll post for free, I just need a starting point at least.
Thanks!

Trykon
06-02-2016, 02:02 PM
I could make for eg, if target hp drops suddenly then use sd, this way if leader uses sd, then all combo would fit together, om not sure how to solve it with mana shield

Adrax 13
06-07-2016, 02:12 PM
You could use Xenobots Subscriber/publisher functions.

Basically its sweet because you don't actually need to send any private messages, speak in chat etc.
So the leader in this case would be the Publisher, the followers being the Subscriber.

Have the leader publish the target ID, as well as the attack type. It'd look something like this:



local publisher = IpcPublisherSocket.New("Targeting-Example", 30120)
lastTarget = 0
Module.New('Report Target', function(Mod)
if Self.TargetID() ~= 0 and lastTarget ~= Self.TargetID() then
lastTarget = Self.TargetID()
publisher:PublishMessage("Target", Self.TargetID())
--Insert if statement about target health for which form of attack
--publisher:PublishMessage("Attack", "sd") --Example of posting to use SD
--publisher:PublishMessage("Attack", "ava") --Example of posting to use Avalanche
else
lastTarget = Self.TargetID()
publisher:PublishMessage("Target", "Stop")
end
end)


So with that controlling the health, the target, and the attack type, all you need is for the subscribers to see the messages:



attackType = ""
local subscriber = IpcSubscriberSocket.New("Targeting-Example", 30120)
subscriber:AddTopic("Target")
subscriber:AddTopic("Attack")
Module.New('Message Scanner', function(Mod)
local hasMessage, topic, data = subscriber:Recv()
if (hasMessage) then
if topic == "Target" then
Creature(tonumber(data)):Attack()
elseif topic == "Attack" and data == "sd" then
attackType = "SD"
elseif topic == "Attack" and data == "ava" then
attackType = "Ava"
end
end
end)
--Insert an attack module for UseItemWithTarget with a delay for the rune exhaust. Base it off of the attackType



This isn't the full code obviously but it should be more than enough to get you on track with a pretty well made script that you're asking for :)

I personally think the addition of these functions for Xenobot were super awesome but I haven't seen many people take advantage of it yet, be the change I wanna see!!!

callumbagshaw
06-09-2016, 10:52 AM
Thanks a lot mate!
Is there a way to automatically set the target though? This is more for PVM than PVP, so it would be a bit annoying having to reset target for every monster!
Appreciate it though cheers :)

Adrax 13
06-09-2016, 02:40 PM
Thanks a lot mate!
Is there a way to automatically set the target though? This is more for PVM than PVP, so it would be a bit annoying having to reset target for every monster!
Appreciate it though cheers :)


You could always use the targeting system on xenobot if you'd like!
So on the lead character (publisher) just add whichever monsters you're hunting to targeting, it'll send which ones to attack from the publisher to the subscriber

callumbagshaw
06-09-2016, 03:52 PM
OK I'll give it a try thanks dude!
I've been out of Xenobot & tibia for 3 years now, working in a job where i use .NET every day - comning back to lua is a bit odd at the moment!!!! Appreciate the help :)

Adrax 13
06-09-2016, 04:20 PM
OK I'll give it a try thanks dude!
I've been out of Xenobot & tibia for 3 years now, working in a job where i use .NET every day - comning back to lua is a bit odd at the moment!!!! Appreciate the help :)

Haha no worries buddy sounds like a solid job!
If you need any extra help feel free to pm me, I'll be glad to help!

romarranger
06-10-2016, 09:26 PM
I always desired something like that, if I use SD, they do SD, if I do AVA, they do ava, but I have no experience with coding, so I didn't ask XD