First Macro (look okay?)

International

Moderator: Moderators

crashdmj
Noob
Noob
Posts: 11
Joined: 01 Aug 2013, 16:14
Noob?: Yes

First Macro (look okay?)

#1 Post by crashdmj »

So I wanted a macro that could have a slave healer send out a message to a master (character controlled) which would alert him to dwindling SP. The master would then respond by using pots if close to death. Hopefully I didn't reinvent the wheel (something kore could already do).

For the slave:

Code: Select all

##Slave##
#This macro will have slave PM the master when it's SP is below an amount.
#Good for letting your player-controlled character know when it is time 
#to use pots and not rely on the slave for heals

automacro ShoutSP {
	sp < 30 #or whatever amount is lowest sp cost for heal#
	call {
		do pm ("MainChar") (SP low) #c public, p party, g guild, pm private)#
	}
	timeout 12
}


For the master (player):

Code: Select all

##Master##
#After receiving message from slave, "SP low", will do self check to
#determines if it should use pots so as not to die! Must satisfy all
#conditions: 1) Received message from slave that "SP low", #2) HP 
#lower than set amount and 3) Has "white potion" in inventory to even use

automacro RelyOnPots {
	$.lastpmMsg ("SP low") [BotHealer]
	hp < 20%
	inventory "white potion" >= 1
	call {
		do is white potion
	}
	timeout 1
}
Any advice? Is there a big time delay between public chats, private messages and party messages? Meaning should I pick one over the other?
Cheers

EDIT: MOD PLEASE DELETE, DUPLICATE POST AND WRONG SECTIONS
User avatar
4epT
Developers
Developers
Posts: 627
Joined: 30 Apr 2008, 14:17
Noob?: No
Discord: ya4ept#8494
Location: Moskow (Russia)

Re: First Macro (look okay?)

#2 Post by 4epT »

so it will be correct to

Code: Select all

automacro ShoutSP {
   sp < 30
   call {
      do pm "MainChar" SP low
   }
   timeout 12
}

Code: Select all

automacro RelyOnPots {
   pm "SP low", BotHealer
   hp < 20%
   inventory "White Potion" >= 1
   call {
      do is White Potion
   }
   timeout 1
}
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image
crashdmj
Noob
Noob
Posts: 11
Joined: 01 Aug 2013, 16:14
Noob?: Yes

Re: First Macro (look okay?)

#3 Post by crashdmj »

Will this only look at the last PM from the sender (Bot Healer)?
User avatar
4epT
Developers
Developers
Posts: 627
Joined: 30 Apr 2008, 14:17
Noob?: No
Discord: ya4ept#8494
Location: Moskow (Russia)

Re: First Macro (look okay?)

#4 Post by 4epT »

test it :D ;) :D
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image
crashdmj
Noob
Noob
Posts: 11
Joined: 01 Aug 2013, 16:14
Noob?: Yes

Re: First Macro (look okay?)

#5 Post by crashdmj »

I will test it hopefully tonight. Thank you for your help.

I do worry that the automacro will only trigger the instance the PM is sent. I need it to trigger instantly and anytime afterwards until an all-clear is received (sp > 30) from my healer bot.
User avatar
4epT
Developers
Developers
Posts: 627
Joined: 30 Apr 2008, 14:17
Noob?: No
Discord: ya4ept#8494
Location: Moskow (Russia)

Re: First Macro (look okay?)

#6 Post by 4epT »

try this:

1. for priest:

Code: Select all

automacro ShoutSP {
   sp < 30
   timeout 12
   call {
      do pm "MainChar" SP low
   }

}
2. for second bot:

macros.txt:

Code: Select all

automacro RelyOnPots {
   pm "SP low", BotHealer
   hp < 20%
   inventory "White Potion" >= 1
   call {
      [
      do conf HP1.disabled 0
      do conf HP2.disabled 0
      ]
   }
}
config.txt:

Code: Select all

useSelf_item White Potion {
	hp < 95%
	timeout 1
	disabled 1
	label HP1
}
doCommand conf HP1.disabled 1;;conf HP2.disabled 1 {
	hp > 95%
	timeout 3
	disabled 1
	label HP2
}
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image
crashdmj
Noob
Noob
Posts: 11
Joined: 01 Aug 2013, 16:14
Noob?: Yes

Re: First Macro (look okay?)

#7 Post by crashdmj »

Code: Select all

automacro ShoutLowSP {
	sp < 20% #or whatever amount is lowest sp cost for heal#
	call {
	do pm "MainChar" SP low
	run-once 1
	macro reset ShoutFineSP
	}
}


automacro ShoutFineSP {
	sp > 20%
	call {
	do pm "MainChar" SP fine
	run-once 1
	macro reset ShoutLowSP
	}
}
I did a little experimenting and tried this but it won't seem to work. I just want him to pm my other character once when his sp is low and once again when it is fine ( >20).

Edit: I guess I get confused, when should I use "release <auto/macro name>" vs "macro reset <auto/macro name>"?
crashdmj
Noob
Noob
Posts: 11
Joined: 01 Aug 2013, 16:14
Noob?: Yes

Re: First Macro (look okay?)

#8 Post by crashdmj »

Code: Select all

##Slave##

automacro ShoutSPlow {
	sp < 20%
	run-once 1
	call {
		do pm "MainCHAR" SP low
		release ShoutSPfine #or try macro reset ShoutSPfine
	}

}



automacro ShoutSPfine {
	sp > 60%
	run-once 1
	call {
		do pm "MainCHAR" SP fine
		release ShoutSPlow
	}
}
Fixed and works now.