Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MY MACRO. Help my write.
#1
I want doing macro fallow lider. Still a lot of work to do. My first problem is five line of this code:

ID_LIDER:=Creature.ByName(NAME_LIDER)
ID_MY:=Creature.ByName(NAME_MY)
k:=Creature.X(!ID_LIDER!)
z:=Creature.X(!ID_MY!)
c:=(k-z)
Self.Say(!c!)

Here I want obtain different position. When i have there i can use if-function.
For example: if (c>=2) Self.MoveE
if(c<=2) Self.MoveW.
Now function Self.Say(!c!) always return 0, function c:=(k-z) have wrong form.

My second problem is correct form function if() in BBot.

c:=(!k!-!z!) is too wrong form.
#2
(11-22-2013, 01:17 PM)tem0x43 Wrote: I want doing macro fallow lider. Still a lot of work to do. My first problem is five line of this code:

ID_LIDER:=Creature.ByName(NAME_LIDER)
ID_MY:=Creature.ByName(NAME_MY)
k:=Creature.X(!ID_LIDER!)
z:=Creature.X(!ID_MY!)
c:=(k-z)
Self.Say(!c!)

Here I want obtain different position. When i have there i can use if-function.
For example: if (c>=2) Self.MoveE
if(c<=2) Self.MoveW.
Now function Self.Say(!c!) always return 0, function c:=(k-z) have wrong form.

My second problem is correct form function if() in BBot.

c:=(!k!-!z!) is too wrong form.

what you need to do the bbot(macro) ?
#3
I play on OTS. I have two character online in the same time. I need to my one character follow my second character. Function Creature.Follow() don't work, so i want do this other way.
If c =1 or c=-1, that mean character one is next to character two (don't work anything).
If c>=2 or c<=2 that mean character which must go follow is too far followed character (then he must go step East or West).
c=0 only when both in the same place (impossible, when i going on one level)

Now i doing only X-position (East, West).
#4
(11-22-2013, 02:23 PM)tem0x43 Wrote: I play on OTS. I have two character online in the same time. I need to my one character follow my second character. Function Creature.Follow() don't work, so i want do this other way.

look, Creature.Follow (macro) requires ID, and id of all players is 99.. i don't know but i think it is impossible ..
#5
(11-22-2013, 02:40 PM)Thiaguin- Wrote:
(11-22-2013, 02:23 PM)tem0x43 Wrote: I play on OTS. I have two character online in the same time. I need to my one character follow my second character. Function Creature.Follow() don't work, so i want do this other way.

look, Creature.Follow (macro) requires ID, and id of all players is 99.. i don't know but i think it is impossible ..

The creature item id is 99, but each creature has it's own ID, which you can get by using Creature.ByName...
#6
(11-22-2013, 02:42 PM)MegaNo0body Wrote:
(11-22-2013, 02:40 PM)Thiaguin- Wrote:
(11-22-2013, 02:23 PM)tem0x43 Wrote: I play on OTS. I have two character online in the same time. I need to my one character follow my second character. Function Creature.Follow() don't work, so i want do this other way.

look, Creature.Follow (macro) requires ID, and id of all players is 99.. i don't know but i think it is impossible ..

The creature item id is 99, but each creature has it's own ID, which you can get by using Creature.ByName...

yes .. but I tried that too and not get anything .. sometimes I'm doing wrong I do not know =(
#7
Yes ID monster and player is 99 and which i get by using Creature.ByName return own ID. But i want know only why dosn't work c:=(k-z). Why don't return: ...-2..-1..0..1.2..., and always return 0?
#8
(11-22-2013, 07:05 PM)tem0x43 Wrote: Yes ID monster and player is 99 and which i get by using Creature.ByName return own ID. But i want know only why dosn't work c:=(k-z). Why don't return: ...-2..-1..0..1.2..., and always return 0?

becouse if you want to make any mathematical operations you need to use :
Code:
VarAdd(Name, Value) Increase the variable value by a given value

Inc(Name, Value) Increase the variable value by a given value

VarSub(Name, Value) Decrease the variable value by a given value

Dec(Name, Value) Decrease the variable value by a given value

VarMult(Name, Value) Multiplies the variable value by the given value

Mult(Name, Value) Multiplies the variable value by the given value

VarDiv(Name, Value) Divides the variable value by the given value

Div(Name, Value) Divides the variable value by the given value

VarMod(Name, Value) Returns the modulos remainder of the Variable by the Value

Mod(Name, Value) Returns the modulos remainder of the Variable by the Value
#9
Can you impement this in my code?


Forum Jump:


Users browsing this thread: 1 Guest(s)