Post by tosin on Jan 6, 2024 20:56:12 GMT
I've been trying to figure out how elfbot would check a certain tile to see if there's a monster there or not.
This is needed so that if there is a monster there, the script does not try to put a magic wall there.
I've tried different scripts, but nothing has fully worked so far.
The situation is such that the boss is in the corner and the knight is next to him. It is necessary to put a magic wall around them. However, if the wall runs out and the boss manages to take the place of the wall or summon a demon there, the script still tries to put the wall there, and therefore the mage no longer shoots SDs.
The closest I have come with this script:
auto 100 dontlist | foreach 'allmonsters' $m if [($m.posx != 196 && $m.posy != 154) && $istileitem.196.154.9.2130 != 1] {useongroundxyz 3156 196 154 9}
However, the error of this script is that it controls one row (X) and then one column (Y). This means that if there is a monster on the coordinate of even one X: 196 row, he will no longer wall. The same is true with the Y coordinate.
Then I changed the '&&' and replaced it with '||'.
auto 100 dontlist | foreach 'allmonsters' $m if [($m.posx != 196 || $m.posy != 154) && $istileitem.196.154.9.2130 != 1] {useongroundxyz 3156 196 154 9}
However, this only worked as long as the boss summoned two or more Demons. Now it turned out that using
command "foreach 'allmonsters' $m" elfbot only reads the location of the first monster.
Ideally, the script could be like this:
auto 100 dontlist | if [$istilemonster.196.154.9 != 1 && $istileitem.196.154.9.2130 != 1] {useongroundxyz 3156 196 154 9}
Unfortunately, this red command is only illustrative.
I have tried in vain to find a command that would not only rotate from the X or Y coordinates, but would do it simultaneously from the XYZ coordinates. :/
This is needed so that if there is a monster there, the script does not try to put a magic wall there.
I've tried different scripts, but nothing has fully worked so far.
The situation is such that the boss is in the corner and the knight is next to him. It is necessary to put a magic wall around them. However, if the wall runs out and the boss manages to take the place of the wall or summon a demon there, the script still tries to put the wall there, and therefore the mage no longer shoots SDs.
The closest I have come with this script:
auto 100 dontlist | foreach 'allmonsters' $m if [($m.posx != 196 && $m.posy != 154) && $istileitem.196.154.9.2130 != 1] {useongroundxyz 3156 196 154 9}
However, the error of this script is that it controls one row (X) and then one column (Y). This means that if there is a monster on the coordinate of even one X: 196 row, he will no longer wall. The same is true with the Y coordinate.
Then I changed the '&&' and replaced it with '||'.
auto 100 dontlist | foreach 'allmonsters' $m if [($m.posx != 196 || $m.posy != 154) && $istileitem.196.154.9.2130 != 1] {useongroundxyz 3156 196 154 9}
However, this only worked as long as the boss summoned two or more Demons. Now it turned out that using
command "foreach 'allmonsters' $m" elfbot only reads the location of the first monster.
Ideally, the script could be like this:
auto 100 dontlist | if [$istilemonster.196.154.9 != 1 && $istileitem.196.154.9.2130 != 1] {useongroundxyz 3156 196 154 9}
Unfortunately, this red command is only illustrative.
I have tried in vain to find a command that would not only rotate from the X or Y coordinates, but would do it simultaneously from the XYZ coordinates. :/