Looking to have a script made!

I want a script made that I can bind to a key. When I press the key the script will check 'ih' and target what's in the room based upon what I allow in a table. The script would have to have aliases that I can use to add/remove items from the table. 

I use Mudlet and Svo if that helps. 

Your time is valuable and I have credits. 

Comments

  • Ok, I'm kind of a mudlet newbie, but this idea is pretty cool, so I decided to give it a shot. Also, I do not have svo, so I haven't tested it with that.

    This script uses GMCP to track what is in the room as you walk around. I'm guessing because you use svo, you also use GMCP.

    To use:
    ttadd thing priority (e.g. ttadd manticore 2) - adds manticore to your target list as the second priorty
    priority is optional and will default to 1 if you leave it blank
    ttedit - shows you your target list by priority and allows you to adjust or remove values from the list
    ttset - sets the target list to a preset list
    you can set this list by editing the autotargetSet() function
    ttreset - resets your current target
    sets a global variable called "target"
    you can change what variable it sets by editing the autotargetRetarget() function

    The function goes through your target list and compares it to what is currently in the room. If it finds a match it sets your new target, and if it doesn't it keeps the old target. It also goes in order of prioritization, so if you have both a orc and ogre on your list in that order it will first target the orc, and when that is gone target the ogre.

    If you want to use a keybinding, just make a new key in mudlet and just make a call to the autotargetRetarget() function. I also used it in conjunction with my bashing macro and it worked great. Awesome idea Tekk.

    Download Here and install as a normal Mudlet Package

    Also, as I am a newbie to scripting...any feedback is more than welcome!
  • I like it... testing with Omni and seems to work ok, off for a serious session now...
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • XliXli
    edited April 2013
    I have added the ttreset function into my bashing combo.

    Going well, but it doesn't like denizens with apostrophes in their names (eg A'urnir).

    Also, not found out what happens with wandering denizens, eg hitting a fairy it the Aalen and a grizzly bear walks in... does it change target? - linked issue with this is to be bashing something not in the list, and something in the list walks in - the target is changed. (note to self: Need a switch to enable disable auto-target?)

    It couldn't cope with "man" being higher in the priority list than "woman", it kept assigning target "man" because it was reading "woman
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • Xli said:
    It couldn't cope with "man" being higher in the priority list than "woman", it kept assigning target "man" because it was reading "woman
    It also couldn't cope with a manually set target of craftsman when man was in the auto target list...
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • Thanks Xli...I'll look into those issues.

    I like the idea of an ON/OFF switch, but would you want it to retarget something if it wanders into the room? To me, I would rather keep hitting what you started with until it died...if you keep switching targets everything something higher on the priority list walked in you might get in a situation (though unlikely) where you end up not killing anything because you keep switching targets. I have a key that I press that will check the target list (with the autotargetRetarget() function) then kill that thing until it is dead, then recheck again.

    Right now, it only checks to change target when the autotargetRetarget() function is called, which in my package is achieved with the alias ttreset.

    So, if you put this in with your bashing macro..mine for example...

    autotargetRetarget()
    send("maul "..target)

    This would check for a new target before each maul, and if something new wandered into the room that was higher on your list, you should start targeting that instead. This would also change if you were bashing say, a orc and that is not on your list, but then an ogre walks in (on your list) you should start targeting the ogre.
  • Fixed a few issues that Xli found with the script.
    • You can now use any non-space character when adding items to the list. "ttadd A'urnir 2" should work now.
    • Matching is now on whole words only (e.g. caveman should not match when "man" is on the list)
    Thanks for testing Xli!

    New package here.
  • Downloaded the update, will continue to test...

    I have put autotargetRetarget() into my bashing macro, it means when I am clearing an area with a set of denizens with differing names, I can just romp through without having to keep changing the target. Most of the denizens don't move, and I have those that do down at the bottom of my priority list. I guess I could just use the ttreset alias and take the line out of my bashing macro...

    Another thought: how about being able to create multiple lists, so I could have a list for (and these are just examples before someone starts getting uppity about bashing areas) the Aalen (fairy, bear, fox, wolf, etc), a different one for the Southern Vashnars (bear, drake, condor, atavian, manticore) etc and load each through a macro?

    Like it so far :)
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • I had some links messed up, both of my links in above posts should now go to the most up to date script. If I make any future updates I'll just use the same link so I don't confuse everyone.

    Xli, you might have downloaded the old version when you tried to update, sorry!
  • Been looking at the code to try to do the following, but haven't a clue when it comes to GMCP:

    I have a target set (either manually or by the autotargeting script from my list of targets). The bashing macro checks current target against what's in the room. If there is a match, target remains the same. If not a match (eg target is dead) and there is something on the list in the room, the target updates.

    eg Gnoll is #1 and Mingruk is #2 on the autotarget list. Xli is demonstrating the monk bashing combo of SDK UCP UCP against a mingruk (yeah, badass). A surly gnollguard enters the room. Xli continues to punch and kick the mingruk until it finally dies. The next time the bashing combo is executed, because the gnoll is no longer there, mingruk is autoselected as the target and more punchy kicky goodness ensues.
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • edited April 2013
    You would have to put in a check current target before the "retarget" loops in the autotargetRetarget() function.

    for k,v in ipairs(autotarget.here) do
    p1,p2 = string.find(v.name,"%f[%w]"..target.."%f[%W]",0)
    if p1 then
    return
    end
    end

    put that right above the line "for ka,va in ipairs(autotarget.list) do"

    That might work, off the top of my head...
  • Yep, worked - I have warrior then caribou on my list. I was bashing a caribou, a warrior walked in, i kept bashing the caribou until it died, then bashed the warrior.

    I've written a couple of functions to write out the current table to an external file and load into a new session:

    function autotargetSave()

    table.save(getMudletHomeDir() .. "/autotarget.lua",autotarget.list)

    autotargetMsg("Saved")

    end


    function autotargetLoad()

    table.load(getMudletHomeDir() .. "/autotarget.lua",autotarget.list)

    autotargetMsg("Loaded")

    end

    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • XliXli
    edited April 2013
    I have also tweaked the autotargetAdd function so it checks whether a particular target already exists within the table, and also appends to the end, unless specified (instead of inserting at top):

    function autotargetAdd(thing,p)

    if table.contains(autotarget.list, thing) then

    autotargetMsg("Target <green>"..thing.."<reset> already in table.")

    else

    priority = tonumber(p) or table.maxn(autotarget.list) + 1

    if priority > table.maxn(autotarget.list) then

    table.insert(autotarget.list,thing)

    priority = table.maxn(autotarget.list)

    else

    table.insert(autotarget.list,priority,thing)

    end

    autotargetMsg("Added target <green>"..thing.."<reset> at priority <blue>"..priority.."<reset>.")

    end

    end

    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
Sign In or Register to comment.