Evaluate actions

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Posts: 1
Joined: 19 Jun 2020, 03:47
Noob?: Yes

Evaluate actions

#1 Post by jermaynel2 »

Hi Guys,

Seeking for your help to check if i'm the right path writing my macro.
The scenario is that the GM is disguising as a monster and the BOT is stuck on trying to attack the disguised GM.
The goal is to set a timeout if the bot is stuck on targeting the disguised GM and will create a file.
The reason I have created a subroutine that will create a trigger file is that I have a java program that will listen on the directory to play an alert sound if the bot is stuck on targeting for me to take manual action.

Below is my code snippet:

automacro foo {
eval AI::inQueue("attack") eq 1 #<---- Automacro will be trigger if the next action will be "attack" (Not sure if this is the right condition to check if the BOT is targeting something)
call bar
timeout 10

macro bar {
$isTargeting = @eval(AI::inQueue("attack") eq 1) #<---- Evaluated the "targeting" action and store it on a flag variable.
$isMoving = @eval(AI::action eq "move" ) #<---- Evaluated the "move" action and store it on a flag variable.
$curTimeout = 0
$maxTimeout = 3

while (($isTargeting == 1) && ($curTimeout < $maxTimeout) && ($isMoving == 0)) as loop
if($curTimeout == $maxTimeout) {
do sit
do ai off
end loop

sub writeTriggerFile{

open(FH,">",'C:/alert/alert.txt') or die "$!";
print FH "whatever\n";
close FH;


Thanks in advance

User avatar
Posts: 615
Joined: 30 Apr 2008, 14:17
Noob?: No
Location: Moskow (Russia)

Re: Evaluate actions

#2 Post by 4epT »

you can play sound from a macro using the command

Code: Select all

eval Utils::Win32::playSound("plugins/alertSound/sounds/alarm.wav")
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤

Post Reply