Tables and Autoatack

Post Reply
azure_glass
Posts: 97
Joined: Wed Jul 25, 2012 12:35 pm

Tables and Autoatack

Post by azure_glass »

I want to do something like that

I see big bad orc.

and have table like this:


OrcGuild = {
{describe1 = "big bad orc", describe2 = "pink bad orc", describe3 = "yellow bad orc", name1 = "Brain", name2 = "Brain", name3 = "Brain"},
{describe1 = "small bad orc", describe2 = "green bad orc", describe3 = "red bad orc", name1 = "Pinky", name2 = "Pinky", name3 = "Pinky"},
}

so if i meet "big bad orc" from descibe1 i want to automatly bind F1 to describe2 "kill pink bad ork"

edit: Also i can meet Brain from name1 then i want to "kill brain" from name2

How to do it?
English is not my native language. If you don't understand what im writing ask. :)
Ubuntu 17.04, Mudlet 3.1

azure_glass
Posts: 97
Joined: Wed Jul 25, 2012 12:35 pm

Re: Tables and Autoatack

Post by azure_glass »

Help please!

If something is incomprehensible i can explain.

In return. Music from youtube. :)
English is not my native language. If you don't understand what im writing ask. :)
Ubuntu 17.04, Mudlet 3.1

azure_glass
Posts: 97
Joined: Wed Jul 25, 2012 12:35 pm

Re: Tables and Autoatack

Post by azure_glass »

Image
English is not my native language. If you don't understand what im writing ask. :)
Ubuntu 17.04, Mudlet 3.1

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

Re: Tables and Autoatack

Post by Belgarath »

Who could resist Puss in Boots? Anyway, what kept me from helping you with this is the fact you aren't very clear on what you want.

What do you mean by 'meet big bad orc'? What are you triggering off of?

My advice: set a variable for the F1 macro and when you meet 'big bad orc', just set the variable to 'pink bad orc'.

Then in your macro: send("kill " .. f1)

azure_glass
Posts: 97
Joined: Wed Jul 25, 2012 12:35 pm

Re: Tables and Autoatack

Post by azure_glass »

I can do it by triggers like:

Pattern: (big bad orc|Pinky)

desc1 = "pink bad orc"
desc2 = "yellow bad orc"
nam1 = "Brain"
nam2 = "Brainer"

and f2 -> send("kill " .. desc1 ,false)
and f3 -> send("kill " .. desc2 ,false)

but i want to do that in table because is to many orcs in orc guild to be efective that way.

I have trigger like that:
Code: [show] | [select all] lua
1.  [color trigger] >>> than 
       2. [Trigger]
    - pattern: (.*)
      CODE:

local TOTABLE = string.lower(matches[2])

	if table.contains(OGRES, TOTABLE) then 
fg("red")
selectString(matches[2], 1)
replace(matches[2] .." [OGRES]")
resetFormat()

if not hasFocus() then
playSoundFile([[c:\Soundy\Pach2.wav]])
end

if FindingEnemy == 1 then
BINDENEMY()
end
end
----------------------------------------------------------------
Code: [show] | [select all] lua
OGRES = {
{desc = "bialowlosy energiczny elf", name ="elistan"},
{desc = "bladoskory przygarbiony halfling", name ="[???]"},
{desc = "blekitnooki mlody elf", name ="telmar"},]
}
And that gives me nothing...


=================================================================

So i want change table to something like this:
Code: [show] | [select all] lua
OGRES = {
{describe1 = "big bad orc", describe2 = "pink bad orc", describe3 = "yellow bad orc", name1 = "Brain", name2 = "Brain_X", name3 = "Brain_Y"},
{describe1 = "small bad orc", describe2 = "green bad orc", describe3 = "red bad orc", name1 = "Pinky", name2 = "Pinky_A", name3 = "Pinky_B"},
}

And find "describe1" OR "name1". Because i don't know all names of my enemies

than if i see describe1 do

bind f2 - to kill .. describe2
bind f3 - to kick .. describe3

OR IF find name1 then

bind f2 - to kill .. name2
bind f3 - to kick .. name3


I'm clear?
English is not my native language. If you don't understand what im writing ask. :)
Ubuntu 17.04, Mudlet 3.1

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

Re: Tables and Autoatack

Post by Belgarath »

Hmm... Would this not do it for you?
Code: [show] | [select all] lua
-- Regex Pattern: (.*)

for i,v in ipairs(OGRES) do
  if matches[1]:find(v.describe1) then
    f2 = "kill " .. v.describe2
    f3 = "kick " .. v.describe3
    break
  elseif matches[1]:find(v.name1) then
    f2 = "kill " .. v.name2
    f3 = "kick " .. v.name3
    break
  end
end

azure_glass
Posts: 97
Joined: Wed Jul 25, 2012 12:35 pm

Re: Tables and Autoatack

Post by azure_glass »

It works after few modifications!!! B_I_G T_H_A_N_K_S

In return:
https://www.youtube.com/watch?v=FHCYHldJi_g
English is not my native language. If you don't understand what im writing ask. :)
Ubuntu 17.04, Mudlet 3.1

Post Reply