Skip to content

bashing

I'm creating my own bashing toggle. I have the script for it, except for one minor 'check' that I need to add.. Basically, when I'm targeting 'undead' and there are no 'undead' in the room, it spams out my bashing command until I toggle it off or I lose bal/eq. I need help with that first check..

Would it be easier to create a new variable and create a function out of it to check if target is inRoom or is there a different/easier way?

I think my example would be along the lines of..

local inRoom = function() <insert code here to check for inRoom> end 

then the check for it being like,

if inRoom then
    if bal and eq then
        BASH
    end
end

Oh, Mudlet user here.

Comments

  • edited March 2018
    This is my 'in room' code (most of it anyway). E: Tags are stoopid anyway.

    [code]
    burn.select = function()
    local target,shard = "",false
    --contents is the results of gmcp.Char.Items.List.items
    if #burn.contents > 0 then
    -- mark a shard for harvesting
    if burn.harvest_shard then
    for i=1,#burn.contents do
    if string.find(burn.contents[i].name,"shard") then
    shard = true
    end
    end
    end 

    -- mark a mobile for killing
    ---Auto is dangerous af. Don't use it.
    if burn.permit == "auto" then
    -- just make sure not in exclusion list
    for k,v in pairs(burn.contents) do 
    if table.contains(burn.exclusion_zone,v.id) then -- do nothing
    elseif table.contains(burn.exclusion_zone,v.name) then -- do nothing
    elseif v.attrib == "m" then
    target = v.name
    break
    end
    end
    elseif burn.permit == "limited" then

    if not burn.targets or next(burn.targets) == nil then

    local throw = ""
    throw, burn.targets = burn.next_area()
    end

    for k,v in pairs(burn.targets) do
    for i=1,table.getn(burn.contents) do
    if burn.contents[i].name == k then
    target = v

    break
    end
    end
    end
    end
    end
    ---threatCheck determines how dangerous the room is
    if burn.threatCheck() then target,shard = "",false end
    if target ~= "" and target ~= burn.last_target then
       if burn.announce == true then 
          send("say Kill the "..target.."!") 
       end
          if combatFocusEcho then combatFocusEcho("Targeting "..target,"target") end
     end
    if target ~= "" then burn.last_target = target end
    return target,shard
    [/code]
  • Thanks, I know how I can make the burn.contents table, so this really helps. 
  • Worth noting is that you'll have to turn on CONFIG GMCPVITALSADVANCED after this recent change, in order to see your eq/bal in gmcp.
  • Ya, I got that. Thanks for the input though! Might help others if they come across this thread and read as to why theirs is not working.
  • edited March 2018
    Balance and Equilibrium are always sent (not gated behind advanced gmcp) because they're also required by Nexus. This wasn't the case when I first put it in, but it was brought to my attention that I'd inadvertently broken that feature on Nexus and I moved them into the set that's always sent.
    Like what we're doing? Why not take a second to vote? Vote for Imperian at http://www.imperian.com/vote
  • edited March 2018
    You can use gmcp to track mobs in room. If you're going off IH, don't bother with targetting undead, just use a database of approved targets and compare the mobs in room to your database of pre-approved mobs. The generic targets are good for manually bashing, but if you're writing something for mobs in room, just compare 2 strings. Can loop through and break when you encounter a match, then restart loop on a kill, and move room when 0 matches.

    @Gjarrus why are you targetting shards and having that whole check? It looks like it's for an area sweep and harvesting, but you can do that more efficiently - try a separate macro (so you aren't forcing that if process every round) or just add shard to your target list and chuck in an if at the attack level (lower down, less called) that swaps in a harvest. You can also path find shard, if you want a harvesting bot.
  • @Tyanna I was actually going to go with that and build a bashing database with it. I just have to officially figure out how to do that. I have some scripts I might 'steal' from other IRE games and incorporate it over to here. I was just using the 'Target Undead" as an example. But thanks for your input!
  • Tyanna said:
    @Gjarrus why are you targetting shards and having that whole check? It looks like it's for an area sweep and harvesting, but you can do that more efficiently - try a separate macro (so you aren't forcing that if process every round) or just add shard to your target list and chuck in an if at the attack level (lower down, less called) that swaps in a harvest. You can also path find shard, if you want a harvesting bot.
    I'd have never made a dedicated shard harvesting bot (closest I got was using my looper to run harvest shard|path find shard|path go every 24s for uncontested falls, which isn't exactly efficient). That just picks up incidental shards after I clear rooms. It's also older code from the base burn I got from Iniar, and I was more focused on bug fixes and feature additions than optimization that doesn't matter much (especially when you look at everything else my system does)
  • @Daebach @Gjarrus - heh no worries. I was super loopy on painkillers when I wrote that. I'm graceful as fudge and tall as a giraffe, so managed to stick my hand in a ceiling fan. 
Sign In or Register to comment.