BBot - The best bot of the world
Macro Basic using "If & Else" - 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: Macro Basic using "If & Else" (/thread-4202.html)



Macro Basic using "If & Else" - Hunger - 08-31-2012

Basic exemple of "IF, ELSE" On BBOT:


Coment are = ##
Code are in Italic font

Mana:=500
# Declaration of variable

#-Comparation to be held
Self.Mana()>!Mana!
#On this line the bot compares the char mana with the variable

#-Start of the [IF]

[OnMana]

#If the comparation is [TRUE] the bot go to this block.

Self.Say(Good Mana!!)
#Action realized after the true

Exit
#End of comands

#-Start of the [ELSE]

{OnMana}
#If the comparation is [FALSE] the bot go to this block.

Self.Say(Bad Mana!!)
#Action of the block.

Exit
#End of this block


Thanks Hunger Big Grin

[Below Spoil on Portuguese - Abaixo Spoil em Portugas]

Exemplo básico de [Se Senao] No BBot:


Mana:=500
# Declaração da variavel

Self.Mana()>!Mana!
#Nessa linha o BBot compara a mana do char com o valor da variavel


[OnMana]
#Esse bloco é onde vai ficar os comandos se a comparação anterior der [TRUE]

Self.Say(Mana Boa!!)
#Ação que sera realizada apos o True

Exit
#Fim dos comandos no bloco do True

{OnMana}
#Bloco onde fica os comandos se a comparacao der [FALSE]

Self.Say(Mana Ruim!!)
#Açao do bloco

Exit
#Fim desse bloco



RE: Macro Basic using "If & Else" - Kimoszin - 08-31-2012

Press CTRL+Space to show functions.


RE: Macro Basic using "If & Else" - Fangril - 09-02-2012

There will be great, If Mega~ add operands if...then...else in BBoT


RE: Macro Basic using "If & Else" - Script Maker - 01-09-2013

(09-02-2012, 09:55 PM)Fangril Wrote: There will be great, If Mega~ add operands if...then...else in BBoT

I'm not sure but this is Lua and BBot is developed on Delphi
Maybe Mega can add a script interface Like Tibiabot NG
http://tibiabot.com/reference


RE: Macro Basic using "If & Else" - filu - 01-13-2013

Could you make a skript with auto follow? for example (I don't know how is correctly): ifnotfollowed {auto follow "nick"} or etc.
Thanks for help.


RE: Macro Basic using "If & Else" - Kimoszin - 01-14-2013

Not possible.


RE: Macro Basic using "If & Else" - zygzagZ - 03-11-2013

(01-09-2013, 01:14 AM)Script Maker Wrote:
(09-02-2012, 09:55 PM)Fangril Wrote: There will be great, If Mega~ add operands if...then...else in BBoT

I'm not sure but this is Lua and BBot is developed on Delphi
Maybe Mega can add a script interface Like Tibiabot NG
http://tibiabot.com/reference
May you use http://sourceforge.net/projects/lua4delphi/ ? Tongue
Downloaded, test file look not bad... I scripted a bit in delphi. Even tried to create own bot some time ago Tongue