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
#2
Press CTRL+Space to show functions.
#3
There will be great, If Mega~ add operands if...then...else in BBoT
#4
(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
#5
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.
#6
Not possible.
#7
(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


Forum Jump:


Users browsing this thread: 1 Guest(s)