Working on a script, and I'm wondering if there is a way to check if it killed a certain creature, and that it will only leave once it kills said creature. Anyone fill me in? :)
Printable View
Working on a script, and I'm wondering if there is a way to check if it killed a certain creature, and that it will only leave once it kills said creature. Anyone fill me in? :)
Here's a script to go to a label when a certain monster is killed. Should give you a good starting point.
Code:local monsterToLeave = 'demon' -- make sure it's lowercase
local labelToLeave = 'Leave'
LootMessageProxy.OnReceive('check_kill', function(proxy, message)
if string.match(message, monsterToLeave) then
Walker.Goto(labelToLeave)
end
end
Here's the release thread that details how to handle message proxies: http://forums.xenobot.net/showthread...ssage-Handling
Basically, creating a loot message proxy that handles messages such as 'Loot of a xxx: ...'. The message is passed to a function you create, where you can deal with it. In the function I created, it checks if the name of your monster name is in the message, if it is it makes the walker go to the designated label.
Bookmarked and thank you for the quick response, also sorry for being a noob pain in the ass :D
Really going to need the message proxies for the next part of my script, working on New Frontier :D
No problem. I believe I already have you on Skype, but if I don't then add me if you need more help. ADD
This is exactly the lua code I was looking for, but it doesn't seem to work when I add it into my script. :confused:
Code:-- Leave after Boss --
local monsterToLeave = 'demodras' -- leave bosses name lowercase
local labelToLeave = 'Leavehunt'
LootMessageProxy.OnReceive('check_kill', function(proxy, message))
if string.match(message, monsterToLeave) then
Walker.Goto(labelToLeave)
end
end
So I'm trying to make it when you receive the message after the kill saying "Your deeds have been noticed...etc..etc.." It jumps the walker waypoint to the 'leave', or 'refil' label..
PS : I even tried placing the two 'locals' with the rest of the locals at the top of my script, and placed the "LootMessageProxy~" at the bottom of the script. Idk, confusing myself. When I try to launch the whole script, it bugs out and it give's an error.
Any help would be awesome, thanks.
I think I've tried everything I know of, just can't get it to work >.< Now I'm at work with bloodshot eyes because I stayed up all night working trial and errors. Many trials, and nothing but errors lol
Could anyone help me solve this plz? xD
Possibly @Spectrus ?:rolleyes: