Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro Basic using "If & Else"
#1
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


Messages In This Thread
Macro Basic using "If & Else" - by Hunger - 08-31-2012, 12:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)