BBot - The best bot of the world
error macro - Printable Version

+- BBot - The best bot of the world (https://forums.bmega.net)
+-- Forum: Support (https://forums.bmega.net/forum-6.html)
+--- Forum: Support & Help (https://forums.bmega.net/forum-8.html)
+--- Thread: error macro (/thread-21039.html)



error macro - micheel15 - 04-11-2019

I am trying to create a macro to check if the character has some kill and if it has, it will close the tibia, if it is not going to continue hunting

I'm trying this way, I do not understand much, can anyone help me?

the macro I made was this:

Exitno =:False
Exityes =:True
Self.Say(!kills)
When.Yell(!Exitno!, "You do not have any unjustified kill.*") [else2]
Exit()

{else2}
When.Yell(!Exityes!, "You have 1 unjustified kill.*") Tibia.Close()
Exit()



Could someone tell me where I'm going wrong?
this is a error :
`When` functions can only be executed inside `once` macros (no auto macros/no manual macros)


RE: error macro - MegaNo0body - 04-15-2019

(04-11-2019, 06:00 PM)micheel15 Wrote: this is a error :
`When` functions can only be executed inside `once` macros (no auto macros/no manual macros)

Make your macro an 'Once'. Where you set how much delay between very macro execution, you must set to Once.

'When' macros are tricky, they keep the macro always listening for that 'when' event (thats why it can only run once, because it runs for ever).

You have to register your 'callback', your label when that event happens

You need two macros, one that will listen for the message 'You have ... unjust' and another that says !kills from time to time, so that you ever receives the messages.
[macro]1 {Message detector}
When.SystemMessage(OnOneUnjustified, "You have 1 unjustified kill.*")
Exit()
{OnOneUnjustified}
Tibia.Close()
[/macro]

[macro]60000 {Say !kills} Self.Say(\!kills)[/macro]


RE: error macro - micheel15 - 04-15-2019

I tried and macro you sent me, but it seems to me that it is not recognizing the type of message, is it because it is not related to the system message like the invasions of bosses?

I posted the image in imgur if you can take a look, it uses the talk macro! kills, plus the close client does not recognize the message

photo:
https://imgur.com/aPkIiCW

would you have to put the whole message?


RE: error macro - MegaNo0body - 04-15-2019

try When.AnyMessage then.


RE: error macro - micheel15 - 04-15-2019

even using When.AnyMessage
still does not recognize the message!

https://imgur.com/PLu4VUz