XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: Check kill?

  1. #1
    Senior Member Maximum Adam's Avatar
    Join Date
    Jan 2013
    Location
    Canada
    Posts
    481
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Check kill?

    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?
    Bought 70 Knight from @Kota
    Bought 72 Knight from @Kota
    Bought 147 Knight from @ceeburi with middleman @DarkDevil

  2. #2
    Administrator
    Join Date
    Dec 2010
    Posts
    2,565
    Mentioned
    228 Post(s)
    Tagged
    1 Thread(s)
    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

  3. #3
    Senior Member Maximum Adam's Avatar
    Join Date
    Jan 2013
    Location
    Canada
    Posts
    481
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Spectrus View Post
    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
    Thank you very much, could you please explain to me how this works, getting there on my scripting, but new things, I'd like to know how it works, if you would be so kind

    Edit: also, will it leave as soon as it kills it? Or should I have a check label still?
    Bought 70 Knight from @Kota
    Bought 72 Knight from @Kota
    Bought 147 Knight from @ceeburi with middleman @DarkDevil

  4. #4
    Administrator
    Join Date
    Dec 2010
    Posts
    2,565
    Mentioned
    228 Post(s)
    Tagged
    1 Thread(s)
    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.

  5. #5
    Senior Member Maximum Adam's Avatar
    Join Date
    Jan 2013
    Location
    Canada
    Posts
    481
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Bookmarked and thank you for the quick response, also sorry for being a noob pain in the ass

    Really going to need the message proxies for the next part of my script, working on New Frontier
    Bought 70 Knight from @Kota
    Bought 72 Knight from @Kota
    Bought 147 Knight from @ceeburi with middleman @DarkDevil

  6. #6
    Administrator
    Join Date
    Dec 2010
    Posts
    2,565
    Mentioned
    228 Post(s)
    Tagged
    1 Thread(s)
    No problem. I believe I already have you on Skype, but if I don't then add me if you need more help. ADD

  7. #7
    Senior Member Maximum Adam's Avatar
    Join Date
    Jan 2013
    Location
    Canada
    Posts
    481
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Spectrus View Post
    No problem. I believe I already have you on Skype, but if I don't then add me if you need more help. ADD
    Yes, I'm pretty sure I do
    Thats another question I have, how do you guys get ur skype/msn to show up like that, still haven't been able to figure that out lol
    Bought 70 Knight from @Kota
    Bought 72 Knight from @Kota
    Bought 147 Knight from @ceeburi with middleman @DarkDevil

  8. #8
    Odemis's Avatar
    Join Date
    Oct 2013
    Posts
    239
    Mentioned
    42 Post(s)
    Tagged
    0 Thread(s)

    Help with getting it to work please xD

    This is exactly the lua code I was looking for, but it doesn't seem to work when I add it into my script.


    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.
    Last edited by Odemis; 12-30-2014 at 07:51 AM.

  9. #9
    Odemis's Avatar
    Join Date
    Oct 2013
    Posts
    239
    Mentioned
    42 Post(s)
    Tagged
    0 Thread(s)
    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

  10. #10
    Odemis's Avatar
    Join Date
    Oct 2013
    Posts
    239
    Mentioned
    42 Post(s)
    Tagged
    0 Thread(s)
    Could anyone help me solve this plz? xD
    Possibly @Spectrus ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •