assistance please

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

assistance please

Post by Israafiyl »

Greetings,
I am wishing to make a trigger that, once I strike my target with an arrow I call out over a channel that the target was struck and which direction the shot hit. This is usually a simple task for me but I am now using GMCP to snipe in EVERY direction (as to not have to specify such while firing) thus am not sure which direction the target it in.

I am wondering if there was a way I could find out which direction I shoot my target. I use this as my snipe alias....

for exit in pairs (gmcp.Room.Info.exits) do send("snipe "..target.." "..exit, false)
end

any help is appreciated.

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: assistance please

Post by Belgarath »

Code: [show] | [select all] lua
for x in pairs(gmcp.Room.Info.exits) do
   send(string.format("snipe %s %s", target, x), false)
   send(string.format("%s Sniped: %s", target, x), false)
   break
end
That seems the most simple way to do it. Add whatever channel you want to send it to before "%s Sniped".
Last edited by Belgarath on Wed Oct 09, 2013 4:34 pm, edited 1 time in total.

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: assistance please

Post by Israafiyl »

First off thank you very much for your assistance!
Is there a way to incorporate the trigger line "Your arrow strikes true!" to this so I know the arrow actually hit my target, as sometimes it misses...? Thanks again Mork!

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: assistance please

Post by Israafiyl »

also it appears that the alias is not working properly. In debug I get:

LUA: ERROR running script snipe (Alias208) ERROR:[string "function Alias208()..."]:3: bad argument
#3 to 'format' (string expected, got nil)

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: assistance please

Post by Belgarath »

No problem. You can make a tempTrigger with that easily enough.
Code: [show] | [select all] lua
snipeTriggerID = tempExactMatchTrigger("Your arrow strikes true!", [[
   cecho("\n<tomato> -= [ ARROW HIT! ] =-")
   killTrigger(snipeTriggerID)
]])
And yes I noticed that. Change "exit" to "x".

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: assistance please

Post by Israafiyl »

would I put this temp trigger into the alias or would i create a trigger Your arrow strikes true! and put the above code into such?

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: assistance please

Post by Belgarath »

... You would put it in the Alias.

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: assistance please

Post by Israafiyl »

Thank you!

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: assistance please

Post by Israafiyl »

So after attempting to get this to work every way I possibly know how (which really is limited) I ask again for help.

Is there a way for me to make this:

for x in pairs(gmcp.Room.Info.exits) do
if svo.bals.balance and svo.bals.equilibrium and not svo.affl.prone then
send("shoot "..target.." "..x)
end
end

only try and shoot in the direction stored in x table until I am off balance and then store which direction I shot before losing balance and storing that value in a variable so I can pull it out when I see the trigger:

Your arrow strikes true!

I can announce over partytells which direction my target was shot. I know should just make an alias that shoots in a direction I choose but I'd like to accomplish this.

If this is not possible as I am sending all directions at one time does anyone have an idea how I could go about doing such with another method? Any assistance would be greatly appreciated!

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: assistance please

Post by Belgarath »

Code: [show] | [select all] lua
if svo.bals.balance and svo.bals.equilibrium and not svo.affl.prone then
   for x in pairs(gmcp.Room.Info.Exits) do
      lastArrowDir = x
      send(string.format("shoot %s %s", target, x))
      tempArrowTrig = tempExactMathTrigger("Your arrow strikes true!", [[
         send("pt " .. target .. " Shot: " .. lastArrowDir)
         lastArrowDir = nil
         killTrigger(tempArrowTrig)
         ]])
      break
   end
end

Post Reply