Ajuda com variavel / Help with variable

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

shadycrazy
Noob
Noob
Posts: 3
Joined: 02 Dec 2012, 19:09
Noob?: No

Ajuda com variavel / Help with variable

#1 Post by shadycrazy »

[PT - BR]
Olá pessoal, tudo certo?
Primeiramente, eu sou brasileiro e meu inglês é fraco, estou usando o google tradutor aqui...
Gostaria de pedir a ajuda de vocês para me ajudarem em um uma coisa.
Fiz uma macro onde uso o comando "il". Este comando me da a posição X / Y dos itens caidos no chão a minha volta, no entando, eu preciso que me robo vá ate esses itens e use uma skill (ganancia), mais pra isso tenho que transforma a posição do item em uma variavél e é ai que esta o problema...
Sou novato em macros e só sei o basico, não sei mecher com variavéis ¬¬'
Basicamente, eu preciso tornar a coordenada X / Y que o core me der em uma variavel (ou mais se necessario) pra fazer com que meu robo va ate o item.
Poderiam me ajudar?
Obrigado a todos desde já!

[En]
Hello guys, all right?
First, I am Brazilian and my English is poor, I'm using google translator here ...
I would ask your help to help me in such a thing.
I made a macro where I use the command "il". This command me to the X / Y position of the items fallen down around me being, however, I need you to go robo until these items and use a skill (greed), so I have more to transform the position of the item in a variable is that there is this problem ...
I am new to macros and only know the basics, I do not know mecher investigated variables with ¬ ¬ '
Basically, I need to make coordinated X / Y core that gives me in a variable (or more if necessary) to make my robot go until the item.
Could you help me?
Thank you all in advance!
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: Ajuda com variavel / Help with variable

#2 Post by iMikeLance »

You should read about console events, backreferences and regex. Use (.*) or (\d+) to match item index.
shadycrazy
Noob
Noob
Posts: 3
Joined: 02 Dec 2012, 19:09
Noob?: No

Re: Ajuda com variavel / Help with variable

#3 Post by shadycrazy »

made two macros, it detects the one item and the next position variable transforms are as follows:

automacro detectarloot {
run-once 1
map mag_dun02
console /Item Exists/i
call {
do il
}
}

automacro moveloot {
run-once 1
map mag_dun02
console /.*((\d+), (\d+)).*/i
call {
$pos = $.lastMatch1
do move $pos
pause 0.2
do ss 1013
release all
}
}

in entando he still does not move the item, which may be the problem with the macro?
flashdbest
Plain Yogurt
Plain Yogurt
Posts: 61
Joined: 12 Nov 2012, 09:22
Noob?: Yes

Re: Ajuda com variavel / Help with variable

#4 Post by flashdbest »

Code: Select all

automacro moveloot {
run-once 1
map mag_dun02
console /.*((\d+), (\d+)).*/i
call {
$pos = $.lastMatch1
do move $pos
pause 0.2
do ss 1013
release all
}
}
Question does the macro above actually runs when there's a loot?

If yes the problem lies on your usage of $.lastMatch1 --- I think it should be something like: do move $.lastMatch2 $.lastMatch3

to get the variables you're looking for, try to use:
log $.lastMatch1 $.lastMatch2 $.lastMatch3 and so on...


Hope this helps.
shadycrazy
Noob
Noob
Posts: 3
Joined: 02 Dec 2012, 19:09
Noob?: No

Re: Ajuda com variavel / Help with variable

#5 Post by shadycrazy »

Well, using the first macro for detecting the position of the loot, in this case:

automacro detecloot {
run-once 1
map mag_dun02
exclusive 1
console /Item Exist|Item Apareceu/i
call {
do il
release detecloot
}
timeout 8
}

I get the information from the second item form: name # coordinated
an example:
# ------ name ------- coordinated
0 Cauda de Dragão x 1 (150, 150)
# obs: the dashes (-) do not appear

how can I make a turn starting automacro this event and transform the coordinate in a variable?
or if possible, call a macro causing the button to move back coordinate?

@edit
Please, I need help to convert the following line in a condition "console"
# ------ name ------- coordinated
0 Cauda de Dragão x 1 (150, 150)

already tried in many ways, for example:
console /(\d+) (.*) x (\d+) \((\d+) (\d+)\).*/i
console /.* x (\d+) \((\d+) (\d+)\).*/i
console /.* \((\d+) (\d+)\).*/i/
console /^.* \((\d+) (\d+)\)/i
console /.* \((\d+) (\d+)\).*/i
console /.* ((\d+) (\d+)).*/i
console /.((\d+), (\d+))/i
console /.*((\d+), (\d+))/i
console /\d+((\d+), (\d+))/i
console /0 . ((\d+), (\d+))/i
console /*((\d+), (\d+))/i
but none of these made​​, please help me :cry: